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 mentioned
I got this question by my college professor while I was bunking the class.
My doubt stems from Regular Grammar in chapter Contextfree Grammar and Syntax Analysis of Compiler