Deterministic
Pushdown
Automata
(DPDA)
-Sampath Kumar S,
AP/CSE, SECE
Types of PDA
The PDA can be classified into:
1. Deterministic PDA – PDA that has at most one
choice of move in any state.
2. Non-deterministic PDA - PDA that has more than
one choice of move in any state.
21 November 2017
Sampath Kumar S, AP/CSE, SECE
2
Problems to discuss:
111. Design a PDA which accepts L={anbn|n>1}
Solution:
 Let q0 be the initial stat, q3 be the final state and z0
be bottom of the stack.
 Read each ‘a’ and push into stack.
 Then read each ‘b’ and pop out the stack for
matching a’s.
 Where all b’s are read if the stack is empty then it is
successful
 If any a’s are left over on the stack or b’s on input
tape, it is rejected.
21 November 2017
Sampath Kumar S, AP/CSE, SECE
3
Solution for sum 111:
The PDA moves are as follows:
δ(q0, a, z0) = (q1, az0) ….. (PUSH a)
δ(q1, a, a) = (q1, aa) ….. (PUSH a)
δ(q1, b, a) = (q2, ε) ….. (POP a)
δ(q2, b, a) = (q2, ε) ….. (POP a)
δ(q2, ε, z0) = (q3, z0) ….. (Accept and HALT)
21 November 2017
Sampath Kumar S, AP/CSE, SECE
4
Problems to discuss:
112. Design a PDA which accept the language
containing equal number of a’s and b’s over Σ={a,
b}.
113. Design a PDA which accepts L={anb2n|n>1}
114. Design a PDA which accepts L={a3bncn|n>0}
115. Design a PDA which accepts L={wcwr|w
(a+b)*}
116. Design a PDA which accepts the set of
balanced parenthesis. ([{()}])
21 November 2017
Sampath Kumar S, AP/CSE, SECE
5
Problems to discuss:
117. Design a PDA which accepts
L={apbncm|p+m=n}.
118. Design a PDA which accepts
L={0m1n0m|m,n>1}.
119. Design a PDA which accepts L={aibjck|i+j=k; i, j
>1}.
21 November 2017
Sampath Kumar S, AP/CSE, SECE
6
Problems to discuss:
120. Design a PDA which accepts
L={anbmcndm|n,m>1}.
121. Design a PDA which accepts L={anb2n+1|n>1}
21 November 2017
Sampath Kumar S, AP/CSE, SECE
7
21 November 2017
Sampath Kumar S, AP/CSE, SECE
8
நன்றி
21 November 2017
Sampath Kumar S, AP/CSE, SECE
9

3.4 deterministic pda

  • 1.
  • 2.
    Types of PDA ThePDA can be classified into: 1. Deterministic PDA – PDA that has at most one choice of move in any state. 2. Non-deterministic PDA - PDA that has more than one choice of move in any state. 21 November 2017 Sampath Kumar S, AP/CSE, SECE 2
  • 3.
    Problems to discuss: 111.Design a PDA which accepts L={anbn|n>1} Solution:  Let q0 be the initial stat, q3 be the final state and z0 be bottom of the stack.  Read each ‘a’ and push into stack.  Then read each ‘b’ and pop out the stack for matching a’s.  Where all b’s are read if the stack is empty then it is successful  If any a’s are left over on the stack or b’s on input tape, it is rejected. 21 November 2017 Sampath Kumar S, AP/CSE, SECE 3
  • 4.
    Solution for sum111: The PDA moves are as follows: δ(q0, a, z0) = (q1, az0) ….. (PUSH a) δ(q1, a, a) = (q1, aa) ….. (PUSH a) δ(q1, b, a) = (q2, ε) ….. (POP a) δ(q2, b, a) = (q2, ε) ….. (POP a) δ(q2, ε, z0) = (q3, z0) ….. (Accept and HALT) 21 November 2017 Sampath Kumar S, AP/CSE, SECE 4
  • 5.
    Problems to discuss: 112.Design a PDA which accept the language containing equal number of a’s and b’s over Σ={a, b}. 113. Design a PDA which accepts L={anb2n|n>1} 114. Design a PDA which accepts L={a3bncn|n>0} 115. Design a PDA which accepts L={wcwr|w (a+b)*} 116. Design a PDA which accepts the set of balanced parenthesis. ([{()}]) 21 November 2017 Sampath Kumar S, AP/CSE, SECE 5
  • 6.
    Problems to discuss: 117.Design a PDA which accepts L={apbncm|p+m=n}. 118. Design a PDA which accepts L={0m1n0m|m,n>1}. 119. Design a PDA which accepts L={aibjck|i+j=k; i, j >1}. 21 November 2017 Sampath Kumar S, AP/CSE, SECE 6
  • 7.
    Problems to discuss: 120.Design a PDA which accepts L={anbmcndm|n,m>1}. 121. Design a PDA which accepts L={anb2n+1|n>1} 21 November 2017 Sampath Kumar S, AP/CSE, SECE 7
  • 8.
    21 November 2017 SampathKumar S, AP/CSE, SECE 8
  • 9.

Editor's Notes

  • #2 School of EECS, WSU