# How Can I Recognize When to Use ε-Transitions in an NFA?

I am learning about finite automata for the first time. I am having trouble understanding the purpose of ε-transitions in an NFA, which seem to be crucial to counting the number of states in an NFA and therefore an equivalent DFA.

Here is an example question that confuses me: What is the minimum number of states a DFA recognizing the language of a(bc)*d can have?

To answer this question, I first drew this NFA (dashed line indicates acceptance):

Because I think the above NFA is already a DFA, I thought the answer was "5".

However, the correct NFA and equivalent DFA look like this:

Which means the answer is "4". I understand why these are correct. But, I have some questions:

1) Is my original drawing actually an NFA? If not, why?

2) If the original drawing is an NFA, does it describe the language a(bc)*d? If not, why?

3) If the original drawing is an NFA that describes the language a(bc)*d, is it also a DFA? If not, why?

4) If the original drawing is an NFA and DFA that describes the language a(bc)*d, why should I have known to draw the NFA with ε-transitions instead?

• I realize my original drawing has an unnecessary state. But, my questions still stand. Jan 31 '16 at 9:04
• Look at Thompson's construction for a use-case of $\varepsilon$-transitions. While you could adapt the construction to do without, it's much clearer and easier to prove correct in this way.
– Raphael
Jan 31 '16 at 11:10
• unrelated with your question, but would you mind to share what tool/software/website you used to draw automata this beautiful?
– kate
Sep 23 '20 at 9:11

Your first drawing is a DFA (and thus an NFA) and does match the language described. The NFA with $\varepsilon$ transitions is a fairly natural (and mechanical) translation of the regular expression, but other than that, it isn't inherently "more correct" than the NFA you started with.

The only confusion I see here other than uncertainty is once you validated that your NFA was a DFA you seemed to have just taken it for granted that it was minimal. Starting from your DFA, you could have noticed that S4 has the same out-transitions as S2 and that they might possibly be joined. Doing so would have immediately produced the final DFA.

• Thank you, I actually just realized that! OK, so one my main takeaways are to scrutinize the end product to see if any states can be combined, and one hint that states can be combined is the out-transitions of the states are the same. Jan 31 '16 at 9:06