[Math] Finding a language expressed by an automaton

finite-automata

I'm having trouble trying to find a language expressed by this automation. I have constructed a next-state table to help me understand better. From my understanding, any string that starts with 0 takes my automaton A to an accepting state but what if it doesn't start with 0 i.e a 1? The automation would need 14n to take us back to S0 enter image description here

I want to

  • Find the language accepted by the automaton
  • Find a regular expression that defines the same language

Best Answer

Converting NFAs to regular expressions

The theory of this method is very well described on the CS Stack Exchange. I am directly going to apply it since it is so simple in this case that you might follow without knowing the algorithm yet.


I am going to introduce a system of equations to describe the language $S_n$ that is being accepted starting from state $s_n$ with the following equations:

$$\begin{align*}S_0 &\equiv 0S_0~\mid~1S_1~\mid~\epsilon\\ S_1 &\equiv 0S_1~\mid~1S_2\\ S_2 &\equiv 0S_2~\mid~1S_3\\ S_3 &\equiv 0S_3~\mid~1S_0\end{align*}$$

An expression of the form $S_m\equiv aS_n$ represents a transition from $s_m$ to $s_n$ by reading $a$ and the $\epsilon$ marks a state as a final state. We are looking for a final expression for $S_0$ (the language accepted starting from state $s_0$) and need some tricks to get to that point.

Now I am going to use Ardens Lemma which states (written using regular expressions and not sets of languages) that $$X\equiv \alpha X~\mid~\beta\implies X\equiv \alpha^*\beta$$ which helps to solve equations of the the form that is described on the left side. We can apply this to all four rules which yields the following (I am doing this backwards):

$$\begin{align*} S_3 &\equiv 0S_3~\mid~1S_0\color{red}{\equiv 0^*1S_0}\\ S_2 &\equiv 0S_2~\mid~1S_3\color{red}{\equiv 0^*1S_3}\\ S_1 &\equiv 0S_1~\mid~1S_2\color{red}{\equiv 0^*1S_2}\\ S_0 &\equiv 0S_0~\mid~1S_1~\mid~\epsilon\\ &\equiv 0S_0~\mid~(1S_1~\mid~\epsilon)\\ &\;\color{red}{\equiv 0^*(1S_1~\mid~\epsilon)} \end{align*}$$

Now we have to plug in $S_3$ into $S_2$ into $S_1$ into $S_0$:

$$\begin{align*} S_0 &\equiv 0^*(1S_1~\mid~\epsilon) \\ &\equiv 0^*(10^*10^*10^*1S_0~\mid~\epsilon) \\ &\equiv 0^*10^*10^*10^*1S_0~\mid~0^* \\ &\;\color{red}{\equiv(0^*10^*10^*10^*1)^*0^*}. \end{align*}$$

The very last equivalence in red follows from Ardens Lemma once again - just be careful how to handle the expression preceeding it.

My result supports J.-E. Pins solution and disproves Globe Theatres solution as well.

Related Question