Computer Science And Engineering

Computer Science And EngineeringTheory of Computation / FLATMultiple Choice (MCQ)1 Mark
Q3.

Consider the following context-free grammar GG, where SS, AA, and BB are the variables (non-terminals), aa and bb are the terminal symbols, SS is the start variable, and the rules of GG are described as:

SaaBAbbS \rightarrow aaB \mid Abb AaaAA \rightarrow a \mid aA BbbBB \rightarrow b \mid bB

Which ONE of the languages L(G)L(G) is accepted by GG?

A
L(G)={a2bnn1}{anb2n1}L(G) = \{a^2b^n \mid n \ge 1\} \cup \{a^nb^2 \mid n \ge 1\}
B
L(G)={anb2nn1}{a2nbnn1}L(G) = \{a^nb^{2n} \mid n \ge 1\} \cup \{a^{2n}b^n \mid n \ge 1\}
C
L(G)={anbnn1}L(G) = \{a^nb^n \mid n \ge 1\}
D
L(G)={a2nb2nn1}L(G) = \{a^{2n}b^{2n} \mid n \ge 1\}