0% found this document useful (0 votes)
66 views14 pages

Toc-Unit-5 Push Down Automata

The document contains a series of multiple-choice questions (MCQs) related to Push Down Automata (PDA), covering topics such as the differences between PDA and finite automata, operations on stacks, and the capabilities of deterministic and non-deterministic PDAs. It includes explanations for each answer, emphasizing the theoretical aspects of automata theory and context-free languages. The content is aimed at computer engineering students, particularly those studying at Savitribai Phule Pune University.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
66 views14 pages

Toc-Unit-5 Push Down Automata

The document contains a series of multiple-choice questions (MCQs) related to Push Down Automata (PDA), covering topics such as the differences between PDA and finite automata, operations on stacks, and the capabilities of deterministic and non-deterministic PDAs. It includes explanations for each answer, emphasizing the theoretical aspects of automata theory and context-free languages. The content is aimed at computer engineering students, particularly those studying at Savitribai Phule Pune University.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 14

lOMoARcPSD|13492039

TOC Unit 5-PDA MCQ Qb - bdb

computer engineer (Savitribai Phule Pune University)

Studocu is not sponsored or endorsed by any college or university


Downloaded by Saurav Hathi ([email protected])
lOMoARcPSD|13492039

STQA Unit-5 MCQ


Push Down Automata

1. A push down automata is different than finite automata by:


(A) Its memory
(B) Number of states
(C) Both (a) and (b)
(D) None of these
Ans: A
Expanation: Finite automata don’t have any memeory to store data

2. ​Which automata takes stack as storage?


(A) ​Finite automata
(B) ​Push down automata
(C) ​Turing machine
(D) ​Regular expression
Ans: b
Expanation: PDA uses stack as storage, TM uses tape as storage, FA don’t have memory
to store

3. The transition a Push down automaton makes is additionally dependent


upon the: ​a) stack
b) input tape
c) terminals
d) none of the mentioned
Answer: a
Explanation: A PDA is a finite machine which has an additional stack storage. Its
transitions are based not only on input and the correct state but also on the stack.

4. ​PDA is more powerful than


(A) Turing machine
(B) Multi tape Turing machine
(C) Finite automata
(D) All of these
Answer : C
Explanation: A PDA is more powerful than FA. Any language which can be acceptable by
FA can also be acceptable by PDA. PDA also accepts a class of language which even
cannot be accepted by FA. Thus PDA is much more superior to FA.

5. ​Which of the following are the actions that operates on stack top?
(A) ​Pushing
(B) ​Updating
(C) ​Popping

Downloaded by Saurav Hathi ([email protected])


lOMoARcPSD|13492039

(D) ​All of the mentioned


Answer : D
Explanation: in PDA all operation are opertaes on top of the stack(ToS)

6. With reference of a DPDA, which among the following do we perform from the
start state with an empty stack?
a) process the whole string
b) end in final state
c) end with an empty stack
d) all of the mentioned
Answer: d
Explanation: The empty stack in the end is our requirement relative to finite state
automatons.

7. A DPDA is a PDA in which:


a) No state p has two outgoing transitions
b) More than one state can have two or more outgoing transitions
c) Atleast one state has more than one transitions
d) None of the mentioned
Answer: a
Explanation: A Deterministic Push Down Automata is a Push Down Automata in which
no state p has two or more transitions.

8. State true or false:


Statement: For every CFL, G, there exists a PDA M such that L(G) = L(M) and
vice versa. a) true
b) false
Answer: a
Explanation: There exists two lemma’s such that:
a) Given a grammar G, construct the PDA and show the equivalence
b) Given a PDA, construct a grammar and show the equivalence

9. If the PDA does not stop on an accepting state and the stack is not empty,
the string is: ​a) rejected
b) goes into loop forever
c) both (a) and (b)
d) none of the mentioned
Answer: a
Explanation: To accept a string, PDA needs to halt at an accepting state and with a stack
empty, else it is called rejected. Given a PDA M, we can construct a PDA M’ that accepts
the same language as M, by both acceptance criteria.

Downloaded by Saurav Hathi ([email protected])


lOMoARcPSD|13492039

10. A language accepted by Deterministic Push down automata is closed under


which of the following?
a) Complement
b) Union
c) Both (a) and (b)
d) None of the mentioned
Answer: a
Explanation: Deterministic Context free languages(one accepted by PDA by final
state), are drastically different from the context free languages. For example they
are closed under complementation and not union.

11. The instantaneous PDA is has the following elements


