0% found this document useful (0 votes)
117 views25 pages

Flat (Unit IV)

Uploaded by

ksrp568
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)
117 views25 pages

Flat (Unit IV)

Uploaded by

ksrp568
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/ 25

FORMAL LANGUAGE AND AUTOMATA THEORY

UNIT-IV
SYLLABUS

1. Pushdown Automata

2. Definition

3. Model (or) Components of PDA

4. Graphical Notation

5. Instantaneous Description

6. Language Acceptance of Pushdown Automata

7. Design of Pushdown Automata

8. Deterministic and Non – Deterministic PDA

9. Equivalence of PDA to CFG

10. Conversion

11. Two Stack PDA

12. Application of Pushdown Automata

UNIT - IV 1
UNIT-IV
PUSHDOWN AUTOMATA

 It is a finite automata with extra memory called Stack (LIFO) which helps
pushdown automata to recognize context free language.
 PDA are used in theories about what can be computed by machine.
 They are “more capable” than finite state machine but “less capable” than Turing
Machine.
 Pushdown automata is a way to implement a CFG in the same way we design DFA
for a regular grammar.
 A DFA can remember a “finite amount of information”, but a “PDA” can
remember an “Infinite amount of information”.

 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.
 Basically, a pushdown automaton is:
"Finite state machine" + "a stack"
 DEFINITION: -
PDA is a generalisation of FSA and a PDA changes from “state to state”, “reading
input symbols” unlike FSA, “transitions” also update the stack either by popping symbols
(or) pushing symbols them.
(or)
PDA is a way to represent the language class called context free languages. In other
words PDA’s are abstract devices that recognise context free languages.

 MODEL (OR) COMPONENTS OF PDA: -


They are three (3) components are used in PDA
1. Input Tape
2. Finite Control Unit
3. Stack (Memory Unit)

UNIT - IV 2
Input tape: The input tape is divided in many cells or symbols. The input head is read-only
and may only move from left to right, one symbol at a time.
Finite control: The finite control has some pointer which points the current symbol which is
to be read.
Stack: The stack is a structure in which we can push and remove the items from one end
only. It has an infinite size. In PDA, the stack is used to store the items temporarily.
 GRAPHICAL NOTATION (or) TRANSITION DIAGRAM: -
A transition in a PDA from a state “q1” to “q2” labeled as a, b  c

Here q1 and q2 is a States


At state “q1”, if an input string “a” is encounter and top symbol of stack is “b”, push
“c” on top pf the stack and move to state “q2”.
 TRANSITION TABLE: -
The description of operation of a PDA, for a given input string, can be represented in
a tabular format called “Transition Table”.
Unread input Transition Stack New State

UNIT - IV 3
 ORDERED SEVEN (7) – TUPLES SPECIFICATION OF PDA: -

A PDA can be formally described as a 7-tuple (Q, ∑, δ, q0, F, Z, Γ) −


 Q is the finite number of states
 ∑ is input alphabet
 δ is the transition function: Q × (∑ ∪ {ε}) × S × Q × S*
 q0 is the initial state (q0 ∈ Q)
 F is a set of accepting states (F ∈ Q)
 Z is the initial stack symbol, placed on the TOS
 Γ is the final set of stack symbols
 TRANSITION ON PDA: -
The transition of PDA can be represented in different ways, as follows:
Form – 1:

δ (current state, current input symbol, current stack top) = (new state, new stack top)

Form – 2:

δ (current state, current input symbol, current stack top, operation on stack, new state)

Example: - 1). Consider a PDA, whose task is described in the transition diagram Show in
below figure. The given input string (w) = aab, “z” initial symbol of stack.

Solution: -
“Transition” of the above diagram are represented using different forms as:
Form-1: δ (q0, a, Z) = (q0, a)
This means for the current state “q0”, current input symbol “a”, if the current
stack top is “Z”, then new state and new stack top are represented as (q0, a).
Form-2: δ (q0, a, Z, Push(a), q0)
Ist
Transition
This means for the current state “q0”, current input symbol “a”, if the current
stack top is “Z”, then “Push a” on to stack and remain the state “q0”.

