GATE / CS ARCHIVE

GATE CSE 2005 / QUESTION 57

Marked palindromes versus copying

Theory of Computation · Pushdown Automata · Full GATE CSE 2005 paper

GATE 2005, Q57 2 marks · MCQ
Report issue

Pushdown Automata

Question 57, GATE 2005: For binary w, L1={wwᴿ}, L2={w#wᴿ} with special delimiter#, L3={ww}. Which is true? A L1 deterministic CFL; B L2 deterministic CFL; C L3 CFL but not deterministic; D L3 deterministic CFL.
Tap to enlarge
Your answer
Answer & solution

Answer: B (no official key was published)

For L2={w#wR}, a DPDA pushes before # and then deterministically pops and compares after #; it accepts exactly upon a complete match. L1={wwR} has no delimiter and is context-free but not deterministic context-free. L3={ww} is not context-free. Therefore B.

For the delimited language, # tells the PDA exactly when to switch from pushing to comparing/popping. Every decision is determined by current input and stack top, so the recognizer is deterministic. Without the delimiter, a palindrome PDA must in general choose the midpoint nondeterministically. The duplicated-word language requires preserving the same order twice, not the reverse stack order, and is not CFL. These distinctions are about whole language classes, not whether some individual examples can be recognized.

Original paper, page 7