a) State
b) Unconsumed input
c) Stack content
d) All of the mentioned
Answer: d
Explanation: The instantaneous description of a PDA is represented by 3
tuple: (q,w,s) where q is the state, w is the unconsumed input and s is
the stack content.

12. A push down automata can represented using:


a) Transition graph
b) Transition table
c) ID
d) All of the mentioned
Answer: d
Explanation: Yes, a PDA can be represented using a transition diagram, transition
table and an instantaneous description.

13. State true or false:


Statement: Every context free grammar can be transformed into an equvalent non
deterministic push down automata.
a) true
b) false
Answer: a
Explanation: Push down automata is the automaton machine for all the context free
grammar or Type 2 languages.

14. Which of the following statement is false?

Downloaded by Saurav Hathi ([email protected])


lOMoARcPSD|13492039

a) For non deterministic PDA, equivalence is undecidable


b) For deterministic PDA, equivalence is decidable
c) For deterministic PDA, equivalence is undecidable.
d) None of the mentioned
Answer: c
Explanation: Geraud proved the equivalence problem decidable for Deterministic PDA .
15. Which of the following are the actions that operates on stack top?
a) Pushing
b) Popping
c) Replacing
d) All of the mentioned
Answer: d
Explanation: Push, pop and replace are all the basic and only operations that takes
place on stack top.

16. A push down automata is said to be _________ if it has atmost one transition
around all configurations.
a) Finite
b) Non regular
c) Non-deterministic
d) Deterministic
Answer: d
Explanation: DPDA or Deterministic Push down automata has atmost one transition
applicable to each configuration.

17. A pushdown automata can be defined as: (Q, ∑, G, q0, z0, A, d) ​What does the
symbol z0 represents?
a) an element of G
b) initial stack symbol
c) top stack alphabet
d) all of the mentioned
Answer: d
Explanation: z0 is the initial stack symbol, is an element of G. Other symbols like d
represents the transition function of the machine.

18. Which among the following is true for the given statement?
Statement :If there are strings R and T in a language L so that R is prefix of T and
R is not equivalent to T.
a) No DPDA can accept L by empty stack
b) DPDA can accept L by an empty stack
c) L is regular
d) None of the mentioned

Downloaded by Saurav Hathi ([email protected])


lOMoARcPSD|13492039

Answer: a
Explanation: If M is a DPDA accepting L by an empty stsck, R and T are distinct strings in
L, and R is a prefix of T, then the sequence of moves M must make in order to accept R
leaves the stack empty, since R L. But then T cannot be accepted, since M cant move
with an empty stack. ∈
19. Which of the following can be accepted by a DPDA?
a) The set of even length palindrome over {a,b}
b) The set of odd length palindrome over {a,b}
c​
c) {xx​ | where c stands for the complement,{0,1}}
d) None of the mentioned
Answer: d
Explanation: Theorem: The language pal of palindromes over the alphabet {0,1} cannot be
accepted by any finite automaton , and it is therefore not regular.

20 A push down automaton employs ________ data structure.


a) Queue
b) Linked List
c) Hash Table
d) Stack
Answer: d
Explanation: A push down automata uses a stack to carry out its operations. They are
more capable than the finite automatons but less than the turing model.

21. State true or false:


Statement: The operations of PDA never work on elements, other than
the top. ​a) true
b) false
Answer: a
Explanation: The term pushdown refers to the fact that the elements are pushed down in
the stack and as per the LIFO principle, the operation is always performed on the top
element of the stack.

22 Push down automata accepts _________ languages.


a) Type 3
b) Type 2
c) Type 1
d) Type 0
Answer: b
Explanation: Push down automata is for Context free languages and they are termed
as Type 2 languages according to Chomsky hierarchy.

Downloaded by Saurav Hathi ([email protected])


lOMoARcPSD|13492039

23 Which of the operations are eligible in PDA?


a) Push
b) Delete
c) Insert
d) Pop
Answer: a, d
Explanation: Push and pop are the operations we perform to operate a stack. A stack
follows the LIFO principle, which states its rule as: Last In First Out.
24 A string is accepted by a PDA when
a) Stack is empty
b) Acceptance state
c) Both (a) and (b)
d) None of the mentioned
Answer: c
Explanation: When we reach the acceptance state and find the stack to be empty, we
say, the string has been accepted by the push down automata.

25 The following move of a PDA is on the basis of:


a) Present state
b) Input Symbol
c) Both (a) and (b)
d) None of the mentioned
Answer: c
Explanation: The next operation is performed by PDA considering three factors:
present state,symbol on the top of the stack and the input symbol.

