363 views
0 votes
0 votes

the regular expression for the given finite automata plz provide  ans step by step 

1 Answer

0 votes
0 votes
As $q_0$ is the intial state and also the final state so "$\boldsymbol{\varepsilon}$" is accepted

If we take $a$ or $b$ we we go to state $\boldsymbol{q_1}$, so the regx starts with $\boldsymbol{(a+b)}$

Now, how we go from state $\boldsymbol{q_1}$ to $\boldsymbol{q_1}$ by :

$\textbf a$, $\textbf{bb}$ and $\boldsymbol{ba(a+b)}$ and this can be done repeatedly.

So, the regx till now becomes $\boldsymbol{(a+b)(a+bb+ba(a+b))^*}$

So, now from state $q_1$ we will go to either state $\boldsymbol{q_0}$ or $\boldsymbol{q_2}$

To go to state $\boldsymbol{q_2}\rightarrow\textbf b$ and for $\boldsymbol{q_1}\rightarrow\textbf{ba}$. So, the regx ends with $\boldsymbol{b+ba}$

So the regx will be $\boldsymbol{\varepsilon+(a+b)(a+bb+ba(a+b))^*(b+ba)}$