Find an automaton that recognizes this language

374 Views Asked by At

The exercise is copied literally, and asks to find an automaton that recognizes the language described by the regular expression $a{(bab\vee a)}^\ast b$.

I have no idea how to start.

Any help? Thanks!

1

There are 1 best solutions below

3
On BEST ANSWER

This automaton should recognize strings that starts with $a$ and ends in $b$ which is easy to draw. $$\rightarrow s_0\stackrel{a}\rightarrow s_1\stackrel{b}\rightarrow s_2$$ where $s_2$ is the final state.

The middle part $(bab\vee a)^*$ is a finite length string made of $bab$ and $a$. This should be implemented in the state $s_1$ with self-loop labeled $a$ and for $bab$, $$s_1\stackrel{b}\rightarrow s_3\stackrel{a}\rightarrow s_4\stackrel{b}\rightarrow s_1.$$

Edit:

Image by @manooooh