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.
Asked
Active
Viewed 41 times
2
-
Would $01010$ contain two occurrences of $010$? – orlp Feb 22 '19 at 20:22
-
One occurrence. – Eddie Sed Feb 22 '19 at 20:33
-
1Please mention then "two disjoint occurences" or so. The question should please be also a part of the posted question, not only the title. – dan_fulea Feb 22 '19 at 20:34
-
Making A,B,C,D,E,F final, but not G is the solution?! – dan_fulea Feb 22 '19 at 20:35
1 Answers
1
I suggest the following states:
- $A$: initial
- $B$: have not seen $010$ yet, just saw $0$
- $C$: have not seen $010$ yet, just saw $01$
- $D$: have seen $010$ already
- $E$: have seen $010$ already, just saw $0$
- $F$: have seen $010$ already, just saw $01$
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$)
Hagen von Eitzen
- 374,180
-
1I'm always a bit conflicted in cases like this. From an educational perspective I believe your answer would actually be better without giving the transitions and letting the asker figure it out for themselves. From a knowledge base perspective your answer right now is better... – orlp Feb 22 '19 at 21:25