Skip to content
Tape‑n‑Trace
PracticeSearch 26 tools

← All machines

DFA — binary, divisible by 3

Binary numerals whose value is divisible by 3.

Try
010101r0r1r2

Input

0 of 3 read

Narration

r0

Start in state r0 with "110" still to read.

Hopcroft 2e, §2.2.4

Accepted
Deterministic finite automatonHopcroft 2e §2.2 — δ̂

Exactly one move per state and symbol, so a run is a single path. The string is accepted if that path ends in an accepting state.

Also written DFSM, deterministic finite state machine in the question papers.

This machine3 states
Q
{r0, r1, r2}
Σ
{0, 1}
q₀
r0
F
{r0}
|δ|
6 transitions
How to read the run
  • One state is current at a time; it is outlined in blue.
  • The transition just taken is drawn in blue, and the symbol just read is boxed.
  • If a state has no move on the next symbol, the run dies there and the string is rejected — that is the implicit dead state a textbook diagram leaves off.

Run many strings

One string per line. A blank line means the empty string.