Which of the following languages over is accepted by a deterministic pushdown automata?
Note: is the string obtained by reversing .
View worked solution
Answer: A
A language is accepted by a Deterministic Pushdown Automaton (DPDA) if and only if it is a Deterministic Context-Free Language (DCFL).
- Option A:
The symbol acts as a clear, unique marker separating and . The DPDA can push symbols of onto the stack, and upon reading , deterministically switch to popping and matching the remaining input against the stack. Thus, it is a DCFL and accepted by a DPDA. - Option B:
There is no middle marker. A PDA must non-deterministically guess the midpoint where ends and begins. Hence, it is not a DCFL. - Option C:
This is a well-known non-context-free language (CSL) and cannot be accepted by any PDA. - Option D: Palindromes over
This includes even-length palindromes () and odd-length palindromes (). Without a designated marker to identify the exact midpoint, it requires non-deterministic guessing and is not a DCFL.
Free practice · Your answers on this page are not saved.
