UGC NET CS 2022Theory of Computation and Compilers › Context Free LanguageVerified
UGC NET CS 2022 PYQ: Consider the production rules of grammar G: $$\begin{array}{l} \mathrm{S} \rightarrow \mathrm{AbB} \\…
Consider the production rules of grammar G:
$$\begin{array}{l}
\mathrm{S} \rightarrow \mathrm{AbB} \\
\mathrm{A} \rightarrow \mathrm{aAb} \mid \lambda \\
\mathrm{B} \rightarrow \mathrm{bB} \mid \lambda
\end{array}$$
Which of the following language $L$ is generated by grammer $G$ ?
- A$\text L=\left\{a^{n} b^{m}: n \geq 0, m>n\right\}$Correct answer
- B$\text L=\left\{a^{n} b^{m}: n \geq 0, m \geq 0\right\}$
- C$L=\left\{a^{n} b^{m}: n \geq m\right\}$
- D$L=\left\{a^{n} b^{m}: n \geq m, m>0\right\}$
Answer
(A) $\text L=\left\{a^{n} b^{m}: n \geq 0, m>n\right\}$
Approach
Derive the string form generated by S by combining what A and B each generate.
Reviewed by UGC IQ Editorial Team.