The process of reducing the number of states in a DFA. The equivalent DFA with the minimum number of states is called the minimal DFA. For a regular language, its minimal DFA is unique up to state renaming.
A DFA may contain unnecessary states due to:
- unreachable states
- states that behave identically for all input strings
Properties of Minimal DFA
- Has the minimum number of states among all equivalent DFAs.
- No two states are equivalent.
- All states are reachable.
- Unique up to renaming of states.
Types of States
Unreachable State
A state that cannot be reached from the start state for any input string. Does not affect the language recognized by the DFA. Must be removed before checking for state equivalence.
If a state is never visited during computation, it plays no role in determining whether a string is accepted.
Equivalent States
Aka. indistinguishable states. 2 states are equivalent or indistinguishable iff for every possible input string they lead to the same acceptance result (whether accepted or not).
Equivalent states cannot be distinguished by any input string. Therefore, they can be merged into a single state without affecting the language.
Distinguishable States
Two states are distinguishable iff there exists at least one input string that leads one state to acceptance and the other to rejection.
Such states must remain separate because merging them would change the language recognized by the DFA.
Myhill-Nerode Theorem
A language is regular iff the number of equivalence classes of the Myhill–Nerode relation for is finite.
Two strings are considered equivalent if appending any string to them always produces the same acceptance result.
Implies that for all language there exists a unique minimal DFA with a number of states equal to the number of equivalence classes under the Myhill-Nerode relation.
Myhill-Nerode Relation
Two strings and are equivalent with respect to a language iff:
Table Filling Algorithm
A systematic procedure used to identify distinguishable states and determine equivalent states.
Step 1 — Construct the State Pair Table
List all unordered pairs of states.
Example:
| Pair |
|---|
| (q0,q1) |
| (q0,q2) |
| (q1,q2) |
Step 2 — Mark Final vs. Non-Final Pairs
Mark pairs where one state is final and the other is non-final. These states are immediately distinguishable.
Step 3 — Check Transitions
For each unmarked pair , examine transitions for every input symbol
If pair is already marked, then must also be marked.
Step 4 — Repeat Until Stable
Continue marking pairs until no new pairs can be marked.
Step 5 — Identify Equivalent States
All unmarked pairs represent equivalent states. Merge these states and adjust transitions accordingly to obtain the minimal DFA.