GATE / CS ARCHIVE

GATE CSE 2014 SET 3 / QUESTION 36

GATE CSE 2014 Set 3 Q36

Theory of Computation · Pushdown Automata · Full GATE CSE 2014 Set 3 paper

GATE 2014 Set 3, Q36 2 marks · MCQ
Report issue

Pushdown Automata

Question 36, GATE 2014: Over Σ={0,1,c}, define L1={0ⁿ1ⁿ:n≥0}, L2={wcwʳ:w∈{0,1}*}, L3={wwʳ:w∈{0,1}*}, with wʳ the reversal of w. Which languages are deterministic context-free? A none; B only L1; C only L1,L2; D all three.
Tap to enlarge
Your answer
Answer & solution

Official answer: C

Step 1: For L1, a deterministic pushdown automaton pushes one marker per 0 and switches to popping when the first 1 appears. The input symbol change identifies the phase boundary; accept when the counts match. Step 2: For L2, push the first binary word, then the marker c deterministically signals the switch to matching and popping its reverse. Step 3: In L3 there is no midpoint marker. An arbitrary binary even palindrome requires a nondeterministic choice of when to switch, and this unmarked palindrome language is a standard CFL that is not deterministic context-free. Therefore C. The final claim is the known non-DCFL result, not a claim that every language with an unmarked midpoint is automatically nondeterministic.

Original paper, page 61 · Answer key