DFA for {any sequence of a and b, between two consecutive "b" there are maximum 3 "a"}

283 Views Asked by At

I have tried to draw a deterministic finite automaton for the language L={any sequence of a and b, between two consecutive "b" there are maximum 3 "a"}:enter image description here

Is it correct?

1

There are 1 best solutions below

1
On BEST ANSWER

Not quite. Check inputs $bababababab$ and $baabaab$.

After your edit, $baabaab$ is still not accepted. We might suggestively name the four states $a^*$, $xb$, $xba$, $xbaa$, and $xbaaa$. Then reading $b$ should take you from any of the states to $xb$, whereas reading $a$ "moves right" by one state (except that it keeps you in $a^*$ and is "forbidden" for $xbaaa$)