Advanced maths

Synchronizing automaton calculator with a shortest reset word

Find the shortest word mapping every DFA state to one state, including the complete image-subset trace and exact non-synchronizing conclusion.

Your numbers

Calculated on your device. Your inputs aren’t sent to us.

Your result

Ready when you are

Enter your inputs and select Calculate.

Report an issue

Behind the numbers

How this calculation works

Find the shortest word mapping every DFA state to one state, including the complete image-subset trace and exact non-synchronizing conclusion. Syntactic-monoid construction studies all transition transformations and language equivalence, not this shortest subset-collapse problem.

THE FORMULAδ(Q,w)={δ(q,w):q∈Q}; w resets the DFA iff |δ(Q,w)|=1; rt(A)=min |w|.

A worked example

For Cerny’s four-state automaton with a fixing 0,1,2 and sending 3 to 0, and b cycling all states, a shortest reset word is abbbabbba, of length nine.

Good to know

Complete deterministic transition table, 1–16 states and 1–4 letters. BFS over ≤65,535 nonempty subsets and ≤262,140 subset transitions. No partial/incomplete DFA mode.

Reset word and synchronization

A reset word sends every possible starting state to the same terminal state. The automaton must be complete and deterministic, so every state has exactly one next state for each input letter.

Accepting states play no role in this question. Synchronization concerns the transition action on the entire state set, rather than which words a chosen start state accepts.

Synchronizing automaton calculator with a shortest reset word worked exampleCerny C₄: a b³ a b³ a0123012010ab³ab³aImage-set sizes: 4 → 3 → 2 → 1Shortest length = 9
Scroll across to see the full diagram.
For Cerny’s four-state automaton with a fixing 0,1,2 and sending 3 to 0, and b cycling all states, a shortest reset word is abbbabbba, of length nine.

Compare this with the Syntactic monoid calculator from a deterministic finite automaton. Find the shortest word mapping every DFA state to one state, including the complete image-subset trace and exact non-synchronizing conclusion. Syntactic-monoid construction studies all transition transformations and language equivalence, not this shortest subset-collapse problem.

Complete transition-table input

Extend each letter to subsets by taking the set of all images. Start with Q, the full state set, and apply letters to track the remaining possible states after an unknown initial state.

A singleton subset certifies synchronization. Duplicated images are removed as sets, which is what allows multiple possible starting states to merge under one input letter. In the default four-state Cerny automaton, one letter cycles all states while the other merges the last state with the first. A shortest reset word has length nine. The important output is the subset-image trace: after each letter, the image contains every state still possible from an unknown starting state. Reaching a singleton proves that the same word synchronizes every initial state, not merely that one selected state reaches a desired target.

Subset automaton construction

The subset automaton is finite. Breadth-first search visits image subsets in increasing word length, so the first singleton reached has a shortest reset word.

Store the previous subset and letter for each discovered state. Following these parents reconstructs the word without keeping all candidate words in memory, and its length must equal the BFS depth.

Breadth-first shortest-word proof

Replay the returned word separately from every original state. All runs must end at the reported common state, and the image-subset trace must agree with these individual trajectories.

Successful replay proves that the word resets. Shortestness comes from the completed breadth-first layers; an arbitrary word that happens to collapse the states supplies only an upper bound. The search runs on nonempty subsets of the original states. A letter maps a subset to the union of its individual transition images. Breadth-first search from the full state set reaches subsets in shortest-word order, so the first singleton supplies a shortest reset word. If the reachable subset graph is exhausted without a singleton, the automaton is nonsynchronizing. There are at most2^n−1 subsets, allowing up to sixteen original states within the stated alphabet and transition bounds.

Image-set trace and terminal state

In the default four-state example, a merges state 3 into state 0 and fixes the others; b is a four-cycle. The word a b³ a b³ a has nine letters.

The image sets shrink from four states to three, then two, then one, with the cycle letters positioning the next merge. Independent subset BFS confirms no shorter word reaches a singleton.

Cerny four-state example

If the complete reachable-subset search contains no singleton, the automaton is nonsynchronizing. A pair of states that can never merge can provide an additional compact negative certificate.

An automaton whose letters are all permutations cannot shrink a subset, so any such automaton with more than one state is immediately nonsynchronizing. A one-state automaton resets with the empty word. Different shortest words may exist. The deterministic letter order selects one witness, not a canonical linguistic description of all shortest words. Transition entries must be complete and zero-based; a missing transition is not treated as deleting a possible state, since that would change the problem to a partial automaton. The result also says nothing about a stochastic automaton's mixing time or a word's probability under a random input distribution.

Exhaustion certificates and excluded conjecture claims

The state bound keeps the complete nonempty subset space manageable, but the result still distinguishes exhaustion from a work-limit interruption. A timeout cannot establish nonsynchronization.

This page computes a specific reset threshold and word. It does not make a general extremal claim about all automata of the same size, nor does it need a conjectural bound to certify its finite BFS result.

A few questions, answered

Can the reset word be empty?

Yes. For a one-state automaton the empty word already leaves a singleton image.

Does a reset word depend on the start state?

No. The same word must merge every possible starting state.

Why is BFS shortest?

It explores image subsets in increasing word length, so the first singleton has minimum distance.

Does nonsynchronizing mean the DFA rejects every word?

No. Synchronization is independent of accepting states and accepted-language emptiness.

Find your calculator

Start typing to explore the library.