26 Which of the following is analogous to the following?


:NFA and NPDA
a) Regular language and Context Free language
b) Regular language and Context Sensitive language
c) Context free language and Context Sensitive language
d) None of the mentioned
Answer: a
Explanation: All regular languages can be accepted by a non deterministic finite
automata and all context free languages can be accepted by a non deterministic push
down automata.

27. A language is accepted by a push down automata if it is:


a) regular

Downloaded by Saurav Hathi ([email protected])


lOMoARcPSD|13492039

b) context free
c) both (a) and (b)
d) none of the mentioned
Answer: c
Explanation: All the regular languages are the subset to context free languages and
thus can be accepted using push down automata.

28 A PDA machine configuration (q, a, X) can be correctly


represented as: (A) ​(unprocessed input, stack content, current state)
(B) ​(current state, unprocessed input, stack content)
(C) ​(current state, stack content, unprocessed input)
(D) ​none of the mentioned
Answer: B
Explanation: q=current state, a= unprocessed input, X=stack symbol

29. ​A DPDA is a PDA in which:


(A) ​No state has two outgoing transitions
(B) ​More than one state can have two or more outgoing transitions
(C) ​At least one state has more than one transitions
(D) ​None of the mentioned
Answer: A
Explanation: DPDA is a deterministic PDA, in which one state has only one outgoin
transitionon one input

30. ​The push down automata accepts the input string in form of
(A) ​Finial state
B) ​Empty stack
C) ​Both (a) and (b)
(D) ​None of these
Answer: C
Explanation: PDA canaccept by two way:1)acceptance of pda by dinal state & 2)
acceptance of pda by empty stack

31. Limitation of PDA can overcome by:


(A) ​Mealy machine
(B) ​Moore machine
(C) ​Turing machine
(D) ​FA
Answer: C
Explanation:Limitation of PDA can overcome by TM as TM tape head can move both
direction

Downloaded by Saurav Hathi ([email protected])


lOMoARcPSD|13492039

32. Can we convert PDA to equivalent CFG?


(A) ​Yes
(B) ​No
(C) ​May be
(D) ​Can’t say
Answer: S
Explanation: If a grammar G is context-free, we can build an equivalent nondeterministic
PDA which accepts the language that is produced by the context-free grammar G. A
parser can be built for the grammar G. In the next two topics, we will discuss how to
convert from PDA to CFG and vice versa.

33. Which of the following pairs have DIFFERENT expressive power?


(A) ​Deterministic finite automata(DFA) and Non-deterministic finite automata(NFA) ​(B)
Deterministic push down automata(DPDA)and Non-deterministic push down
automata(NPDA) ​(C) ​Deterministic single-tape Turing machine and Non-deterministic
single-tape Turing machine
(D) ​Single-tape Turing machine and multi-tape Turing machine
Answer: (B)
Explanation: ​NDPDA can handle languages or grammars with ambiguity, but DPDA
cannot handle languages with ambiguity and any context-free grammar.

34. Which of the following option resembles the given PDA?

a. ​{0^n1^n|n>=0}
b. ​{0^n1^2n|n>=0}
c. ​{0^2n1^n|n>=0}
d. ​None of the mentioned
Answer: a

35. |-* is the __________ closure of |-


a) symmetric and reflexive

Downloaded by Saurav Hathi ([email protected])


lOMoARcPSD|13492039

b) transitive and reflexive


c) symmetric and transitive
d) none of the mentioned
Answer: b
Explanation: A string w is accepted by a PDA if and only if (s,w, e) |-* (f, e, e)

36. The moves in the PDA is technically termed as:


a) Turnstile
b) Shifter
c) Router
d) None of the mentioned
Answer: a
Explanation: A turnstile notation is used for connecting pairs od ID’s taht represents one
or many moves of a PDA.
37. Which of the following option resembles the given PDA?

n​ n​
a) {0​ 1​ |n>=0}
n​ 2n​
b) {0​ 1​ |n>=0}
2n​ n​
c) {0​ 1​ |n>=0}
d) None of the mentioned
Answer: a

38. Which of the following correctly resembles the given state diagram?

Downloaded by Saurav Hathi ([email protected])


lOMoARcPSD|13492039

r​
a) {ww​ |w=(a+b)*}
b) ε is called the initial stack symbol
c) Both (a) and (b)
d) None of the mentioned
Answer: a
Explanation: Initially we put a special symbol ‘#’ into the empty stack. At state q1, the w is
being read. In state q2, each 0 or 1 is popped when it matches the input. If any other input
is given, the PDA will go to a dead state. When we reach that special symbol ‘#’, we go to
the accepting state q3.

