NFA - NFA - DFA Equivalence
NFA - NFA - DFA Equivalence
What is an NFA
An NFA is an automaton that its states might have none, one or more outgoing arrows under a specific symbol.
1
q0
0,1
q1
From q0 with 1 we can be either in q0 or q1. No outgoing arrows under 0 or 1 from q1.
What is an NFA
An NFA is an automaton that its states might have none, one or more outgoing arrows under a specific symbol.
1
q0
0,1
q1
A DFA is by definition an NFA (each state has exactly one outgoing arrow under each symbol).
What is an NFA
An NFA is an NFA that might have -moves. In an -move we can transport from one state to the other without having any symbols.
1
q0
q1
q2
What is an NFA
An NFA is an NFA that might have -moves. In an -move we can transport from one state to the other without having any symbols.
1
q0
q1
q2
Example
1
q0 0 0,1 q1
This automaton accepts the string 1110 because there is a path under 1110 that takes us to an accepting state (the path q0 1 q0 1 q0 1 q0 0 q1).
Example
1
q0 0 0,1 q1
This automaton accepts the string 1110 because there is a path under 1110 that takes us to an accepting state (the path q0 1 q0 1 q0 1 q0 0 q1).
Example
1
q0 0 0,1 q1
This automaton accepts the string 1110 because there is a path under 1110 that takes us to an accepting state (the path q0 1 q0 1 q0 1 q0 0 q1).
Example
1
q0 0 0,1 q1
This automaton accepts the string 1110 because there is a path under 1110 that takes us to an accepting state (the path q0 1 q0 1 q0 1 q0 0 q1).
Example
1
q0 0 0,1 q1
This automaton accepts the string 1110 because there is a path under 1110 that takes us to an accepting state (the path q0 1 q0 1 q0 1 q0 0 q1).
Example
1
q0 0 0,1 q1
And that is so despite the fact that there are some other paths under 1110 which do not lead to an accepting state (for example the path q0 1 q0 1 q0).
Example
1
q0 0 0,1 q1
And that is so despite the fact that there are some other paths under 1110 which do not lead to an accepting state (for example the path q0 1 q0 1 q0).
Example
1
q0 0 0, 1 q1
And that is so despite the fact that there are some other paths under 1110 which do not lead to an accepting state (for example the path q0 1 q0 1 q0).
Example
1
q0 0 0,1 q1
However it doesnt accept the string 00 because there are no paths under 00 to take us to q1. (only possible path is q0 0 q1 0 q0).
Example
1
q0 0 0,1 q1
However it doesnt accept the string 00 because there are no paths under 00 to take us to q1. (only possible path is q0 0 q1 0 q0).
Example
1
q0 0 0,1 q1
However it doesnt accept the string 00 because there are no paths under 00 to take us to q1. (only possible path is q0 0 q1 0 q0).
NFA acceptance
Whenever an arrow is followed, there is a set of possible following states that the NFA can be. This set of states is a subset of Q. For example with input being 0010 I have the following sequence of sets of states:
0 0 1 0 q0 {q1 } {q 0 , q 2 } {q 0 , q1 } {q 0 , q1 , q 2 }
1
q0
0,1
q1
q2
q0
q1
q2
q3
a q a
q q
NFA DFA
Suppose that you want to find an equivalent DFA for an NFA . The algorithm is the following: Starting from the start state and for each symbol in the alphabet, find the subset of states that can be reached after following this symbol and create a new state for each subset.
NFA DFA
Suppose that you want to find an equivalent DFA for an NFA . The algorithm is the following: Repeat the same process for every new subset-state that you are creating
NFA DFA
Suppose that you want to find an equivalent DFA for an NFA . The algorithm is the following: Repeat the same process for every new subset-state that you are creating until no new subset-state can be created.
{q0, q1}
0 {q0, q1}
0,1
q1
q2
{q0, q1}
0 {q0, q1}
0
1 0 q02 0 1 q01 1 0
q0
q1
{q0, q1}
0 {q0, q1}
1
1
{q0, q1}
0 {q0, q1}
0
1 q012 0
q3
q4 q5
q3
q1
0 1
q4
q5
0
1
q2
q1
q2
q4
q1
q2 0
q4
Example
0, q1 1, q2 0
1 q0
q3 1 q4
Example
0, q1 1, q2 0
1 q0
q3 1 q4
Example
0, q1 1, q2 0
1 q0
q3 1 q4
Example
0, 1 q0 q1 1 q2 0 0 0, q3 1 q4
Example
0, 1 q0 q1 1 q2 0 0 0, q3 1 q4
Example
0 1 q0 q1 1 q2 0 0,1 0, q3 1 q4
Example
0 1 q0 q1 1 q2 0 0,1 0, q3 1 q4
Example
0 1 q0 q1 1 q2 0 q3 1 q4 0,1
Example
0 1 q0 q1 1 q2 0 q3 1 q4 0,1