0

I need to construct a DFA that accepts strings from the alphabet {a,b} that contain 3 consecutive "ab".This is my try and i am wondering if it's correct? enter image description here

DrStrange
  • 116

1 Answers1

1

No. A $b$ from $q_4$ should take you to $q_0$.

  • So apart from that it is correct?Can you think of a string that has 3 consecutive "ab" but will get rejected by my (wrong) dfa?Thanks a lot – DrStrange Nov 30 '19 at 14:34
  • 1
    @DrStrange Yup, that's it. Each even node aside from the last one should kick a $b$ down to $q_0$ and each odd node should kick an $a$ down to $q_1$. Aside from the one mistake, that's what you have. –  Nov 30 '19 at 14:37