1. Gyanastra
  2. Theory of Computation
  3. Minimization of DFA
  4. k-Equivalence of States (0, 1, 2, n Equivalent)
Free lesson, no account needed 5 min read 10 practice questions after it
Asked in past papers3 times
  • GATE CSE202420072006

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 PP and QQ of a DFA are k-equivalent when they behave identically on every input string WW whose length is at most kk.
    Formally, PP and QQ are k-equivalent if, for every string WW with ∣W∣≤k|W| \le k, δ∗(P,W)\delta^*(P, W) is a final state exactly when δ∗(Q,W)\delta^*(Q, W) is a final state (both accept or both reject).
  • Extended transition function δ∗\delta^*: runs the string WW from the given state; ∣W∣|W| is the length of WW.
  • 0-equivalent: only the empty string is tested (∣W∣=0|W| = 0). 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 (∣W∣=1|W| = 1). The states must agree for the empty string and for every single input symbol.
  • 2-equivalent: strings of length up to 2 are tested (∣W∣≤2|W| \le 2).
  • n-equivalent: strings of length up to nn are tested (∣W∣≤n|W| \le n).
  • Equivalent (no length bound): for every possible WW of any length, PP and QQ 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

  1. Length of W=0W = 0: the two states PP and QQ are 0-equivalent.
  2. Length of W=1W = 1: if PP and QQ satisfy the property for a single symbol, they are 1-equivalent.
  3. Length of W=2W = 2: they are 2-equivalent.
  4. In general, for all strings WW with ∣W∣≤n|W| \le n: they are n-equivalent.
  5. Finally, if the property holds for PP and QQ for every possible WW, then PP and QQ 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.

Figure. Start with final and non-final classes. Split each k-class by the k-classes of its successors. When P k plus 1 equals P k, the classes are full equivalence classes and can be merged.

Formulas

  • PP and QQ are k-equivalent iff for every WW with ∣W∣≤k|W| \le k: δ∗(P,W)∈F  ⟺  δ∗(Q,W)∈F\delta^*(P, W) \in F \iff \delta^*(Q, W) \in F
    • P,QP, Q: states of the DFA
    • WW: input string
    • ∣W∣|W|: length of WW
    • δ∗\delta^*: extended transition function
    • FF: 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

NotionStrings tested
0-equivalentonly the empty string (∥W∥=0\|W\| = 0)
1-equivalentempty string and every one-symbol string (∥W∥≤1\|W\| \le 1)
2-equivalentall strings of length up to 2 (∥W∥≤2\|W\| \le 2)
n-equivalentall strings of length up to nn (∥W∥≤n\|W\| \le n)
Equivalentall 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 ≤n\le n.
  • 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.
Pages 1–2 of 2