ISRO Scientist/Engineer CSE 2023Theory of Computation › Not yet assigned to a topic
ISRO Scientist/Engineer CSE 2023 PYQ: Consider the context-free grammer $G$ below. There $S$ is the starting non terminal symbol, while $a$ and…
Consider the context-free grammer $G$ below. There $S$ is the starting non terminal symbol, while $a$ and $b$ are terminal symbols.
$S \rightarrow aaSb | T$
$T \rightarrow Tb | a$
Which of the following statments is true about the language $L(G)$ generated by $G$?
- A$aabbaabb$ belongs to $L(G)$ but $aabb$ does not
- B$aaaaabbb$ belongs to $L(G)$ but $aaaabb$ does notCorrect answer
- C$aaaabb$ belongs to $L(G)$ but $aabbaabb$ does not
- D$aaabb$ belongs to $L(G)$ but $aaaaabbb$ does not
Answer
(B) $aaaaabbb$ belongs to $L(G)$ but $aaaabb$ does not
Approach
The grammar generates strings of the form $a^{2n} a b^{m} b = a^{2n+1} b^{m+1} \text{with} n ≥ 0, m ≥ 0. \text{Equivalently,} L(G) = { a^{2n+1} b^{m+1} | n ≥ 0, m ≥ 0}$ }. We check each option against this characterization.
Reviewed by ISRO IQ Editorial Team.