Theory of Computation · Minimization of DFA
Introduction to DFA Minimization and State Equivalence
Overview
Minimization of a DFA is a procedure that decreases the number of states in a given DFA, either proving the DFA is already minimal or producing a smaller DFA that accepts the same language.
It applies to DFAs only, not NFAs, and replaces reliance on experience with a systematic guarantee of minimality. The key prerequisite is a precise notion of when two states may be merged: state equivalence.
Key concepts
- Minimization of a DFA: A procedure that decreases the number of states in a given DFA. The goal is either to prove the DFA is already minimal or to produce a DFA with fewer states that accepts the same language.
Minimization applies to DFAs only, not NFAs. - Why it matters: DFAs constructed by experience or insight were already minimal in earlier examples; minimization gives a systematic procedure to guarantee minimality instead of relying on experience.
- Equivalent states: Two states and of a DFA are equivalent, and can be replaced by a single state, if for every input string : if on seeing goes to a final state, then on seeing also goes to a final state; and if on seeing does not go to a final state, then on seeing also does not go to a final state.
- Same type, not same state: The two states need not go to the same final state — only to some final state (or, correspondingly, both to non-final states).
How it works
- Start with any DFA. The question minimization answers: can this DFA be minimized, and how?
- Before minimizing, fix a notion of when two states may be merged: state equivalence.
- Take two states and and consider any input string . Run on and run on .
If ends in a final state, must also end in a final state; if ends in a non-final state, must also end in a non-final state. - If this holds for all strings , then and are equivalent, and the two states can be replaced by a single state in the minimized DFA.
- The condition concerns the type of the ending state (final vs non-final), not reaching the identical state.
Drawing the diagram…
Formulas
-
-
= states of the DFA
-
= any input string
-
= extended transition function (state reached after reading )
-
= set of final states
-
= "is equivalent to"
-
Equivalently: iff for every , and are both final or both non-final.
Worked examples
No numerical example is worked in this section. The concept is illustrated only by the definition: two states and are equivalent exactly when, for every input string , either both reach final states or both reach non-final states (they need not reach the same final state).
Revision summary
- Minimization reduces the number of states of a given DFA; it is defined for DFAs only, not NFAs.
- Two states and are equivalent if for every input string , reaches a final state exactly when reaches a final state.
- "Both final" or "both non-final" is required; the final states reached need not be the same.
- Equivalent states can be merged into a single state.
- Hand-constructed DFAs were minimal by experience; minimization provides the systematic guarantee.
- The equivalence condition is about the type of the ending state (final vs non-final), not about reaching the identical state.
Previous-year exam insights
- Myhill–Nerode / distinguishability: two states are distinguishable if some string w takes exactly one of them to a final state; the minimal DFA is unique up to isomorphism and its states are exactly the equivalence classes of the right-invariant relation (the Myhill–Nerode classes).
Asked inGATE 2024GATE 2013GATE 2021 - Table-filling (partition refinement) procedure: start with the partition {F, Q−F}; repeatedly split blocks by the transition behaviour on each symbol (states p,q stay together only if δ(p,a) and δ(q,a) lie in the same block for every a); stop when no block splits — the resulting blocks are the states of the minimal DFA. Unreachable states must be removed first.
Asked inGATE 2024GATE 2013GATE 2015 - An NFA with n states can be converted to a DFA with at most states (subset construction), and every minimal DFA size from 1 up to is achievable, so a minimal DFA can never have more than states.
Asked inGATE 2026GATE 2025 - Counting states for modular conditions: a condition such as 'number of a's divisible by m but not by k' can be decided by counting a's modulo lcm(m,k), so at most lcm(m,k) states are needed (the accepting residues form the required set); the minimal DFA can have fewer, e.g. if k divides m the language is empty and one state suffices.
A single modular condition 'value mod m' needs m states.
Asked inGATE 2025GATE 2020 - Complement of a language: if the minimal DFA for L has k states (complete DFA, all states reachable), the minimal DFA for its complement also has exactly k states — just swap final and non-final states.
Asked inGATE 2021GATE 2015 - For a pattern language (strings containing/not containing a fixed substring, or avoiding k consecutive identical symbols), the minimal DFA needs one state per prefix matched plus a dead/trap state; the minimal DFA for the complement of Σ*·x·Σ* has |x|+1 states.
Asked inGATE 2023GATE 2015