Question
Consider the following two languages over the alphabet , where and are natural numbers.
Which ONE of the following statements is CORRECT?
Official answer and solution
- Official answer
- C
- From
- Official GATE 2025 answer key
Solution
Rewrite the exponent of and check whether a single stack can verify the constraints.
- Analysis of :
- requires simultaneously checking that the number of 's equals the number of 's and that the number of 's is strictly greater than . A single-stack PDA loses the count once it pops the 's against the 's, so is not a context-free language.
- Analysis of :
- We can rewrite .
- A PDA can push all 's onto the stack, then push all 's onto the stack, then pop the 's against the first 's, and finally pop the 's against the remaining 's (generated by the CFG ). Thus is a context-free language.
Final answer
Option (C)
The answer is the one in the official GATE answer key. The solution is this site's own explanation.
Source
- Paper
- GATE 2025 Computer Science and Information Technology - Session 1 (CS1)
- Question
- 45 of 65
- Section
- Computer Science and Information Technology
Report an error in this question
GATE questions are the work of the organising institutes. This site is independent and is not affiliated with them.