# Converting NFA to DFA

I've converted an NFA to a DFA. But even after checking over it a few times, it still doesn't feel right. I'm sure this is trivial, but I'd like someone to give me an idea where I went totally wrong on this.

NFA:

DFA:

• Why would you say it doesn't feel right? It does to me. – Untitled Sep 20 '13 at 3:01
• You could use ony drawing tool to get nicer images (Libre Office Draw, GraphViz, LaTeX with TikZ, ...). At least you can crop and rotate the images properly, convert to grayscale and fiddle around with contrast and brightness. As for your question, there are algorithms to do this conversion; why do you doubt them? – Raphael Sep 20 '13 at 15:20

Well, of course you have to merge the two empty states and there should be two transitions $(\{q_5\}, a, \emptyset)$ and $(\{q_5\}, b, \emptyset)$ if you want a complete automaton, but otherwise, it looks right and I agree with Subhayan: both automata accept $ab^+ \cup ab^+a$.
• I added $(\{q_5\}, a, \emptyset)$ and $(\{q_5\}, b, \emptyset)$ so it just merges with the $\emptyset$ closest to it. So there's still two $\emptyset$ on the graph. How wrong is that? It's really for convenience when drawing. – stackuser Sep 20 '13 at 15:54
Based on your constructions, it seems like both machines accept the same language, i.e. $ab^+ \cup ab^+a$.
• i tried to "simulate the machines" independently, it seemed to me that the DFA and NFA both accepted languages that start with $a$, contains at-least one $b$ and also those (with the same conditions as prev and) that end with an $a$. Do you think I got it wrong somehow? – Subhayan Sep 20 '13 at 4:59