Home / Engineering / Theory of Computation / Question

M

Mr. Dubey • 51.17K Points
Coach

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
Correct answer : Option (A) - {S->bS,S->b,S->aA,S->bA,A->aB,B->bB,B->aS,S->a}

Share

Discusssion

Login to discuss.