- GATE CS
- 2026–27 pattern practice
- Theory of Computation
- Context-free grammars
- Easy
The language is
Context-Free Languages
Pick an option to check your answer.
Answer: B. Solution
- Context-free: the grammar generates exactly (and a PDA can push 's and pop on 's).
- Not regular: by the pumping lemma, take ; pumping inside the first symbols changes only the number of 's, giving a string outside .
Why not the others
- regular — a finite automaton cannot count an unbounded number of 's.
- context-sensitive but not context-free — it is context-free; is the classic context-sensitive example.
- not recursively enumerable — every context-free language is decidable.