The context free grammar given by
S → XYX
X → aX|bX|λ
Y → bbb
generates the language which is defined by regular expression:
(A) (a + b)*bbb
(B) abbb(a + b)*
(C) (a + b)*(bbb)(a + b)*
(D) (a + b)(bbb)(a + b)*
Answer: (C)
Explanation: S → XYX
X → aX|bX|λ
i.e. (a + b)*
Y → bbb
S → (a + b)*(bbb)(a + b)*
So, option (C) is correct.
Quiz of this Question
Article Tags :
Recommended Articles