I'm working through a textbook on automata theory and I'm stuck on this regular expression problem.
Create a regular expression for the following language:
The set of all strings that do not contain "101" as a substring.
I tried to create the expression and found I couldn't, so I create an automata, but I have figured out how to translate it into a regular expression.
A regular expression is $$ (0\mid 11^*00)^*(\epsilon\mid 11^*(\epsilon\mid 0)) = \\ (0\mid 1^+00)^*(\epsilon\mid 1^+(\epsilon\mid 0)) = \\ (0\mid 1^+00)^* \mid (0\mid 1^+00)^*(1^+\mid 1^+0) $$
Update
I told my friend Ruby to check the given regular expressions (link),
this is what she got (link):
Transformation of the deterministic finite automaton into a regular expression
We start with this DFA:
Then turn it into this Thompson NFA, having dedicated start and finish states:
Drop the one way road:
Then we eliminate the original states one by one: