Library

DFA · Regular

At least two 0s and at most one 1

Two thresholds checked together. Past two 0s the zero count no longer matters, and a second 1 is fatal, so the machine is a 3 × 2 product with no state for "two 1s".

z0o0z1o0z0o1z2o0z1o1z2o1010100100
The machine as drawn — 6 states, 9 transitions.Every word up to length 8, one row per length in shortlex order, inked where it is accepted.

The author’s examples, run

00 → accept010 → accept0000 → accept0000000010 → accept10 → reject110 → reject1000000010 → rejectε → reject