- Trending Categories
- Data Structure
- Operating System
- C Programming
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How to convert the finite automata into regular expressions?
Convert the given finite automata (FA) into regular expression (RE).
There are two popular methods for converting a DFA to its regular expression −
- Arden’s Method
- State elimination method
Let’s consider the state elimination method to convert FA to RE.
The rules for state elimination method are as follows −
The initial state of DFA must not have any incoming edge.
If there is any incoming edge to the initial edge, then create a new initial state having no incoming edge to it.
There must exist only one final state in DFA.
If there exist multiple final states, then convert all the final states into non-final states and create a new single final state.
The final state of DFA must not have any outgoing edge.
If this exists, then create a new final state having no outgoing edge from it.
Eliminate all intermediate states one by one.
Now, apply these rules to convert the FA to RE easily.
The given FA is as follows −
Initial state q1 has an incoming edge so create a new initial state qi.
Final state q2 has an outgoing edge. So, create a new final state qf.
Start eliminating intermediate states
First eliminate q1
There is a path going from qi to q2 via q1. So, after eliminating q1 we can connect a direct path from qi to q2 having cost.
There is a loop on q2 using state qi. So, after eliminating q1 we put a direct loop to q2 having cost.
After eliminating q1, the FA looks like following −
Second eliminate q2
There is a direct path from qi to qf so, we can directly eliminate q2 having cost −
C*a(d+bc*a)* ε = c*a(d+bc*a)*
Which is our final regular expression for given finite automata.
- What are the regular expressions to finite automata?
- How to convert Regular expression to Finite Automata?
- Can we convert a non-deterministic finite automata into a deterministic finite Automata?
- How to generate regular expression from finite automata?
- Explain the relationship between Finite Automata and Regular Expression.
- Find out the Regular expression for the given finite automata
- How to Convert Perl Compatible Regular Expressions (PCRE) into Lua
- Design finite automata from a given regular expression.
- What is the conversion of a regular expression to finite Automata (NFA)?
- What is finite automata?
- Construct a Finite Automata for the regular expression ((a+b)(a+b))*.
- Find the regular expression for the given Finite automata with state elimination method
- Efficient Construction of Finite Automata
- Generate a Regular Expression for a Finite Automata with state elimination method
- Explain Deterministic Finite Automata in TOC.