Theory of Computation Nondeterminism & Nondeterministic Finite Automata (NFA), Epsilon Closure, NFA with & w/o Epsilon Transitions, NFA vs. DFA, Subset Construction Vladimir Kulyukin Department of Computer Science Utah State University http://www.vkedco.blogspot.com/
37
Embed
Theory of Computation: Nondeterminism & Nondeterministic Finite Automata (NFA); Epsilon Closure; NFA with & w/o Epsilon Transitions; NFA vs. DFA, Subset Construction
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
If the NFA is in q0 and reads 0, it returns back to
q0. So, on 0, the DFA moves from {q0} back to
{q0}:
{q0} 0
State q0; Input 1
If the NFA is in q0 and reads 1, it goes to q0 or
q1, i.e., {q0, q1}. So, on 1, the DFA moves from
{q0} to {q0, q1}:
{q0} 0 {q0, q1} 1
State {q0, q1}; Input 0
Suppose that the NFA is in one of {q0, q1} and reads 0. If it is in q0, it goes to q0. If it is in q1, it goes to q2. So, on 0, the DFA goes from {q0, q1} to {q0, q2}:
Suppose that the NFA is in one of {q0, q1} and reads 1. If it is in q0, it goes to q0 or q1, i.e., {q0, q1}. If it is in q1, it goes to q2. So, on 1, the DFA goes from {q0, q1} to {q0, q1, q2}:
{q0} 0 {q0, q1} 1
{q0, q2} 0 {q0, q1, q2}
1
State {q0, q2}; Input 0
Suppose that the NFA is in one of {q0, q2} and reads 0. If it is in q0, it goes to q0. If it is in q2, it goes nowhere. So, on 0, the DFA from {q0, q2} goes to {q0}:
{q0} 0 {q0, q1} 1
{q0, q2} 0 {q0, q1, q2}
1 0
State {q0, q2}; Input 1
Suppose that the NFA is in one of {q0, q2} and reads 1. If it is in q0, it goes to q0 or q1, i.e., {q0, q1}. If it is in q2, it goes nowhere. So, on 1, the DFA goes from {q0, q2} to {q0, q1}:
{q0} 0 {q0, q1} 1
{q0, q2} 0 {q0, q1, q2}
1 0
1
State {q0, q1, q2}; Input 0
Suppose that the NFA is in one of {q0, q1, q2} and reads 0. If it is in q0, it will go to q0. If it is in q1, it will go to q2. If it is in q2, it will go nowhere. So, on 0, the DFA goes from {q0, q1, q2} to {q0, q2}:
{q0} 0 {q0, q1} 1
{q0, q2}
0
{q0, q1, q2}
1 0
1
0
State {q0, q1, q2}; Input 1 Suppose that the NFA is in one of {q0, q1, q2} and reads 1. If it is in q0, it will go to q0 or q1, i.e., {q0, q1}. If it is in q1, it goes to q2. If it is in q2, it goes nowhere. So, on 1, the DFA goes from {q0, q1, q2} back to {q0, q1, q2}:
{q0} 0 {q0, q1} 1
{q0, q2}
0
{q0, q1, q2}
1 0
1
0 1
DFA’s Final States
What are the final states in the new DFA? Any subset that has a non-empty intersection with the NFA’s set of final states. So, the DFA has two final states: {q0, q2} and {q0, q1, q2}.