A deterministic finite automaton is the 5-tuple M = (Q, Σ, δ, q₀, F): a finite set of states Q, an input alphabet Σ, a transition function δ, a start state q₀ and a set of accepting states F. Reading a string w = w₁w₂…wₙ means repeatedly applying δ, one symbol at a time, until the string is exhausted.
δ: Q × Σ → Q
state ← q₀
for each symbol s in w:
state ← δ(state, s)
accept iff state ∈ F
- Automaton buttons — swap the machine being simulated: "ends with 01", "even number of 0s", "contains 11" — three classic regular languages from the article.
- Input string — the word w being fed to the machine, one symbol per animation step.
- Play / Step / Reset — animate the whole run, advance one symbol, or rewind to q₀.
- Speed — how many symbols per second Play consumes.
This exact δ-lookup loop is what a lexer's DFA does inside every compiler and what a regular-expression engine does under the hood when it scans your text character by character.