# How to draw a DFA for (a|ba)(a|ba)*

I met a question concerning draw a DFA for $$\left(a\vert ba\right)\left(a\vert ba\right)^\ast$$.
I firstly tried to expand the regular expression to a $$\varepsilon$$-NFA, then plan to transform it to a DFA. However, I feel there is something wrong when I expand $$\left(ba\right)^\ast$$. Because when I use the closure method to convert my $$\varepsilon$$-NFA to DFA, some states could not accept b, so even I draw the 'DFA', it may be not the correct DFA.
So is it a normal situation under this $$\left(ba\right)^\ast$$ condition? Or it is because where I got wrong? Please tell me if you have any thoughts, thank you!
The following is what I have tried for your kind reference.

• Hi, as I said in the same question that you posted a while ago, all you need to do is to add a "reject" state to $q_1$ that rejects any strings with $bb$ in them ($q_1$, reading $b$, goes to $q_2$ which is non-accepting, and q_2, reading anything, stays in $q_2$). math.stackexchange.com/questions/3324704/… Aug 16 '19 at 7:25

As you can see, once two $$b$$'s follow each other directly, we go to the lower right state, from which no escape is possible. Any other string that is nonempty and ends with an $$a$$ gets accepted.