Theory of Computation · Minimization of DFA
k-Equivalence of States (0, 1, 2, n Equivalent)
Overview
k-equivalence is a way of comparing two states of a DFA by how they behave on input strings up to a fixed length k.
Growing k from 0 upward and finally removing the length bound gives full state equivalence, which is the tool used to decide which states can be merged during DFA minimization.
Key concepts
- k-equivalent states: Two states and of a DFA are k-equivalent when they behave identically on every input string whose length is at most .
Formally, and are k-equivalent if, for every string with , is a final state exactly when is a final state (both accept or both reject). - Extended transition function : runs the string from the given state; is the length of .
- 0-equivalent: only the empty string is tested (). Both states must agree on acceptance/rejection for the empty string — so both are final or both are non-final.
- 1-equivalent: a single symbol is tested (). The states must agree for the empty string and for every single input symbol.
- 2-equivalent: strings of length up to 2 are tested ().
- n-equivalent: strings of length up to are tested ().
- Equivalent (no length bound): for every possible of any length, and give the same accept/reject result.
- Merging: equivalent states can be merged into one state, decreasing the number of states in the final (minimized) automaton.
How it works
- Length of : the two states and are 0-equivalent.
- Length of : if and satisfy the property for a single symbol, they are 1-equivalent.
- Length of : they are 2-equivalent.
- In general, for all strings with : they are n-equivalent.
- Finally, if the property holds for and for every possible , then and are equivalent.
The chain 0-equivalence, 1-equivalence, 2-equivalence, ... is the tool used to decide which states may be merged: if two states are equivalent, keep one merged state instead of two different states, thereby decreasing the number of states in the minimized automaton.
Drawing the diagram…
Formulas
- and are k-equivalent iff for every with :
- : states of the DFA
- : input string
- : length of
- : extended transition function
- : set of final states
Worked examples
The method is demonstrated on a DFA by computing its equivalence classes (0-equivalent, 1-equivalent, 2-equivalent, ...) and using them to decide which states to merge.
Comparison
| Notion | Strings tested |
|---|---|
| 0-equivalent | only the empty string () |
| 1-equivalent | empty string and every one-symbol string () |
| 2-equivalent | all strings of length up to 2 () |
| n-equivalent | all strings of length up to () |
| Equivalent | all strings of any length (no bound) |
Revision summary
- k-equivalence compares two states only on strings of length at most k; full equivalence compares them on all strings.
- 0-equivalence = agreement on the empty string: both final or both non-final.
- 1-equivalence = agreement on the empty string and on every one-symbol string.
- n-equivalence = agreement on all strings of length .
- Equivalent states can be merged into one state, reducing the number of states of the DFA.
- Minimization is applied to DFAs, not NFAs.
Previous-year exam insights
- k-equivalence is refined step by step: P and Q are (k+1)-equivalent iff they are k-equivalent and, for every input symbol a, the states δ(P,a) and δ(Q,a) are k-equivalent.
So the partition for k+1 is obtained by splitting each k-equivalence class according to the k-classes of the successors.
Asked inGATE 2024 - Two states are distinguishable if some string w leads exactly one of them to a final state; states are equivalent iff no such string exists.
Equivalence of states is thus the complement of distinguishability, and the minimized DFA has one state per equivalence class of the indistinguishability relation.
Asked inGATE 2024 - The chain of partitions stabilizes: if the number of classes does not increase when going from k to k+1, then it never increases again, and the k-classes are exactly the full equivalence classes (no need to test longer strings).
- 0-equivalence has exactly two classes: all final states form one class and all non-final states form another (a DFA with no final states, or all states final, has a single class).
- Unreachable states are removed before minimization; the minimal DFA is unique up to isomorphism, and merging equivalent states never changes the accepted language.
- k-equivalence (agreement on all strings of length ≤ k) is an equivalence relation for every fixed k, and the partitions get progressively finer;
once P(k+1) = P(k) the refinement has stabilised.
Two states that are k-equivalent for every k are equivalent, because any distinguishing string has some finite length, whether or not the machine has finitely many states.