Push-down Automata · Theory of Computation
10 questions · asked in 9 of 27 years (2000–2026)
MCQ 9 · NAT 11-mark 6 · 2-mark 4
2000Questions per year2026
Questions 1–5 of 10
Which ONE of the following languages is accepted by a deterministic pushdown automaton?
Answer: (A)
A deterministic pushdown automaton (DPDA) accepts only the deterministic context-free languages (DCFLs). These form a proper subset of all context-free languages. Some CFLs, such as those where the machine must "guess" the midpoint of a string, are inherently non-deterministic. No DPDA can accept them. Only a general (non-deterministic) PDA can.
Every regular language can be recognized by a DFA. A DFA is also a valid DPDA that never uses its stack. So every regular language is accepted by some DPDA.
The other options are too broad, so a DPDA is not guaranteed to accept them. "Any context-free language" and "any NPDA-accepted language" mean the same, larger class, and the DPDA class is strictly smaller. "Any decidable language" is a far larger class, and it includes languages that are not even context-free.
Answer: Any regular language.
Every regular language can be recognized by a DFA. A DFA is also a valid DPDA that never uses its stack. So every regular language is accepted by some DPDA.
The other options are too broad, so a DPDA is not guaranteed to accept them. "Any context-free language" and "any NPDA-accepted language" mean the same, larger class, and the DPDA class is strictly smaller. "Any decidable language" is a far larger class, and it includes languages that are not even context-free.
Answer: Any regular language.
Consider the pushdown automaton (PDA) below, which runs on the input alphabet , has stack alphabet , and has three states , with being the start state. A transition from state to state , labelled , where is an input symbol or , is a stack symbol, and is a string of stack symbols, represents the fact that in state , the PDA can read from the input, with on the top of its stack, pop from the stack, push in the string on the stack, and go to state . In the initial configuration, the stack has only the symbol in it. The PDA accepts by empty stack.
Which one of the following options correctly describes the language accepted by ?
Which one of the following options correctly describes the language accepted by ?
Answer: (A)
Look at the PDA transitions:
- In s, each a pushes one A, so m a's put m A's on the stack.
- The first b takes the PDA to p and pops an A. Each next b pops one more A.
- The stack can only be emptied by going to q. Both moves into q need an A on top. In q, the A's that are left and get popped.
So at least one A must remain after the b's are read. This gives , and also (with no a's, there is no A to go to q).
Answer:
- In s, each a pushes one A, so m a's put m A's on the stack.
- The first b takes the PDA to p and pops an A. Each next b pops one more A.
- The stack can only be emptied by going to q. Both moves into q need an A on top. In q, the A's that are left and get popped.
So at least one A must remain after the b's are read. This gives , and also (with no a's, there is no A to go to q).
Answer:
In a pushdown automaton , a transition of the form,
where , represents
Consider the following pushdown automaton over the input alphabet and stack alphabet .
The number of strings of length 100 accepted by the above pushdown automaton is ___________
where , represents
Consider the following pushdown automaton over the input alphabet and stack alphabet .
The number of strings of length 100 accepted by the above pushdown automaton is ___________
Answer: 50
The PDA first pushes # and then pushes one A for each a. In q2, each b pops one A. It can reach the final state q3 only when an A is still on top of the stack.
So the strings it accepts are with the condition . For length 100, take m + n = 100 with n m n = 0, 1, , 49 50 strings.
Answer: 50
So the strings it accepts are with the condition . For length 100, take m + n = 100 with n m n = 0, 1, , 49 50 strings.
Answer: 50
Consider the transition diagram of a PDA given below with input alphabet ={a,b} and stack alphabet ={X,Z}. Z is the initial stack symbol. Let L denote the language accepted by the PDA.
Which one of the following is TRUE?
Which one of the following is TRUE?
Answer: (D)
Read the diagram. In the start state (also final), each pushes an on top of . Reading with on top pops it and moves to the middle state, where each further pops one . When is on top, an move goes to the last (final) state. So the PDA accepts for (stopping in the start state), and for . Thus .
The PDA is deterministic: no state has a choice for the same input and stack top. In the start state, is used with or and only with . In the middle state, needs on top and the move needs on top, so they never compete. So is a deterministic CFL.
Other options: (A) names the language , which is not , and the claim is not about . (B) says has no DPDA, but the PDA above is one. (C) is false because every CFL is accepted by a Turing machine that halts on every input.
Answer: (D)
The PDA is deterministic: no state has a choice for the same input and stack top. In the start state, is used with or and only with . In the middle state, needs on top and the move needs on top, so they never compete. So is a deterministic CFL.
Other options: (A) names the language , which is not , and the claim is not about . (B) says has no DPDA, but the PDA above is one. (C) is false because every CFL is accepted by a Turing machine that halts on every input.
Answer: (D)
Consider the NPDA , where (as per usual convention) Q is the set of states, is the input alphabet, is the stack alphabet, is the state transition function, is the initial state, is the initial stack symbol, and is the set of accepting states. The state transition is as follows:
Which one of the following sequences must follow the string 101100 so that the overall string is accepted by the automaton?
Which one of the following sequences must follow the string 101100 so that the overall string is accepted by the automaton?
Answer: (B)
The automaton works in three phases. In the first state it pushes each input symbol on the stack. It then moves to the middle state, either on or by reading one symbol (an optional middle symbol) without changing the stack. In the middle state, reading pops a and reading pops a . When only is left, an move goes to the final state. So the input must be , where is or one symbol and is the reverse of with every bit complemented.
The total length is , which is odd, so there is a middle symbol: and . So (the first five symbols of ) and the middle symbol is the sixth, . The five symbols that follow are .
Reverse of : . Complement: . All five pushed symbols are then popped, so the machine can reach the final state.
Note: the paper's figure names the states q0, q2 and q3 (read them as q0, q1 and q2, as in the text) and writes the stack top as Z, which is not in the stack alphabet. Z stands for the current stack symbol, with at the bottom.
Answer: (B)
The total length is , which is odd, so there is a middle symbol: and . So (the first five symbols of ) and the middle symbol is the sixth, . The five symbols that follow are .
Reverse of : . Complement: . All five pushed symbols are then popped, so the machine can reach the final state.
Note: the paper's figure names the states q0, q2 and q3 (read them as q0, q1 and q2, as in the text) and writes the stack top as Z, which is not in the stack alphabet. Z stands for the current stack symbol, with at the bottom.
Answer: (B)
Keep practising