NFA Class 1 PDF
NFA Class 1 PDF
NFA Class 1 PDF
Disadvantages of DFA
●
Constructing a DFA is difficult
●
DFA cannot guess about its input
●
DFA is not very powerful
●
DFA does not have the power to be in
serveral states at once
2
Non-deterministic Finite Automata
(NFA)
A Non-deterministic Finite Automaton (NFA)
is of course “non-deterministic”
Implying that the machine can exist in more than one
state at the same time
Transitions could be non-deterministic
1 qj
qi …
Each transition function therefore
maps to a set of states
1
qk
3
Non-deterministic Finite Automata
(NFA)
A Non-deterministic Finite Automaton (NFA)
consists of:
Q ==> a finite set of states
∑ ==> a finite set of input symbols (alphabet)
q0 ==> a start state
F ==> set of accepting states
δ ==> a transition function, which is a mapping between
Q x ∑ ==> subset of Q
An NFA is also defined by the 5-tuple:
{Q, ∑ , q0,F, δ }
4
Conversion of NFA to DFA
1)Subset Construction
2)Lazy Evaluation
NFA Transition Table DFA Transition Table
δ a b δ a b
-> q0 {q0, q1} q0 ->q0 {q0, q1} q0
q1 - q2 {q0, q1} {q0, q1} {q0, q2}
*q2 - - *{q0, q2} {q0, q1} q0
δ a b
->A B A
B B C
*C B A
a b a b
->q0 {q0, q1} q0 ->q0 {q0, q1} q0
q1 - q2 {q0, q1} {q0, q1} {q0, q2}