An interactive, step-by-step visualizer powered by
the Myhill–Nerode Theorem
A Deterministic Finite Automaton (DFA) is one of the simplest models of computation. Think of it as a machine that reads a string of characters one-by-one and decides — does this string belong to my language?
It has a fixed set of states, starts in one state, reads characters, and transitions to a new state for each character. If it ends in an accept state, the string is accepted.
A DFA can have redundant states — states that behave identically. Two states might accept exactly the same future strings, making one unnecessary.
A Minimized DFA is the smallest DFA that recognizes the exact same language. No redundant states. Every state is unique. It's the canonical representation — two DFAs accept the same language if and only if their minimized forms are identical.
This theorem gives us a precise way to determine which states are equivalent. It defines an equivalence relation:
Two states p and q are Myhill–Nerode equivalent (p ≡ q) if and only if for every suffix string w:
In plain English: states p and q are equivalent if no string can tell them apart. No matter what you append, both states agree — they either both accept or both reject. If even one string distinguishes them, they must remain separate states.
We use the Table-Filling Algorithm to systematically find all distinguishable pairs:
Below is a DFA with 6 states. Some states behave identically and can be merged. Let's minimize it.
Watch the algorithm work through each step automatically. The table fills cell-by-cell, showing every comparison.
The minimized DFA compared with the original. Equivalent states have been merged.