2nd Form-1: δ (q0, a, a) = (q0, a)


Transition
Form-2: δ (q0, a, a, Push(a), q0)

3rd Form-1: δ (q0, b, a) = (q1, Ɛ)


Transition
Form-2: δ (q0, b, a, pop(a), q1)

UNIT - IV 4
Transition Table: - Input String (w) = aab
Unread input Transitions Stack New State
aab ------ Z q0
ab (q0, a, Z, push(a), q0) az q0
b (q0, a, a, push(a), q0) aaz q0
Ɛ (q0, b, a, pop(a), q1) az q1

Example: -2). Consider the following transition diagram of a PDA. Input string (w) =
aaabbb, “z” as the current stack top.

Solution: -
Transition Table: - Input String (w) = aaabbb
Unread input Transitions Stack New State
aaabbb ------ Z q0
aabbb (q0, a, Z, push(a), q0) az q0
abbb (q0, a, a, push(a), q0) aaz q0
bbb (q0, b, a, push(a), q0) aaaz q0
bb (q0, b, a, pop, q1) aaz q1
b (q1, b, a, pop, q1) az q1
Ɛ (q1, b, a, pop, q1) z q1
-- (q1, Ɛ, z, pop, q2) z q2

UNIT - IV 5
 INSTANTANEOUS DESCRIPTION (ID): -
The ID of a PDA is represented by a “triple” (q, w, s).
Here q  States
w  Input string
s  Stack
“ID” is an informal notation of how PDA computes an “input string” and make a decision
that string is accepted (or) Rejected.
Example: - 1. w = aabb
2. w = ababaab
 TURNSTILE NOTATION: -
It is used for connecting pairs of ID’s that represent “one or more moves” of a PDA.

The process of transition is denoted by the Turnstile symbol “├ ”.

Example: -3). Consider the following transition diagram of a PDA.

Consider the input string (w) = aaabbb and “z” as the current stack top.

Solution: - Transition Table: - Input String (w) = aaabbb


Unread input Transitions Stack New State
aaabbb ------ Z q0
aabbb (q0, a, Z, push(a), q0) az q0
abbb (q0, a, a, push(a), q0) aaz q0
bbb (q0, b, a, push(a), q0) aaaz q0
bb (q0, b, a, pop, q1) aaz q1
b (q1, b, a, pop, q1) az q1
Ɛ (q1, b, a, pop, q1) z q1
-- (q1, Ɛ, z, pop, q2) z q2

UNIT - IV 6
 LANGUAGE ACCEPTANCE OF PUSHDOWN AUTOMATA: -
A language can be accepted by Pushdown automata using two approaches:
1. Acceptance by Final State
2. Acceptance by Empty Stack
1) Acceptance by Final State: -
The PDA is said to accept its input by the final state if it enters any final state
in zero or more moves after reading the entire input.
Let P = (Q, ∑, Γ, δ, q0, Z, F) be a PDA. The language acceptable by the final state can
be defined as:

L(PDA) = {w | (q0, w, Z) ⊢* (p, ε, z), q ∈ F}

2) Acceptance by Empty Stack: -


On reading the input string from the initial configuration for some PDA, the
stack of PDA gets empty.
Let P = (Q, ∑, Γ, δ, q0, Z, F) be a PDA. The language acceptable by empty stack can
be defined as:

N(PDA) = {w | (q0, w, Z) ⊢* (p, ε, z), q ∈ Q}

Example: -4). Design a PDA for accepting a language L = {anbn | n>=1}


Solution: -
anbn: Every String contains “n” number of a’s followed by “n” number of b’s.
n = 3, a3b3  aaabbb
L = {aabb, aaabbb, _ _ _ _ _ _}
Input String (w) = aaabbb
Transition Diagram: -

