Let the language be : $$ L = \{ w \in \{a,b\}^* : \#_a(w) = \#_b(w)\}. $$ Now the PDA that I've designed for this language and seen at many other places is :
Let the PDA be denoted by M such that,
M = ({q0,q1}, {a,b}, {z0, a,b}, q0, delta, z0, q1)
Transitions for accepting L:
delta(q0, a, z0) = (q0, az0)
delta(q0, a, a) = (q0, aa)
delta(q0, b, z0) = (q0, bz0)
delta(q0, b, b) = (q0, bb)
delta(q0, a, b) = (q0, epsilon)
delta(q0, b, a) = (q0, epsilon)
delta(q0, epsilon, z0) = (q1, z0)
Now, if a PDA has to be termed as DPDA, then it should follow the following 2 properties strictly :
1. delta(q, a, b) will contain atmost 1 element
2. if delta(q, epsilon, b) != empty_set
then, for every input symbol c on state q,
delta(q, c, b) == empty_set should hold true
Source : An Introduction To Formal Languages And Automata 6th Edition, Peter Linz
But the above mentioned PDA contains the following 2 transitions that violate the second condition:
delta(q0, epsilon, z0) = (q1, z0)
delta(q0, a, z0) = (q0, az0)
delta(q0, b, z0) = (q0, bz0)
Issue : According to my understanding of DPDA, this PDA should be a NPDA. But at few places I've seen this PDA marked as DPDA, which I feel is wrong. So can you help me clear this doubt?
delta(q0, b, bb) = (q0, bb)
, is this a typo? – Christopher Boo Oct 28 '19 at 12:23