STATE MACHINE SIMULATION

A subway turnstile remembers exactly one thing, locked or unlocked, and yet the same push produces two different outcomes depending on where it stands. That is the whole idea of a finite state machine: all its memory lives in the current state, and the transition function δ takes a state together with a symbol and returns the next state. Three states r0, r1, r2 under the rule that the new remainder equals (2r + bit) mod 3 suffice to read a binary string of any length and tell whether it divides by 3. Kleene’s theorem seals it: whatever a regular expression can describe, an automaton can recognize, and the other way round.

▸ Building the state diagram & transition table…
▸ Loading DFA machines (pattern · divisibility · gate · vending)
▸ Loading the timed machine (traffic light)
▸ Loading the NFA + ε-moves (many parallel states)
▸ Generating the input string & calibrating the token…
▸ Ready — Online. ✅
0%
⌂ Mind & Machine

Simulation room Finite state machine

Finite State Machine & Regex
Online
state · transition · DFA/NFA · regex
State & string
🔤 Pattern matcher "01"
Current state—
Consumed—
Remaining—
Result—
Machine size—
Viewing—
Notes
A finite state machine remembers only "which state am I in" among a FINITE number of states. It reads a string of symbols and, following a transition table, jumps between states — exactly as powerful as a regular expression (regex).
—
Pick a ‘Scenario’ to change machine (pattern · light · vending · gate · div-by-3 · NFA) · 🎲 new string to watch it run again · click a concept/machine for details
Your browser has canvas disabled.
String consumption progress & live state count over time readlive states
About Finite State Machine

A subway turnstile remembers exactly one thing, locked or unlocked, and yet the same push produces two different outcomes depending on where it stands. That is the whole idea of a finite state machine: all its memory lives in the current state, and the transition function δ takes a state together with a symbol and returns the next state. Three states r0, r1, r2 under the rule that the new remainder equals (2r + bit) mod 3 suffice to read a binary string of any length and tell whether it divides by 3. Kleene’s theorem seals it: whatever a regular expression can describe, an automaton can recognize, and the other way round.

Related topics in Mind & Machine