UNIT - IV 7
Transition on PDA: -
δ (q0, a, z) = (q0, a) (or) (q0, a, z, push(a), q0)
(q0, a, a, push(a), q0)
(q0, a, a, push(a), q0)
(q0, b, a, pop, q1)
(q1, b, a, pop, q1)
(q1, b, a, pop, q1)
(q1, Ɛ, z, pop, q2)
Transition Table: - Input String (w) = aaabbb
Unread input Transitions Stack New State
aaabbb ------ Z q0
aabbb (q0, a, Z, push(a), q0) az q0
abbb (q0, a, a, push(a), q0) aaz q0
bbb (q0, b, a, push(a), q0) aaaz q0
bb (q0, b, a, pop, q1) aaz q1
b (q1, b, a, pop, q1) az q1
Ɛ (q1, b, a, pop, q1) z q1
-- (q1, Ɛ, z, pop, q2) z q2
PDA action for the Input String: -
a) Consider the input String (w) = aaabbb
ID: (q, w, s)
(q0, aaabbb, z) ├ (q0, aabbb, az)
├ (q0, abbb, aaz)
├ (q0, bbb, aaaz)
├ (q1, bb, aaz)
├ (q1, b, az)
├ (q1, Ɛ, z)
├ (q2, z)
So my string is accepted.
b) Consider the input string (w) = aabbb
ID: (q0, aabbb, z) ├ (q0, abbb, az)
├ (q0, bbb, aaz)
├ (q1, bb, az)
├ (q1, b, z)
├ (q1, z)
⸫ The String is not accepted, because “q1” is not a final State.

UNIT - IV 8
 DESIGN OF PDA: -
The basic design strategy for PDA as follows:
1. Understand the language properties, for which the PDA has to be design.
2. Determine the state and alphabet set required.
3. Identify the initial, accepting (final) and dead states of PDA.
4. Decide on the stack symbols required.
5. Determine the initial stack symbols from the stack symbol set.
6. For each state, decide on the transition to be made for each character of the input
string.
7. For each state transition, decide on the stack operation to be performed.
8. Obtain the transition diagram and table for PDA.
9. Test, the PDA obtained on short string.
Example: -4). Design a PDA for accepting a language L = {0n12n | n>1}
Solution: - In this language “n” number of 0’s should be followed by “2n” number of 1’s.
*** Logic: - One Zero is corresponding two one’s.
Input String (w) = 001111

Transition on PDA: -
(q0, 0, z, push(0), q0)
(q0, 0, 0, push(0), q0) This is
Logic
(q0, 1, 0, 0, q1)
(q1, 1, 0, pop(0), q2)
(q2, 1, 0, 0, q1)
(q1, 1, 0, pop(0), q2)
(q2, Ɛ, z, pop, q3)

UNIT - IV 9
Transition Table: - Input String (w) = 001111
Unread input Transitions Stack New State
001111 ------ Z q0
01111 (q0, 0, Z, push(0), q0) 0z q0
1111 (q0, 0, 0, push(0), q0) 00z q0
111 (q0, 1, 0, 0, q1) 00z q1
11 (q1, 1, 0, pop(0), q2) 0z q2
1 (q2, 1, 0, 0, q1) 0z q1
Ɛ (q1, 1, 0, pop(0), q2) z q2
-- (q2, Ɛ, z, pop, q3) z q3
PDA action for the Input String: -
a) Consider the input String (w) = 001111
ID: (q, w, s)
(q0, 001111, z) ├ (q0, 01111, 0z)
├ (q0, 1111, 00z)
├ (q1, 111,00z)
├ (q2, 11,0z)
├ (q1, 1, 0z)
├ (q2, Ɛ, z)
├ (q3, z)
⸫ So, the String is accepted.
b) To show that input String (w) = 001
ID: (q, w, s)
(q0, 001, z) ├ (q0, 11, 0z)
├ (q0, 1, 00z)
├ (q1, Ɛ, 00z)
⸫ So, this String is Rejected.
Example: -5). Design a PDA for accepting a language L = {wwR | w Ɛ (a+b)*}
Solution: -
w  words with any combination of “a” and “b” including null string.
wR  words having reverse of “w”.
(a+b)* = a* + b*
= a* U b*
= {Ɛ, a, aa, aaa, _ _ _ _ _} U {Ɛ, b, bb, bbb, _ _ _ _ _}
= {Ɛ, a, b, aa, bb, aaa, bbb, _ _ _ _ _}
L = {Ɛ, aa, bb, abba, aaaa, baab, aabbaa, baaaab, _ _ _ _ _}

