Theory Of Computation MCQ

1:

A grammar to generate
{ (ab)n I n ≥ 1 }  ∪  { (ba)n I n ≥ 1 }
is constructed as

A.

S ---> S1, S1 ---> abS1,  S1 ---> ab,  S ---> S2, S2 —> baS2, S2 —> ba

B.

S ---> S, Sl ---> aS1, S1 ---> ab, S ---> S2, S2 ---> bS2, S2 —> bc

C.

S —> S1,  S1—>S2, S2 —> S1a, S1 —> ab, S2 —> ba

D.

none of these

 

Answer : C

Explanation :

Write your comments here:


Report Error
 

Option: A

Explanation : Explanation will come here. Explanation will come here. Explanation will come here. Explanation will come here. Explanation will come here.