In order to understand the relationship between finite automata (FA) and regular expression (RE), we need to understand these terminologies. Let us begin by understanding what is a regular expression.
Regular expression is the language which is used to describe the language and is accepted by finite automata. Regular expressions are the most effective way to represent any language. Let Σ be an alphabet which denotes the input set.
The regular expression over Σ can be defined as follows −
The r* is known as Kleen closure or closure which indicates occurrence of r for an infinite number of times.
Now, let us learn about finite automata.
Finite automata is an abstract computing device. It is a mathematical model of a system with discrete inputs, outputs, states and a set of transitions from state to state that occurs on input symbols from the alphabet Σ.
Finite automata is defined as a 5-tuples
M=(Q, Σ, δ,q0,F)
Now that we have learnt about these terminologies, let us understand the relation between them.
The relationship between FA and RE is as follows −
The above figure explains that it is easy to convert