McqMate

Q. |
## Give a production grammar for the language L = {x/x ∈ (a,b)*, the number of a’s in x is multiple of 3}. |

A. | {S->bS,S->b,S->aA,S->bA,A->aB,B->bB,B->aS,S->a} |

B. | {S->aS,S->bA,A->bB,B->bBa,B->bB} |

C. | {S->aaS,S->bbA,A->bB,B->ba} |

D. | None of the above |

Answer» A. {S->bS,S->b,S->aA,S->bA,A->aB,B->bB,B->aS,S->a} |

4.6k

0

Do you find this helpful?

37

View all MCQs in

Theory of ComputationNo comments yet

- Which of the following are decidable? 1) Whether the intersection of two regular language is infinite. 2) Whether a given context free language is regular. 3) Whether two push down automata accept the same language. 4) Whether a given grammar is context free.
- Let P be a regular language and Q be context-free language such that Q ∈ P. (For example, let P be the language represented by the regular expression p*q* and Q be {pnqn n∈ N}). Then which of the following is ALWAYS regular?
- All NonNull words of the CFL can be generated by the corresponding CFG which is in CNF i.e the grammar in CNF will generate the same language except the:
- Let L denotes the language generated by the grammar S – OSO/00. Which of the following is true?
- Any Language generated by an unrestricted grammar is:
- The production Grammar is {S->aSbb,S->abb} is
- Consider the regular language L = (111+111111)*. The minimum number of states inany DFA accepting this language is
- What is the highest type number which can be applied to the following grammar? S —>Aa, A —> Ba, B —>abc
- Consider the following statements about the context free grammar G = {S - >SS,S - >ab,S ->ba, S - ε} I. G is ambiguous II. G produces all strings with equal number of a’s and b’s III. G can be accepted by a deterministic PDA. Which combination below expresses all the true statements about G?
- Consider a string s over (0+1)*. The number of 0’s in s is denoted by no(s) and the number of 1’s in s is denoted by n1(s). The language that is not regular is