UNIT - IV 10
Input String (w) = baaaab

***Logic: -

Transition Diagram: -

Transition Table: - Input String (w) = baaaab

PDA action for the Input String: -


a) Consider the input String (w) = baaaab
ID: (q, w, s)
(q0, baaaab, z) ├ (q0, aaaab, bz)
├ (q0, aaab, abz)
├ (q0, aab, aabz)
├ (q0, ab, abz)
├ (q1, b, bz)
├ (q1, Ɛ, z)
├ (q2, z)
⸫ So, the String is accepted.

UNIT - IV 11
Example: -6). Design a PDA for accepting a language L = {anbm | n>=m, m>=1}
Solution: - At least “1b” is there and “2a’s” should be there.
L = {aab, aaabbb, aaaabbbb, _ _ _ _ _ }
Input String (w) = aaabbb
Transition Diagram: -

Transition Table: -
Unread input Transitions Stack New State
aaabbb ------ Z q0
aabbb (q0, a, Z, push(a), q0) az q0
abbb (q0, a, a, push(a), q0) aaz q0
bbb (q0, b, a, push(a), q0) aaaz q0
bb (q0, b, a, pop, q1) aaz q1
b (q1, b, a, pop, q1) az q1
Ɛ (q1, b, a, pop, q1) z q1
-- (q1, Ɛ, z, pop, q2) z q2
PDA action for the Input String: -
a) Consider the input String (w) = aaabbb
ID: (q, w, s)
(q0, aaabbb, z) ├ (q0, aabbb, az)
├ (q0, abbb, aaz)
├ (q0, bbb, aaaz)
├ (q1, bb, aaz)
├ (q1, b, az)
├ (q1, Ɛ, z)
├ (q2, z)
So my string is accepted.
b) Consider the input string (w) = aabbb
ID: (q0, aabbb, z) ├ (q0, abbb, az)
├ (q0, bbb, aaz)
├ (q1, bb, az)

UNIT - IV 12
├ (q1, b, z)
├ (q1, z)
⸫ The String is not accepted, because “q1” is not a final State.
Example: -7). Design a PDA for accepting a language L = {wCwR | w Ɛ (0+1)*}
Solution: - w  words with any combination of “0” & “1” including null string.
wR  words having reverse of “w”.
(0+1)* = 0* + 1*
= 0* U 1*
= {Ɛ, 0, 00, 000, _ _ _ _ _ _} U {Ɛ, 1, 11, 111, _ _ _ _ _}
= {Ɛ, 0, 1, 00, 11, 000, 111, _ _ _ _ _}
L = {Ɛ, 0C0, 1C1, 00C00, 001C100, 110C011,_ _ _ _ __}
Input String (w) = 001C100.
Now Construct Transition Diagram, Transition table and PDA action for the Input
String.
 DETERMINISTIC AND NON – DETERMINISTIC PDA: -
