![]() |
VOOZH | about |
A Pushdown Automata (PDA) is a way to implement context-free Grammar in a similar way. We design Finite Automata for Regular Grammar.
This stack has infinite memory and that facilitates the higher power of Pushdown automata. This helps PDA to behave more powerful than Finite-state Machine.
Let M = (Q,?,?,q0, Z,F ,?) be a PDA. The PDA is deterministic if and only if
Both conditions should be satisfied for the PDA to be deterministic. If one of the conditions fails, the PDA is non-deterministic.
Let us consider an example to understand more clearly.
Example: Is the PDA corresponding to the language L = {anbn | n>=1} by the finite state is deterministic ?
Solution: The shown transitions defined for this machine are shown below:
?(q0, a, Z0) =?(q0, aZ0)
?(q0, a, a) =?(q0, aa)
?(q0, b, a) =?(q1, ?)
?(q1, b, a) =?(q1, ?)
?(q1, ?, Z0) =?(qf, ?)
The PDA should satisfy the two conditions. shown in the definition to be deterministic.
since both conditions. are satisfied, then the given PDA is deterministic.
| S. No | DPDA(Deterministic Pushdown Automata) | NPDA(Non-deterministic Pushdown Automata) |
|---|---|---|
| 1. | It is less powerful than NPDA. We can only construct DPDA for odd-length palindromes and not for even length palindromes. | It is more powerful than DPDA. NPDA can be constructed for both even-length and odd-length palindromes. |
| 2. | It is possible to convert every DPDA to a corresponding NPDA. | It is not possible to convert every NPDA to a corresponding DPDA. |
| 3. | The language accepted by DPDA is a subset of the language accepted by NPDA. | The language accepted by NPDA is not a subset of the language accepted by DPDA. |
| 4. | The language accepted by DPDA is called DCFL(Deterministic Context-free Language) which is a subset of NCFL(Non-deterministic Context-free Language) accepted by NPDA. | The language accepted by NPDA is called NCFL(Non-deterministic Context-free Language). |
5. | There is only one state transition from one state to another state for an input symbol. | There may or maynot be more than one state transition from one state to another state for same input symbol. |
DPDA: For every input with the current state, there is only one move.
M = (Q,?,?,q0, Z,F ,?)
?: Q*?*??Q*?*
NPDA: For every input with the current state, We can have multiple moves.
M = (Q,?,?,q0, Z,F ,?)
?: Q*{???}*??2Q*?*
NDPA is more powerful than DPDA because we can add more transitions to it. It is possible for every language to add a transition. For some languages, we can construct DPDA there exist an NPDA but there are some languages that are accepted by NPDA but are not by DPDA. This is said to be powerful when it accepts more sets of languages than other automata.
In fact, it is more powerful than DFA(Deterministic finite automata) and NFA(Non-deterministic finite automata) also because, In the case of DFA and NFA, they are equivalent in power. So for every language accepted by DFA there exist an NFA and Vice-Versa. There is not any language for which we construct NFA but not DFA. Hence, we can't convert NPDA to DPDA always and we can convert NFA to equivalent DFA always.
Please write comments if you find anything incorrect, or you want to share more information about the topic discussed above.