
- Automata Theory - Applications
- Automata Terminology
- Basics of String in Automata
- Set Theory for Automata
- Finite Sets and Infinite Sets
- Algebraic Operations on Sets
- Relations Sets in Automata Theory
- Graph and Tree in Automata Theory
- Transition Table in Automata
- What is Queue Automata?
- Compound Finite Automata
- Complementation Process in DFA
- Closure Properties in Automata
- Concatenation Process in DFA
- Language and Grammars
- Language and Grammar
- Grammars in Theory of Computation
- Language Generated by a Grammar
- Chomsky Classification of Grammars
- Context-Sensitive Languages
- Finite Automata
- What is Finite Automata?
- Finite Automata Types
- Applications of Finite Automata
- Limitations of Finite Automata
- Two-way Deterministic Finite Automata
- Deterministic Finite Automaton (DFA)
- Non-deterministic Finite Automaton (NFA)
- NDFA to DFA Conversion
- Equivalence of NFA and DFA
- Dead State in Finite Automata
- Minimization of DFA
- Automata Moore Machine
- Automata Mealy Machine
- Moore vs Mealy Machines
- Moore to Mealy Machine
- Mealy to Moore Machine
- Myhill–Nerode Theorem
- Mealy Machine for 1’s Complement
- Finite Automata Exercises
- Complement of DFA
- Regular Expressions
- Regular Expression in Automata
- Regular Expression Identities
- Applications of Regular Expression
- Regular Expressions vs Regular Grammar
- Kleene Closure in Automata
- Arden’s Theorem in Automata
- Convert Regular Expression to Finite Automata
- Conversion of Regular Expression to DFA
- Equivalence of Two Finite Automata
- Equivalence of Two Regular Expressions
- Convert Regular Expression to Regular Grammar
- Convert Regular Grammar to Finite Automata
- Pumping Lemma in Theory of Computation
- Pumping Lemma for Regular Grammar
- Pumping Lemma for Regular Expression
- Pumping Lemma for Regular Languages
- Applications of Pumping Lemma
- Closure Properties of Regular Set
- Closure Properties of Regular Language
- Decision Problems for Regular Languages
- Decision Problems for Automata and Grammars
- Conversion of Epsilon-NFA to DFA
- Regular Sets in Theory of Computation
- Context-Free Grammars
- Context-Free Grammars (CFG)
- Derivation Tree
- Parse Tree
- Ambiguity in Context-Free Grammar
- CFG vs Regular Grammar
- Applications of Context-Free Grammar
- Left Recursion and Left Factoring
- Closure Properties of Context Free Languages
- Simplifying Context Free Grammars
- Removal of Useless Symbols in CFG
- Removal Unit Production in CFG
- Removal of Null Productions in CFG
- Linear Grammar
- Chomsky Normal Form (CNF)
- Greibach Normal Form (GNF)
- Pumping Lemma for Context-Free Grammars
- Decision Problems of CFG
- Pushdown Automata
- Pushdown Automata (PDA)
- Pushdown Automata Acceptance
- Deterministic Pushdown Automata
- Non-deterministic Pushdown Automata
- Construction of PDA from CFG
- CFG Equivalent to PDA Conversion
- Pushdown Automata Graphical Notation
- Pushdown Automata and Parsing
- Two-stack Pushdown Automata
- Turing Machines
- Basics of Turing Machine (TM)
- Representation of Turing Machine
- Examples of Turing Machine
- Turing Machine Accepted Languages
- Variations of Turing Machine
- Multi-tape Turing Machine
- Multi-head Turing Machine
- Multitrack Turing Machine
- Non-Deterministic Turing Machine
- Semi-Infinite Tape Turing Machine
- K-dimensional Turing Machine
- Enumerator Turing Machine
- Universal Turing Machine
- Restricted Turing Machine
- Convert Regular Expression to Turing Machine
- Two-stack PDA and Turing Machine
- Turing Machine as Integer Function
- Post–Turing Machine
- Turing Machine for Addition
- Turing Machine for Copying Data
- Turing Machine as Comparator
- Turing Machine for Multiplication
- Turing Machine for Subtraction
- Modifications to Standard Turing Machine
- Linear-Bounded Automata (LBA)
- Church's Thesis for Turing Machine
- Recursively Enumerable Language
- Computability & Undecidability
- Turing Language Decidability
- Undecidable Languages
- Turing Machine and Grammar
- Kuroda Normal Form
- Converting Grammar to Kuroda Normal Form
- Decidability
- Undecidability
- Reducibility
- Halting Problem
- Turing Machine Halting Problem
- Rice's Theorem in Theory of Computation
- Post’s Correspondence Problem (PCP)
- Types of Functions
- Recursive Functions
- Injective Functions
- Surjective Function
- Bijective Function
- Partial Recursive Function
- Total Recursive Function
- Primitive Recursive Function
- μ Recursive Function
- Ackermann’s Function
- Russell’s Paradox
- Gödel Numbering
- Recursive Enumerations
- Kleene's Theorem
- Kleene's Recursion Theorem
- Advanced Concepts
- Matrix Grammars
- Probabilistic Finite Automata
- Cellular Automata
- Reduction of CFG
- Reduction Theorem
- Regular expression to ∈-NFA
- Quotient Operation
- Parikh’s Theorem
- Ladner’s Theorem
Non-deterministic Pushdown Automata
We know that pushdown automata are a powerful model of computation that extends finite automata by adding a stack. Non-deterministic finite automata are powerful than deterministic finite automata. Read this chapter to get a clear understanding of the concept.
What is Non-Determinism?
In some cases, a machine must face a choice to select the next state; it can either move to one state or another. In a non-deterministic pushdown automata (NPDA), this machine has the freedom to explore all possible paths. It can simultaneously follow multiple paths based on the input and the stack's content. This means that the machine can accept a string if even one of its possible paths leads to an accepting state.
To illustrate this, think of a finite automaton where an input symbol leads to multiple transitions. In a non-deterministic finite automaton, the machine accepts the input if at least one of the transitions leads to an accepting state.
Similarly, in an NPDA, even if one path leads to an accepting state, the entire NPDA is considered to have accepted the input string.
Use of Stacks in Pushdown Automata
In DPDA and NPDA also the stacks are used. The stack in a PDA is an important component in PDA. It acts like a memory, allowing the machine to remember past input symbols. It can push symbols onto the stack, pop symbols off the stack, or read the symbol on top of the stack.
This ability to manipulate the stack empowers the PDA to recognize languages that require keeping track of the order or the number of symbols encountered in the input string.
Defining a Non-Deterministic Pushdown Automata (NPDA)
Formally, an NPDA is defined as a tuple −
- Q − A finite set of states
- − A finite set of input symbols
- − A finite set of stack symbols
- − A transition function: $\mathrm{\mathrm{\delta \::\: Q\: \times\: \Sigma\: \times\: \Gamma\: \rightarrow\: 2^{(Q \times \Gamma^* )}}}$
- q0 − The initial state
- Z0 − The initial stack symbol
- F − A set of final states
The transition function δ takes a state q, an input symbol a, and a stack symbol X, and returns a set of possible transitions (q', γ), where q' is the next state and γ is a string of stack symbols to be pushed onto the stack.
How Does an NPDA Work?
The following steps highlight how a non-deterministic pushdown automaton works
- Initialization − The NPDA starts in the initial state q0 with the stack containing only the initial stack symbol Z0.
- Reading input − The NPDA reads the input symbol one at a time.
- Transition − For each input symbol a and the current stack top X, the transition function δ is consulted. It provides a set of possible transitions. The NPDA can choose any of these transitions. This choice is non-deterministic.
- Stack manipulation − The NPDA modifies the stack according to the chosen transition. It can push symbols onto the stack, pop symbols from the stack, or leave the stack unchanged.
- State change − The NPDA moves to the new state q' specified by the chosen transition.
- Acceptance − The NPDA accepts the input string if it reaches a final state after reading the entire input string.
Examples of Non-deterministic Pushdown Automata
Here's an example language that can be recognized by a NPDA but not by a finite automaton −
$\mathrm{L = \{ a^n b^n \mid n \geq 0 \}}$ : This language consists of strings with an equal number of 'a's and 'b's.
NDFA can recognize this using −
- For each 'a' in the input, the NPDA pushes an 'a' onto the stack.
- When a 'b' is encountered, the NPDA pops an 'a' from the stack.
- If the NPDA reaches the end of the input string and the stack is empty, the string is accepted.
Conclusion
Non-deterministic pushdown automata are complex than the deterministic pushdown automata. In this chapter, we explained the concept of NPDA with examples where NPDA can be used.