DETERMINISTIC PDA: -
PDA is deterministic, if each input string can only be processed by the machine in
only one way, i.e., for the “same input symbol” and “same stack symbol”, there must be
only one choice.
Formally, a PDA P = (Q, Ʃ, δ, q0, F, Z, Γ) is deterministic if
i. δ (q, a, z) has only one element.
ii. δ (q, Ɛ, z) is not empty, then δ (q, a, z) should be empty.
If conditions (i) & (ii) are satisfied, then the PDA is deterministic, otherwise PDA is
nondeterministic.
Example: - The PDA for L = {anbn | n>=1} is deterministic.
NON – DETERMINISTIC PDA: -
PDA is nondeterministic, if there is same string that can be processed by it in “more
than one way”.
There are two (2) types of nondeterministic PDA (it occurs two types of moves):
i. When a state emits two (or) more edges labelled with the “same input symbol” and
“same stack symbol”.

Example: -

UNIT - IV 13
Solution: -
δ (q1, a, b) = (q2, x) (or) (q1, a, b, push(x), q2)
δ (q1, a, b) = (q3, y) (or) (q1, a, b, push(y), q3)
ii. When a state emits two edges labelled with the “same stack symbol”, where one
input symbol is ‘Ɛ’ and the other input symbol is not.
Example: -

Solution: -
(q0, a, z, push(x), q1)
(q0, Ɛ, z, pop, q2)
Example: -
1. Design a PDA for accepting a language L = {w Ɛ {a, b}* | na = nb}
2. Design a PDA for accepting a language L = {wwR | w Ɛ (a, b)*} a language of
palindrome with even length of words..
 EQUIVALENCE OF PDA TO CFG: -
The Context free grammar “G” and pushdown automata “P” are said to be
equivalent.
L(G) = L(P)
In other words, equivalence of PDA and CFG means:
1. The class of language accepted by context free grammar is exactly the same as the
class of languages accepted by PDA. It is possible to convert any context free
grammar to PDA, Such that L(G) = L(P).
2. The language accepted by PDA is exactly the same as the language accepted by
context free grammar, it is possible to convert any PDA to context free grammar, such
that L(P) = L(G).
1) Conversion from Context Free Grammar to PDA: -
There are set of rules:
Step: - 1). We have to convert the given production of CFG into GNF.
Step: - 2). The PDA will only have one state {q}.
Step: - 3). The initial symbol of CFG will be initial symbol in the PDA.
Step: - 4). For “Non-Terminal Symbol” we have to add the following rule:

Aa
So, we have to Convert
δ (q, Ɛ, A) = (q, a)

UNIT - IV 14
Step: - 5). For each “Terminal Symbol” we have to add the following rule:

δ (q, a, a) = (q, Ɛ)

Example: -1. Construct a PDA equivalent to following CFG productions:


S  aAA
A  aS | bS | a
Solution: -
Step: - 1) The given CFG is in GNF form
Step: - 4) S  aAA
δ (q, Ɛ, S) = (q, aAA)
A  aS | bS | a
δ (q, Ɛ, A) = {(q, aS) | (q, bS) | (q, a)}
Step: - 5) There are two (2) Terminal Symbols “a”, “b”.
δ (q, a, a) = (q, Ɛ)
δ (q, b, b) = (q, Ɛ)
So, this is a equivalent PDA, for given CFG.
Example: -2. Construct a PDA equivalent to following CFG productions:
S  aBB
B  0S | 1S | 0
Solution: -
Step: - 1) The given CFG is in GNF form
Step: - 4) S  0BB
δ (q, Ɛ, S) = (q, 0BB)
B  0S | 1S | 0
δ (q, Ɛ, B) = {(q, 0S) | (q, 1S) | (q, 0)}
Step: - 5) There are two (2) Terminal Symbols “0”, “1”.
δ (q, 0, 0) = (q, Ɛ)
δ (q, 1, 1) = (q, Ɛ)
So, this is a equivalent PDA, for given CFG.
Example: -3. Construct a PDA for the grammar
S  aA
A aABD | bB | a
Bb
Dd
Solution: -
Step: - 1) The given CFG is in GNF form
Step: - 4) S  aA

