Skip to content
Related Articles

Related Articles

Improve Article
Save Article
Like Article

GATE | GATE IT 2006 | Question 33

  • Last Updated : 14 Jul, 2017

Consider the pushdown automaton (PDA) below which runs over the input alphabet (a, b, c). It has the stack alphabet {Z0, X} where Z0 is the bottom-of-stack marker. The set of states of the PDA is (s, t, u, f} where s is the start state and f is the final state. The PDA accepts by final state. The transitions of the PDA given below are depicted in a standard manner. For example, the transition (s, b, X) → (t, XZ0) means that if the PDA is in state s and the symbol on the top of the stack is X, then it can read b from the input and move to state t after popping the top of stack and pushing the symbols Z0 and X (in that order) on the stack.
(s, a, Z0) → (s, XXZ0)
(s, ϵ, Z0) → (f, ϵ)
(s, a, X) → (s, XXX)
(s, b, X) → (t, ϵ)
(t, b, X) → (t,.ϵ)
(t, c, X) → (u, ϵ)
(u, c, X) → (u, ϵ)
(u, ϵ, Z0) → (f, ϵ)

The language accepted by the PDA is
(A) {albmcn | l = m = n}
(B) {albmcn | l = m}
(C) {albmcn | 2l = m+n}
(D) {albmcn | m=n}


Answer: (C)

Explanation: Every input ‘a’ inserts two X into the stack and each X can be consumed by ‘b’ or ‘c’ only. On input ‘a’ there is no rule which gives ϵ. Thus for each ‘a’, termination is performed by ‘b’ or ‘c’ or both.

Attention reader! Don’t stop learning now.  Practice GATE exam well before the actual exam with the subject-wise and overall quizzes available in GATE Test Series Course.

Learn all GATE CS concepts with Free Live Classes on our youtube channel.

Example:
Input:
a 3 b 2 c 4
Stack:Z 0
After three a’s:
Stack:
XXXXXXZ 0
After two b’s:
Stack:
XXXXZ 0
After four c’s:
You can reach the final state.
a 3 b 2 c 4 is also accepted here.

Quiz of this Question

My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!