[Math] Help in constructing a DFA equivalent to this NFA

algorithmsautomatacomputer science

First post here, woot. I've been a member of Stack Overflow for a while, so hopefully you guys are just as friendly!

The DFA

I'm having issues converting simple NFAs to DFAs… I just don't get it. Basically, with the one shown here, the most I've come up with is $s_0$ accepting inputs of $1$ from $s_1$ and $s_1$ accepting inputs of $0$ from $s_0$. Is that even remotely correct? FSM's are interesting… but bloody hell, the learning material is a bit difficult to chew.

For those that don't know the acronyms, I'm basically trying to find the deterministic finite-state automaton equivalent of the pictured non-deterministic finite-state machine.

Best Answer

To convert from a NFA to DFA you have to keep track of all the possible states the NFA might be in. So the set of states for your DFA will be $\lbrace \emptyset, s_0, s_1, s_2, s_0s_1, s_0s_2, s_1s_2, s_0s_1s_2 \rbrace$.

In the NFA, if you're in the start state $s_0$ and you read a $0$ then you transition to both $s_1$ and $s_2$. In the DFA this is done by transitioning from $s_0$ to $s_1s_2$. In the NFA, if you're at $s_2$ and read a $0$ or $1$ what happens? The input gets rejected. For the DFA this is accomplished by having a null state $\emptyset$ that does not transition to any other state, but instead has a self-loop for either $0$ or $1$.

You can check your DFA by figuring out what language this NFA accepts. It's any number of $1$'s followed by a $0$, and then any number of $0$'s, which as a regular expression is $1^*00^*$.

Related Question