How to convert Epsilon NFA to NFA
Overview
A nondeterministic finite automaton has zero, one, or more than one transition from one state to another or itself. In epsilon nondeterministic finite automaton, null or epsilon transitions take place from one state to another state.
The need for an epsilon NFA
An epsilon NFA is formed by a regular expression for a language. This epsilon NFA is then converted to a simple NFA. The obtained NFA is then used for making a deterministic finite automaton.
Note: To learn how to convert an NFA to a DFA, click here.
Null closure method
Suppose an NFA
is the finite set of states. is the input symbols. is the start state. is the transition function. is the final state.
The null closure of
- For every
,
To convert an epsilon NFA to NFA, the null closure method makes use of the following general set of rules.
- Find the null closures for each state.
- For each state, check for the transitions by the null closures obtained, the given input, and then the null closures again. This eliminates any potential null closures that can occur.
- Make an NFA by the transitions obtained in the previous step. The final state will be all those states that have
in them.
Example
Consider the following epsilon NFA,
Step 1: Find null closure of all states
Find the null closure of all the states by the property defined before.
Null Closure
state | set |
q0 | {q0, q1, q3} |
q1 | {q1, q3} |
q2 | {q2} |
q3 | {q3} |
Step 2: Follow the process of null closure, input, null closure
Implement the process for all states for the given inputs in order.
Transitions
state | 0 | 1 |
q0 | {q0, q1, q2, q3} | - |
q1 | {q2, q3} | - |
q2 | - | {q1, q3} |
q3 | {q3} | - |
Step 3: Result
Make the NFA through the transitions obtained in the previous step.
All states that have
Free Resources