Converting DFA to Regex

98 Views Asked by At

I am trying to convert these finite automata to a regex. I tried using Arden's Theorem and state-elimination pattern. I cannot figure out how to do either as I keep getting stuck. For Arden's Theorem, I am unable to solve the "system of equations" and for state-elimination, I'm not sure how to remove each state and look at the pattern. This is the DFA:DFA

1

There are 1 best solutions below

2
On

This one seems simple enough to do by inspection. The regular expression $(aa^*b+bb^*a+\epsilon)^*$ describes the inputs that leave the DFA in the initial state. The words accepted by the DFA are precisely those that take it at some point to $q_0$ and then end with either $aa^*$ or $bb^*$, so the language of the DFA is

$$(aa^*b+bb^*a+\epsilon)^*(aa^*+bb^*)\,.$$