Theory of Computation · Epsilon NFA and Conversions
Definition and Formal Model of Epsilon NFA
Overview
An ε-NFA is a finite automaton whose transitions may be labelled with the empty string ε, so the machine can change state without consuming any input symbol.
It differs from an ordinary NFA only in the transition function, which is why its formal model and the resulting ε-closure concept matter for later conversions.
Key concepts
- ε (epsilon): the empty string.
- ε-NFA: a special kind of NFA — a finite automaton whose transitions may be labelled with ε. The machine can change state without consuming any input symbol.
- Only difference from an ordinary NFA: in an ε-NFA a transition may contain ε, i.e. ε-moves exist. In a DFA or an ordinary NFA there are no ε-moves.
- Drawing: an ε-NFA is drawn exactly like a DFA/NFA — states as circles, arrows for transitions, initial state marked, final states double-circled — with the extra feature that some arrows are labelled ε.
- ε-closure: the set of states reachable from a state using only ε-moves.
How it works
- The machine is specified as the 5-tuple .
- , , and keep their usual meaning; only changes.
- In an ordinary NFA, maps a state and an input symbol to a subset of states.
- In an ε-NFA, is extended so that ε is also allowed as a "symbol" on which a move can be made.
- Consequence: from a state, on seeing a symbol, the machine can go to some state, or from a state, without seeing anything (without consuming input), a transition is possible. This "move without input" is the key new behaviour.
- The states reachable from a state using only ε-moves form its ε-closure.
Drawing the diagram…
Formulas
-
— the 5-tuple defining an ε-NFA; = set of states, = input alphabet, = transition function, = initial (start) state, = set of final (accepting) states.
-
— transition function of an ordinary NFA: from a state and an input symbol to a subset of ( = power set of ).
-
— transition function of an ε-NFA: same, but ε is also permitted as the "input", so a move is possible without consuming a symbol. For a state and a symbol , as usual; and gives the states reachable from without reading any input.
Comparison
| Feature | DFA / NFA | ε-NFA |
|---|---|---|
| Transitions labelled ε | Not allowed | Allowed |
| Input consumed on every move | Yes | No — an ε-move consumes nothing |
| Transition function | (NFA) | |
| States, alphabet, start state, final states | , , , | , , , (same) |
Revision summary
- ε means the empty string, not a symbol of the input alphabet.
- The only difference from an ordinary NFA is the presence of ε-moves (moves made without reading input).
- , , , have the same meaning as in DFA/NFA; only changes.
- In an NFA, maps into (a subset of states); in an ε-NFA, ε is added to the domain.
- The states reachable from a state using only ε-moves form its ε-closure.
- A DFA or ordinary NFA has no ε-moves.
Previous-year exam insights
- ε-closure is extended to sets: ε-closure(S) = union of ε-closure(q) for all q in S;
and ε-closure is idempotent, i.e. ε-closure(ε-closure(S)) = ε-closure(S). - For an ε-NFA, the move on a symbol a from state q is ε-closure(δ(δ̂-style step)): first take ε-closure of q, then follow a-transitions, then take ε-closure again — i.e. δ̂(q, a) = ε-closure(δ(ε-closure(q), a)).
- A string is accepted by an ε-NFA if some state reachable after reading the string (with ε-closures applied) is in F; in particular ε is accepted iff ε-closure(q0) contains a final state.
- Every ε-NFA is equivalent to an NFA without ε-moves and to a DFA (subset construction), so ε-NFAs accept exactly the regular languages; ε-moves add convenience, not power.
- In the subset construction for ε-NFA to DFA, each DFA state is an ε-closed subset of NFA states: start state is ε-closure(q0), and a subset is final if it contains any final state of the ε-NFA.
- Trap: ε is not a member of Σ; the alphabet Σ of an ε-NFA never contains ε, and ε-transitions are not counted as consuming input when checking string length or acceptance.