Consider the following two languages over the alphabet , where and are natural numbers.
Which ONE of the following statements is CORRECT?
GATE CSE 2025Theory of Computation › Context-Free Languages & Pushdown AutomataVerified
(C) L 1 L_{1} L 1 is not a context-free language but L 2 L_{2} L 2 is a context-free language.
Classify $L_1$ and $L_2$ separately. $L_1$ is a standard non-context-free language because it forces three-way agreement $a^m b^m c^m$, with additional trailing $c$'s. $L_2$ is context-free because its condition is only that the number of $c$'s equals the total number of $a$'s and $b$'s, which a pushdown automaton can check by pushing all $a$'s and $b$'s and then popping one symbol per $c$.
The key distinction is that $L_1$ needs $a,b,c$ to agree in the pattern $a^m b^m c^m$ before the extra $c$'s, which no PDA can verify. $L_2$ needs only the total count relation $\#c=\#a+\#b$, which a PDA can verify by pushing all $a$'s and $b$'s and popping on $c$'s. Hence option C.
Reviewed by GateIQ Editorial Team: IIT & IISc Alumni.