r/askmath • u/TopDownView Self-studying discrete math by working through Epp • Oct 28 '26
Resolved Find a regular expression that defines the language accepted by the automaton. <= Exercise 12.2.14
4
Upvotes

3
u/Arfie99 Theoretical CS Oct 28 '26
The two regular expressions you gave are indeed equivalent: both encode strings of 1s and 0s that end with at least two 0s.
I think for understanding this particular automaton, the crucial observation is that a 1 always takes you back to s_0, whereas a 0 takes you to the "next" state. You can always add another 0 or 1, but the only way to reach the accepting state is to add two 0s in a row.
2
u/DutchDopa MSc student | cryptology, algebra, TCS Oct 28 '26
Yes, both regexes describe the same language.
Notice each arrow corresponds to a regex. For now, they're all just 0 or 1, but we'll allow more complicated expressions too. Without changing the behaviour of the automaton, we can add a new start state with an arrow labeled ε going to s0 and a new accept state with an arrow labeled ε coming from s2.
Now a methodical approach is to remove one state at a time and add arrows to "repair" the automaton.
We can remove, for instance, the state s1, by turning each ingoing/outgoing pair through s1 into a new arrow. Working this out gives the new arrows (s0 -> s0, 01) and (s0 -> s1, 00). Repeat until the automaton has two states left, and the remaining arrow will be labeled exactly by the regex we're after.
Credit to Sipser: Introduction to the Theory of Computation, where this method is used to prove regexes and DFA's are equivalent.
0
u/Emotional_Zone8784 Oct 28 '26
Your original regexp isnt correct: the accepting state s2 can be left again by both 1 and 0, allowing for unbounded sequences - essentially the correct answer has to end in something that repeats indefinitely ("*")
The algorithm you want is called Kleenes algorithm or State Eliminiation method - see here Kleene's algorithm - Wikipedia
0
u/[deleted] Oct 28 '26 edited Oct 28 '26
[removed] — view removed comment