Library

Mealy · Rational transduction

Detecting 101, overlaps allowed

Print 1 at each position where the last three bits read were 101, and 0 elsewhere. After a match the final 1 can start the next one, so 10101 has two. The textbook sequence detector, in its Mealy form: it answers on the very bit that completes the pattern.

noneoneone00/01/01/00/01/10/0
The machine as drawn — 3 states, 6 transitions.

The author’s examples, run

0 → reject · 01 → reject · 000 → reject · 0001 → reject · 00000 → reject · 0001111101100011000 → reject · 0000001000000000