PUSH DOWN AUTOMATA
Sanjana boddu
23211a0539
Push Down Automata
• The PDA will have input tape, finite control and stack.
TOS Z0
Stack
• The input tape is divided in many cells.
• The finite control has some pointer which points to the current symbol
which is to be read.
• At the end of the input $ or  blank symbol is placed to identify the end
of input.
• Here Stack will be used to store the items temporarily.
A A B B $   
Finite
Control
Definition of a PDA
• A pushdown automaton (PDA) is a seven-tuple:
M = (Q, Σ, Г, δ, q0, z0, F)
Q A finite set of states
Σ A finite input alphabet
Г A finite stack alphabet
q0 The initial/starting state, q0 is in Q
z0 A starting stack symbol, is in Г // need not always remain at the bottom
of stack
F A set of final/accepting states, which is a subset of Q
δ A transition function, where
For DPDA δ: Q x (Σ U {ε}) x Г –> finite subsets of Q x Г*
For NDPDA δ: Q x (Σ U {ε}) x Г –> finite subsets of 2Q x Г*
Push Down Automata
• Any language which is accepted by a F.A. can also accepted by PDA.
• PDA can also accepts the class of languages which are not accepted by F.A.,
Thus PDA is much more superior to F.A.
Example: Design a PDA for accepting the Language L= {an
bn
|n>=1}.
Solution:
The above given language is in which equal number of a’s are followed by
equal number of b’s.
Logic for PDA:
1. Push all a’s onto the stack
2. On reading every single b pop one a from the stack.
3. If the input string is reached end and the stack is empty then the string is
accepted by the PDA.
PDA : Transition diagram
Q0
Q1 Q2
(b,a/ )
Ꜫ
(a,a/aa)
(a,z0/az0) (b,a/ )
Ꜫ
($, z0/z0)
Transition function Instantanious Description
• The Description for the PDA can
be given as follows.
(q0,a,z0)=(q0,az0)
(q0,a,a)=(q0,aa)
(q0,b,a)=(q1, )
Ꜫ
(q1,b,a)=(q1, )
Ꜫ
(q1,$, z0)=(q2, )
Ꜫ
Where q0 is start state and q2 is
accept state.
• Simulation of PDA for the input string aaabbb
as follows
(q0,aaabbb,z0)Ͱ(q0,aabbb,az0)
Ͱ(q0,abbb,aaz0)
Ͱ(q0,bbb,aaaz0)
Ͱ(q1,bb,aaz0)
Ͱ(q1,b,az0)
Ͱ(q1,ε, z0)
Ͱ(q2, Ꜫ)
Accept State
Hence the string is accepted by the PDA.
END For NOW
Continue in next class

539_PDA push down automata_ d_b_m_s.pptx

  • 1.
  • 2.
    Push Down Automata •The PDA will have input tape, finite control and stack. TOS Z0 Stack • The input tape is divided in many cells. • The finite control has some pointer which points to the current symbol which is to be read. • At the end of the input $ or  blank symbol is placed to identify the end of input. • Here Stack will be used to store the items temporarily. A A B B $    Finite Control
  • 3.
    Definition of aPDA • A pushdown automaton (PDA) is a seven-tuple: M = (Q, Σ, Г, δ, q0, z0, F) Q A finite set of states Σ A finite input alphabet Г A finite stack alphabet q0 The initial/starting state, q0 is in Q z0 A starting stack symbol, is in Г // need not always remain at the bottom of stack F A set of final/accepting states, which is a subset of Q δ A transition function, where For DPDA δ: Q x (Σ U {ε}) x Г –> finite subsets of Q x Г* For NDPDA δ: Q x (Σ U {ε}) x Г –> finite subsets of 2Q x Г*
  • 4.
    Push Down Automata •Any language which is accepted by a F.A. can also accepted by PDA. • PDA can also accepts the class of languages which are not accepted by F.A., Thus PDA is much more superior to F.A. Example: Design a PDA for accepting the Language L= {an bn |n>=1}. Solution: The above given language is in which equal number of a’s are followed by equal number of b’s. Logic for PDA: 1. Push all a’s onto the stack 2. On reading every single b pop one a from the stack. 3. If the input string is reached end and the stack is empty then the string is accepted by the PDA.
  • 5.
    PDA : Transitiondiagram Q0 Q1 Q2 (b,a/ ) Ꜫ (a,a/aa) (a,z0/az0) (b,a/ ) Ꜫ ($, z0/z0)
  • 6.
    Transition function InstantaniousDescription • The Description for the PDA can be given as follows. (q0,a,z0)=(q0,az0) (q0,a,a)=(q0,aa) (q0,b,a)=(q1, ) Ꜫ (q1,b,a)=(q1, ) Ꜫ (q1,$, z0)=(q2, ) Ꜫ Where q0 is start state and q2 is accept state. • Simulation of PDA for the input string aaabbb as follows (q0,aaabbb,z0)Ͱ(q0,aabbb,az0) Ͱ(q0,abbb,aaz0) Ͱ(q0,bbb,aaaz0) Ͱ(q1,bb,aaz0) Ͱ(q1,b,az0) Ͱ(q1,ε, z0) Ͱ(q2, Ꜫ) Accept State Hence the string is accepted by the PDA.
  • 7.
    END For NOW Continuein next class