Skip to content
Mad4Study

Engineering & Science

GATE Computer Science

  • GATE CS
  • 2026–27 pattern practice
  • Theory of Computation
  • Context-free grammars
  • Easy

Which of the following languages is NOT context-free?

Context-Free Languages

Pick an option to check your answer.

{anbncn}\{a^n b^n c^n\} needs three counts to match, but a pushdown automaton has a single stack, which can match only one pair. The pumping lemma for CFLs confirms it is not context-free.

Why not the others

  • {anbn:n≥0}\{a^n b^n : n \ge 0\} is generated by S→aSb∣εS \to aSb \mid \varepsilon.
  • {wwR}\{w w^R\}, even-length palindromes, is generated by S→aSa∣bSb∣εS \to aSa \mid bSb \mid \varepsilon.
  • {ambn}\{a^m b^n\} is regular, and every regular language is context-free.

Report an error

GATE CS · Theory of Computation · Context-Free Languages