Which one of the following languages over is NOT context-free?
View worked solution
Answer: C
To determine which language is NOT context-free, let us analyze each option:
- Option A: is a classic context-free language (even-length palindromes) generated by the CFG: .
- Option B: has nested dependencies. The outer part and the inner part can both be processed using a single stack in LIFO order. It is generated by the CFG: Thus, it is context-free.
- Option C: contains overlapping (cross-serial) dependencies. We must match with , and with . Since appears before , a single stack cannot maintain the count of while simultaneously matching with . This requires two independent comparisons, which is beyond the capability of a Pushdown Automaton. Hence, this language is not context-free.
- Option D: is the union of three context-free languages: . Since context-free languages are closed under union, this language is context-free.
Free practice · Your answers on this page are not saved.
