Finite Automaton Report
Introduction
A Finite Automaton (FA) is a mathematical model of computation used to recognize
patterns in input data. It consists of a finite number of states and transitions between
those states based on input symbols. FA is widely used in text search, lexical analysis,
and regular expression matching.
Types of Finite Automata
There are two main types of Finite Automata:
1. Deterministic Finite Automaton (DFA)
2. Nondeterministic Finite Automaton (NFA)
Additionally, there is an ε-NFA, a variation of NFA that allows transitions without
consuming input symbols.
Deterministic Finite Automaton (DFA)
A DFA is a finite automaton where for each state and input symbol, there is exactly one
transition to another state.
Formal Definition:
DFA = (Q, Σ, δ, q₀, F)
- Q: Finite set of states
- Σ: Finite set of input symbols (alphabet)
- δ: Transition function, δ: Q × Σ → Q
- q₀: Initial state (q₀ ∈ Q)
- F: Set of final (accepting) states (F ⊆ Q)
Nondeterministic Finite Automaton (NFA)
An NFA allows multiple possible transitions for a given state and input symbol, including
transitions without consuming an input symbol (ε-transitions).
Formal Definition:
NFA = (Q, Σ, δ, q₀, F)
- Q: Finite set of states
- Σ: Finite set of input symbols (alphabet)
- δ: Transition function, δ: Q × (Σ ∪ {ε}) → P(Q)
- q₀: Initial state (q₀ ∈ Q)
- F: Set of final (accepting) states (F ⊆ Q)
Differences Between DFA and NFA
| Feature | DFA | NFA |
|--------------------|------------------------------------------|------------------------------------------|
| Transitions | One transition per input symbol per state | Multiple transitions
possible |
| ε-Transitions | Not allowed | Allowed (ε-NFA) |
| Complexity | Simpler but may require more states | More flexible but can be
harder to construct |
| Equivalence | DFA and NFA are equivalent in power | Every NFA has an
equivalent DFA |
Applications of Finite Automata
1. Lexical Analysis in Compilers
2. Regular Expression Matching
3. Network Protocols
4. Control Systems (e.g., vending machines, traffic lights)
5. Pattern Recognition in AI and NLP
Limitations of Finite Automata
1. Cannot recognize context-free languages (e.g., balanced parentheses)
2. Lacks memory to store past inputs
3. Limited computational power, only recognizing regular languages