Professional Documents
Culture Documents
Non-Deterministic Finite Automata (Continued) : Lecture Notes by Dr. K S Sudeep
Non-Deterministic Finite Automata (Continued) : Lecture Notes by Dr. K S Sudeep
Theorem (previous class): For any NFA (non-deterministic finite automaton) N, there is an equivalent
DFA that recognizes the same language. (Or, every language recognized by an NFA can be recognized
by a DFA also.)
Proof:
Set of states QD = Set of all subsets of QN, also called power set of QN. It has 2n states if N has
n states. (Later we can remove all states that are not reachable from the initial state).
Input alphabet Ʃ remains same. New set of accepting states FD corresponds to all subsets S of
QN such that S has at least one accepting state of N. Or we can say all subsets S such that S Ո
FN ≠ Ø.
[In other words, accepting states of D correspond to subsets that contain at least one
accepting state of N.
For example: If states of N are q0, q1, q2; and set of accepting states of N are {q1, q2},
Then {q1}, {q2}, {q1, q2}, {q0, q1}, {q0, q2}, {q0, q1, q2 } are all accepting states of the DFA
D that corresponds to this NFA.]
𝛿 D (S, a) = Սq in S 𝛿 N(q,a)
For example, 𝛿 D({q1, q2}, 0) = 𝛿 N (q1, 0) U 𝛿 N (q2,0).
In the first conversion example we did in the previous class,
𝛿 (q01, 0) = 𝛿 N (q0, 0) U 𝛿 N (q1, 0) = {q0} U {} = {q0}
𝛿 (q01, 1) = 𝛿 N (q0, 1) U 𝛿 N (q1, 1) = {q0, q1} U {} = {q0, q1}.
2. If N says No on w, D also says No. (In other words, if a string w is accepted by D, it is accepted
by NFA N also).
Proof: If a sting w gets Yes answer on D, i.e., it ends in an accepting state S of D, it means on
N, it can be in any of the states of this subset S.
But since S is an accepting state of D, it means that at least one of the states of S is an accepting
state of N (that is how we defined accepting states on D).
This means at least one branch goes to an accepting state at the end of w on N.
So is accepted by N also. This completes the proof. (If N says no, D cannot say Yes).
Here, epsilon (ε) means no symbol. An epsilon move, or an arrow with ε marked on it, means the
NFA can make that move even without looking at the next symbol.
Can you give me one string that is NOT accepted by this NFA (with epsilon moves).
If string was 111, does this NFA accept? The answer is No. Verify yourself.
We can always convert such an NFA with epsilon-moves to a normal NFA without ε-moves. For
example, in this one, on q0 if we see a 0, we can add an arrow to q1 also. On q0 on seeing a 1 also, we
can add an arrow to q1. We will complete the conversion in the next class.