GATE / CS ARCHIVE

GATE CSE 1998 / QUESTION 13(a)

Language of a PDA

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

GATE 1998, Q13(a) Descriptive
Report issue

Pushdown Automata

Question 13(a), GATE 1998: For the displayed PDA on states q0,q1, alphabet {0,1}, stack {Z0,X}, start (q0,Z0), and empty-store acceptance, determine its language. Common transitions: (q0,1,Z0)→(q0,XZ0), (q0,ε,Z0)→(q0,ε), (q0,1,X)→(q0,XX), (q1,1,X)→(q1,ε). GFG has (q0,0,Z0)→(q1,X) and (q1,0,Z0)→(q0,Z0); GateForum instead has (q0,0,X)→(q1,X) and (q0,0,Z0)→(q0,Z0).
Question 13(a), GATE 1998: For the displayed PDA on states q0,q1, alphabet {0,1}, stack {Z0,X}, start (q0,Z0), and empty-store acceptance, determine its language. Common transitions: (q0,1,Z0)→(q0,XZ0), (q0,ε,Z0)→(q0,ε), (q0,1,X)→(q0,XX), (q1,1,X)→(q1,ε). GFG has (q0,0,Z0)→(q1,X) and (q1,0,Z0)→(q0,Z0); GateForum instead has (q0,0,X)→(q1,X) and (q0,0,Z0)→(q0,Z0).
Tap to enlarge
Answer & solution

Answer: As printed: {ε, 01}. A plausible repaired PDA accepts (⋃_(n≥1)1^n01^n0)*. (no official key was published)

Empty-store acceptance requires both the entire input to be consumed and the stack to be empty. Merely reaching Z0, or emptying the stack while unread input remains, is not sufficient. The two printed transition sets differ materially, so there is no source-independent single language.

The paper literal version: at (q0,Z0), ε can pop Z0 and accept ε. Reading 0 uses its printed transition (q0,0,Z0)→(q1,X), replacing Z0 rather than preserving it. One subsequent 1 pops X and accepts 01 with an empty stack. No further input can then be consumed. Reading any 1 first puts X above Z0 in q0; that state can only push more X on further 1s, because the paper's zero transition tests Z0, not X. It can never enter its popping phase from such a stack. Thus L={ε,01}. The printed q1,0,Z0 return transition is unreachable from the start in this literal machine.

It cannot empty Z0. Hence no string containing a 1 is accepted and L_GF=0*.

It pushes n≥1 Xs on 1s, reads 0 to switch phase, pops n Xs on 1s, then reads another 0 to return to q0. It can repeat such blocks and finally pop Z0 by ε. Conditional on exactly those repairs, the language is (⋃_(n≥1){1^n01^n0})*. The choice n≥1 is necessary because no q0,0,Z0 transition remains in this repair. This reconstructed answer is useful but not verified as the original question; silently substituting it would conceal different literal answers.

Original paper, page 7