Questions: Limitations of Context-Free Languages

5 questions to test your understanding

Score: 0 / 5
Question 1 Multiple Choice

A pushdown automaton can recognize {aⁿbⁿ} — strings with equal numbers of a's and b's — but cannot recognize {aⁿbⁿcⁿ}. Why?

AA PDA can only process alphabets with two symbols, and {aⁿbⁿcⁿ} requires three
BA single stack can verify one pair of dependencies: push during a's, pop during b's. But by the time the a-b match is verified, the stack is empty and no information remains to verify the b-c match simultaneously
CThe pumping lemma prohibits any language with three distinct symbols from being context-free
D{aⁿbⁿcⁿ} is actually context-free, but requires a two-stack PDA to recognize it
Question 2 Multiple Choice

To prove {aⁿbⁿcⁿ} is not context-free using the pumping lemma, you pick the string aᵖbᵖcᵖ and try all possible ways to divide it into uvxyz. Why does pumping always fail to keep all three counts equal?

AThe pumping lemma requires |vxy| ≤ p, which means v and y together can span at most one contiguous region and cannot simultaneously affect the a-count, b-count, and c-count
BThe string aᵖbᵖcᵖ is too long for the pumping lemma to apply correctly
CPumping always decreases the total string length, so equality cannot be preserved
DThe pumping lemma only applies to regular languages; it cannot be used to prove a language is not context-free
Question 3 True / False

A pushdown automaton with a single stack can recognize languages that require matching three independently nested groups (like ensuring equal counts of a's, b's, and c's) if the stack operations are designed cleverly enough.

TTrue
FFalse
Question 4 True / False

The limitations of context-free languages are relevant to real programming language design — some language features cannot be checked by a context-free parser and require more powerful mechanisms.

TTrue
FFalse
Question 5 Short Answer

Why does having only one stack limit what a pushdown automaton can verify, and how does replacing the stack with an unrestricted tape (as in a Turing machine) overcome this limitation?

Think about your answer, then reveal below.