UNIT - IV 15
δ (q, Ɛ, S) = (q, aA)
A aABD | bB | a
δ (q, Ɛ, A) = {(q, aABD) | (q, bB) | (q, a)}
Bb
δ (q, Ɛ, B) = (q, b)
Dd
δ (q, Ɛ, D) = (q, d)
Step: - 5) There are two (2) Terminal Symbols “a”, “b”,”d”.
δ (q, a, a) = (q, Ɛ)
δ (q, b, b) = (q, Ɛ)
δ (q, d, d) = (q, Ɛ)
So, this is a equivalent PDA, for given CFG.
Example: - 4. Construct PDA for the following CFG
S  aABB | aAA
A  aBB | a
B  bBB | A
Solution: - Elimination of Unit Production: -

aBB
BA
a

B  aBB | a
⸫ After eliminating Unit Production B  A
CFG in GNF is S  aABB | aAA
A  aBB | a
B  bBB | aBB | a
Step: - 1. The given CFG is in GNG form
Step: - 4. δ (q, Ɛ, S) = (q, aABB)
δ (q, Ɛ, S) = (q, aAA)
δ (q, Ɛ, A) = (q, aBB)
δ (q, Ɛ, A) = (q, a)
δ (q, Ɛ, B) = (q, bBB)
δ (q, Ɛ, B) = (q, aBB)
δ (q, Ɛ, B) = (q, a)
Step: - 5. There are two (2) terminal symbols “a”, “b”.
δ (q, a, a) = (q, Ɛ)
δ (q, b, b) = (q, Ɛ)

UNIT - IV 16
⸫ The Pushdown Automata Transitions are:
δ (q, Ɛ, S) = (q, aABB)
δ (q, Ɛ, S) = (q, aAA)
δ (q, Ɛ, A) = (q, aBB)
δ (q, Ɛ, A) = (q, a)
δ (q, Ɛ, B) = (q, bBB)
δ (q, Ɛ, B) = (q, aBB)
δ (q, Ɛ, B) = (q, a)
δ (q, a, a) = (q, Ɛ)
δ (q, b, b) = (q, Ɛ)

Step: - 1. The given CFG is not in a GNG form

UNIT - IV 17
UNIT - IV 18
UNIT - IV 19
Equal to each other
UNIT - IV 20
UNIT - IV 21
 TWO STACK PDA: -
 It is similar to a PDA, but it has two stack instead of one stack.
 A machine using two pushdown automata accept the recursively enumerable
language (or) Turing machine.
Definition: - A Two – Stack Pushdown Automata (2-stack PDA) is similar to a PDA, but
it has two stacks instead of one. In each transition, we must denote the POP and PUSH
action on both stacks.
Example:

The above diagram means State “q” & State “p” from “q to p” we read input string
“a” is encounter with condition b  c, d  c.
1. “b” is popped off the first stack and “c” is pushed on the first stack.
2. “d” is popped off the second stack and “c” is pushed on the second stack.
 Model (or) Components of 2 stack PDA (or) Block Diagram: -
There are three (3) components are used 2 stack pushdown Automata:
1. The state of finite control.
2. The input symbol read.
3. The TOP stack symbol on each of its stack.

UNIT - IV 22
 ORDERED NINE (9) – TUPLES SPECIFICATION OF PDA: -

A 2-stack PDA can be formally described as a 9-tuple.


M = (Q, ∑, δ, q0, F, Γ1, Γ2, Z0, Z1)
 Q is the finite number of states
 ∑ is input alphabet
 δ is the transition function
δ: Q x ∑ x {ε}) x Γ1 x Γ2  Q × Γ1* x Γ2*
 q0 is the initial state
 F is a set of accepting states
 Z is the initial stack symbol, placed on the TOS
 Γ1 is the final set of stack1 symbols
 Γ2 is the final set of stack2 symbols
 Z0 is the initial stack1 symbol
 Z1 is the initial stack2 symbol