39. Which of the following assertion is false?


a) If L is a language accepted by PDA1 by final state, there exist a PDA2 that accepts L
by empty stack i.e. L=L(PDA1)=L(PDA2)
b) If L is a CFL then there exists a push down automata P accepting CF; ; by empty stack
i.e.
L=M(P)
c) Let L is a language accepted by PDA1 then there exist a CFG X such that
L(X)=M(P) d) All of the mentioned
Answer: d
Explanation:
All the assertions mentioned are theorems or corollary.

40. A push down automata can be represented as:


PDA= ε-NFA +[stack] State true or false:
a) true
b) false
Answer: a
Explanation:

Downloaded by Saurav Hathi ([email protected])


lOMoARcPSD|13492039

41. A pushdown automata can be defined as: (Q, ∑, G, q0, z0, A, d)


What does the symbol z0 represents?
a) an element of G
b) initial stack symbol
c) top stack alphabet
d) all of the mentioned
Answer: d
Explanation: z0 is the initial stack symbol, is an element of G. Other symbols like d
represents the transition function of the machine.

42. Which of the following correctly recognize the symbol ‘|-‘ in context
to PDA? ​a) Moves
b) transition function
c) or/not symbol
d) none of the mentioned
Answer: a
Explanation: Using this notation, we can define moves and further acceptance of a
string by the machine.

43. Which among the following is true for the given statement?
Statement :If there are strings R and T in a language L so that R is prefix of T and
R is not equivalent to T.
a) No DPDA can accept L by empty stack
b) DPDA can accept L by an empty stack
c) L is regular
d) None of the mentioned
Answer: a
Explanation: If M is a DPDA accepting L by an empty stsck, R and T are distinct strings in
L, and R is a prefix of T, then the sequence of moves M must make in order to accept R
leaves the stack empty, since R L. But then T cannot be accepted, since M cant move
with an empty stack. ∈

44. Which of the following can be accepted by a DPDA?


a) The set of even length palindrome over {a,b}
b) The set of odd length palindrome over {a,b}

Downloaded by Saurav Hathi ([email protected])


lOMoARcPSD|13492039

c​
c) {xx​ | where c stands for the complement,{0,1}}
d) None of the mentioned
Answer: d
Explanation: Theorem: The language pal of palindromes over the alphabet {0,1} cannot be
accepted by any finite automaton , and it is therefore not regular.

45. Which of the following allows stacked values to be sub-stacks rather than
just finite symbols?
a) Push Down Automaton
b) Turing Machine
c) Nested Stack Automaton
d) None of the mentioned
Answer: c
Explanation: In computational theory, a nested stack automaton is a finite automaton
which makes use of stack containing data which can be additional stacks.

46. A non deterministic two way, nested stack automaton has n-tuple definition.
State the value of n.
a) 5
b) 8
c) 4
d) 10
Answer: d
Explanation: The 10-tuple can be stated as: NSA= ‹Q,Σ,Γ,δ,q0,Z0,F,[,],]›.

47. A push down automaton employs ________ data structure.


a) Queue
b) Linked List
c) Hash Table
d) Stack
Answer: d
Explanation: A push down automata uses a stack to carry out its operations. They are
more capable than the finite automatons but less than the turing model.

48. Which of the following automata takes stack as auxiliary storage?


a) Finite automata
b) Push down automata
c) Turing machine
d) All of the mentioned
Answer: b

Downloaded by Saurav Hathi ([email protected])


lOMoARcPSD|13492039

Explanation: Pushdown Automaton uses stack as an auxiliary storage for its


operations. Turing machines use Queue for the same.

49. 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​?

a) ​L​={​an​ ​bn​ ​|​n​≥0}


b) ​L​={​an​ |​​ n​≥0}∪{​anbn​|​n​≥0}
c) L is not accepted by any Turing machine that halts on every input
n​ n​
d) L ={​a​ |​n​≥0}∪{​an​ ​b​ |​n​≥0} and is deterministic context-free
Answer: d
Explanation: in diagram while reading a self loop means number of a’s are in the starting
followed by b’s

50. Push down automata accepts _________ languages.


a) Type 0
b) Type 1
c) Type 2
d) type 3
Answer: c
Explanation: Type 2 Grammar; it generates Control Free Language accepted by a
Push Down Automata (PDA).

Downloaded by Saurav Hathi ([email protected])

You might also like