# Does this DFA describe this regular expression?

For the expression (ab)*ba I came up with the following (very poorly drawn):

However, this was not the correct answer - apparently the solution requires five states. I don't understand why my DFA doesn't describe the expression. My interpretation of the expression is "ab any number of times, followed by ba". Is this correct?

For something to be a DFA, it should have transitions from every state for every letter in the alphabet. Your alphabet is {$$a, b$$}, so every state should have a transition for $$a$$ as well as $$b$$, e.g., your state 2 does not have a transition for $$a$$. Complete your DFA and you'll get what is that 5th state that you are missing.