How to convert finite automata to regular expressions
Every finite automaton has an equivalent regular expression.
The conversion of a finite automaton to a regular expression is done through the state elimination method.
State elimination method
The State elimination method follows the following general set of rules:
- Add a new initial state (
). Make a null transition from the old initial state to the new initial state. - Add a new final state (
). Make null transition(s) to the new final state. - Eliminate all states, except
and , in the given finite automaton. Perform the elimination of states by checking the andin-degrees A transition into a state of states and taking a cross product.out-degrees A transition moving away from a state
After steps 1 and 2, the
Example
Let's consider the following finite automaton:
Step 1: Add an initial state
Add a new initial state,
Step 2: Add a final state
Add a new final state,
Step 3: State elimination
Perform the elimination of states other than
Step 3.1
Eliminate state
Step 3.2
Eliminate state
Step 3.3
Eliminate
Step 3.4
Eliminate state
Step 3.5
Put it all together.
Result
The resultant regular expression for the given finite automaton is as follows: