HiveBrain v1.2.0
Get Started
← Back to all entries
snippetMinor

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

Submitted by: @import:stackexchange-cs··
0
Viewed 0 times
transitionscanhownfarecognizewhenuse

Problem

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?

Solution

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.

Context

StackExchange Computer Science Q#52510, answer score: 3

Revisions (0)

No revisions yet.