1

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?

Mary Star
  • 13,956

1 Answers1

3

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$)