Non Deterministic Automata Fall 2004 COMP 335
Nondeterministic Finite Accepter (NFA) Alphabet = Fall 2004 COMP 335
Nondeterministic Finite Accepter (NFA) Alphabet = Two choices Fall 2004 COMP 335
Nondeterministic Finite Accepter (NFA) Alphabet = Two choices No transition No transition Fall 2004 COMP 335
First Choice Fall 2004 COMP 335
First Choice Fall 2004 COMP 335
First Choice Fall 2004 COMP 335
First Choice All input is consumed “accept” Fall 2004 COMP 335
Second Choice Fall 2004 COMP 335
Second Choice Fall 2004 COMP 335
Second Choice No transition: the automaton hangs Fall 2004 COMP 335
Second Choice Input cannot be consumed “reject” Fall 2004 COMP 335
AND An NFA accepts a string w: if there is at least one computation of the NFA that accepts the string w AND all the input is consumed and the automaton is in a final state Fall 2004 COMP 335
Example is accepted by the NFA: “accept” “reject” because this computation accepts Fall 2004 COMP 335
Rejection example Fall 2004 COMP 335
First Choice Fall 2004 COMP 335
First Choice “reject” Fall 2004 COMP 335
Second Choice Fall 2004 COMP 335
Second Choice Fall 2004 COMP 335
Second Choice “reject” Fall 2004 COMP 335
OR An NFA rejects a string w: if there is no computation of the NFA that accepts the string w: All the input is consumed and the automaton is in a non final state OR The input cannot be consumed Fall 2004 COMP 335
Example is rejected by the NFA: “reject” “reject” All possible computations lead to rejection Fall 2004 COMP 335
Rejection example Fall 2004 COMP 335
First Choice Fall 2004 COMP 335
First Choice No transition: the automaton hangs Fall 2004 COMP 335
First Choice Input cannot be consumed “reject” Fall 2004 COMP 335
Second Choice Fall 2004 COMP 335
Second Choice Fall 2004 COMP 335
Second Choice No transition: the automaton hangs Fall 2004 COMP 335
Second Choice Input cannot be consumed “reject” Fall 2004 COMP 335
All possible computations lead to rejection is rejected by the NFA: “reject” “reject” All possible computations lead to rejection Fall 2004 COMP 335
Language accepted: Fall 2004 COMP 335
Lambda Transitions Fall 2004 COMP 335
Fall 2004 COMP 335
Fall 2004 COMP 335
(read head does not move) Fall 2004 COMP 335
Fall 2004 COMP 335
all input is consumed “accept” String is accepted Fall 2004 COMP 335
Rejection Example Fall 2004 COMP 335
Fall 2004 COMP 335
(read head doesn’t move) Fall 2004 COMP 335
No transition: the automaton hangs Fall 2004 COMP 335
Input cannot be consumed “reject” String is rejected Fall 2004 COMP 335
Language accepted: Fall 2004 COMP 335
Another NFA Example Fall 2004 COMP 335
Fall 2004 COMP 335
Fall 2004 COMP 335
Fall 2004 COMP 335
“accept” Fall 2004 COMP 335
Another String Fall 2004 COMP 335
Fall 2004 COMP 335
Fall 2004 COMP 335
Fall 2004 COMP 335
Fall 2004 COMP 335
Fall 2004 COMP 335
Fall 2004 COMP 335
“accept” Fall 2004 COMP 335
Language accepted Fall 2004 COMP 335