I can't seem to make it work. I think I managed to produce a solution when it's exactly one occurrence of 010 but not when it's at most one occurrence. Check out my automaton.
2026-03-25 17:20:48.1774459248
DFA construction - How to construct an automaton that contains either 0 or 1 occurrences of 010?
42 Views Asked by Bumbble Comm https://math.techqa.club/user/bumbble-comm/detail At
1
I suggest the following states:
with transitions $A\stackrel 0\to B$, $A\stackrel 1\to A$, $B\stackrel 0\to B$, $B\stackrel 1\to C$, $C\stackrel 0\to E$, $C\stackrel 1\to A$, $D\stackrel 0\to E$, $D\stackrel 1\to D$, $E\stackrel 0\to E$, $E\stackrel 1\to F$, $F\stackrel 0\to $☠, $F\stackrel 1\to D$ and all states (except ☠) accepting.
(According to the comment added that $01010$ should only count one occurance of $010$, we need the transition $C\stackrel 0\to D$ instead of $C\stackrel 0\to E$)