Example: - Construct a 2 stack PDA which accepts the following language L = {an bn cn |
n>=1}
Solution: - L = {an bn cn | n>=1}
n = 1, 2, 3, 4, _ _ _ _ _ __
n =1; an bn cn = abc
n =2; an bn cn = aabbcc
n =3; an bn cn = aaabbbccc
L = {abc, aabbcc, aaabbbccc, _ _ _ _ _ _ _}
Input string (w) = aabbcc
Transitions: -
δ (q0, a, z0, z1) = (q0, a, z1)
δ (q0, a, a, z1) = (q0, a, z1)
δ (q0, b, a, z1) = (q1, a, b)
δ (q1, b, a, b) = (q1, a, b)
δ (q1, c, a, b) = (q2, a, b)
δ (q1, c, a, b) = (q2, a, b)
δ (q2, c, a, b) = (q2, z0, z1)
δ (q2, ɛ, z0, z1) = (q3, ɛ, ɛ)

UNIT - IV 23
Transition Diagram: -

2 stack PDA action for the Input String:


Consider the input string (w) = aabbcc
ID: (q, w, s)
(q0, aabbcc, s) = ├ (q0, abbcc, az0, z1)
= ├ (q0, bbcc, aaz0, z1)
= ├ (q1, bcc, aaz0, bz1)
= ├ (q1, cc, aaz0, bbz1)
= ├ (q2, c, az0, bz1)
= ├ (q2, ε, z0, z1)
= ├ (q3, ε)
⸫ The input string is accepted the final state.

 APPLICATION OF PUSHDOWN AUTOMATA: -


 Used for deriving a string from the grammar.
 Used for designing Top-down parser and Bottom-up parser in compiler design.
 Used in evaluation of the arithmetic expressions.
 Used for solving the Tower of Hanoi problem.
 It works on regular grammar and context free grammar.
 It accepts regular language and context free language.
 It has remembering capability by maintaining a stack.
 It is more powerful than Finite Automata.

UNIT - IV 24
IMPORTANT QUESTIONS
1. Define Pushdown Automata (PDA). Discuss about the language accepted by PDA.
2. Design Non deterministic PDA for the language L = {0n12n | n>=1}
3. Explain PDA definition model and construct the PDA that accepts the language. L =
{anbn | n>=1}. Give the Graphical representation for PDA obtained. Show the
Instantaneous Description of the PDA on the input string “aaaabbbb”.
4. Convert the following grammar “G” to PDA that accept the same language by empty
stack S 0S1 | A, A A0 | S | Ɛ.
5. Explain the graphical notation of PDA with an example and acceptance of context
free languages by PDA.
6. Obtain PDA for the following grammar.
S  AS | Ɛ A  0A1 | A1 | 01
7. What is deterministic PDA? Differentiate acceptance by final state and acceptance by
empty state.
8. Design a PDA for the language L = {w | w Ɛ (a+b)* | na(w) > nb(w)}.
9. Discuss in detail about different approaches for acceptance of language by PDA.
10. Define PDA and explain its model with a neat diagram.
11. Construct PDA for the following grammar:
S  AB
A  CD
Bb
Ca
Da
12. Design PDA that checks the well – formedness of parenthesis.
13. Explain the procedure for construction of PDA from CFG.
14. Design DPDA for the language L = {anb2n | n>0}
15. Design PDA for L = {WCWR | W Ɛ (0+1)*}
16. How to convert the following grammar to PDA that accepts the same language by
empty stack. S  0AA A  0S | 1S | 0
17. Differentiate between DPDA and NPDA.
18. Mention the application of PDA.
19. S  aABB | aAA, A  aBB | a, B  bBB | A, construct the PDA that accepts the
language generated by given grammar.

UNIT - IV 25

You might also like