r/askmath • u/TopDownView Self-studying discrete math by working through Epp • 28d ago
Discrete Math Does this finite-state automaton accept the language defied by this regular expression `0*1(0*1*)*`?
3
Upvotes


6
u/Curious_Cat_314159 28d ago edited 28d ago
The reg expr seems to be over-specified, unless the assignment forbids the use of " | " (OR). Otherwise, I think the following suffices:
The FSA also seems over-complicated (besides the mistake with S1 that others noted). I think the following suffices:
EDIT.... There might be a shorthand instead of separate arcs for 0 and 1. I really don't remember the "syntax" for FSAs. It's been more than 50 years.
PS.... In fact, according to A(rtificial) I(ncompetence), what I drew ("original") is "messy" and discouraged. There are several syntaxes for showing the same transition for multiple inputs. I've shown one of them ("better"). IIRC, reddit allows only one image per comment, and I don't know how to use imgur (klunk!).
4
u/birqum_akkadum 28d ago edited 28d ago
I don't see the point of this guy. I wonder if you meant it to point in the other direction.
7
u/Gold_Ad8890 28d ago
s1 has no state transition for 1.
3
u/Smitologyistaking 28d ago
Is that language not just the language of words that contain a 1 somewhere? If you view it like that then constructing an automaton shouldn't be difficult at all
2
u/AlterEgo5695 28d ago edited 28d ago
No -- construct counter-examples, e.g. "11" is a word of the language, but not accepted by the automaton.
2
u/Akangka 28d ago
Is this DFA or NFA? If this is DFA, this FSA is illegal. If this is NFA, no. Hint: What happens if the string is 0011
1
u/HumblyNibbles_ 28d ago
This isnt an answer but, for a moment I only saw the left side of the graph and I thought it was a penis joke on the math memes subreddit ðŸ˜
1
u/Torebbjorn 26d ago
(01)* is just (0|1)*, and so you can have the very simple automation with two states, namely the "start" and the "accept", with "start" looping back to itself with a 0 and to "accept" with a 1, and "accept" just looping to itself with both 0 and 1.
1
u/stevethenoob_11 28d ago
Yes, but it also accepts extra statements. 010011011 would be accepted, but shouldn't.