Costas Busch - LSU1 Non-Deterministic Finite Automata
Costas Busch - LSU2 Alphabet = Nondeterministic Finite Automaton (NFA)
Costas Busch - LSU3 No transition Two choices No transition Alphabet =
Costas Busch - LSU4 First Choice
Costas Busch - LSU5 First Choice
Costas Busch - LSU6 “accept” First Choice All input is consumed
Costas Busch - LSU7 Second Choice
Costas Busch - LSU8 Second Choice “reject” Input cannot be consumed Automaton Halts
Costas Busch - LSU9 An NFA accepts a string: if there is a computation of the NFA that accepts the string i.e., all the input string is processed and the automaton is in an accepting state
Costas Busch - LSU10 is accepted by the NFA: “accept” “reject” because this computation accepts this computation is ignored
Costas Busch - LSU11 Rejection example
Costas Busch - LSU12 First Choice “reject”
Costas Busch - LSU13 Second Choice
Costas Busch - LSU14 Second Choice “reject”
Costas Busch - LSU15 Another Rejection example
Costas Busch - LSU16 First Choice
Costas Busch - LSU17 “reject” First Choice Input cannot be consumed Automaton halts
Costas Busch - LSU18 Second Choice
Costas Busch - LSU19 Second Choice “reject” Input cannot be consumed Automaton halts
Costas Busch - LSU20 An NFA rejects a string: if there is no computation of the NFA that accepts the string. All the input is consumed and the automaton is in a non accepting state The input cannot be consumed OR For each computation:
Costas Busch - LSU21 is rejected by the NFA: “reject” All possible computations lead to rejection
Costas Busch - LSU22 is rejected by the NFA: “reject” All possible computations lead to rejection
Costas Busch - LSU23 Language accepted:
Costas Busch - LSU24 Lambda Transitions
Costas Busch - LSU25
Costas Busch - LSU26
Costas Busch - LSU27 input tape head does not move Automaton changes state
Costas Busch - LSU28 “accept” String is accepted all input is consumed
Costas Busch - LSU29 Rejection Example
Costas Busch - LSU30
Costas Busch - LSU31 (read head doesn’t move)
Costas Busch - LSU32 “reject” String is rejected Input cannot be consumed Automaton halts
Costas Busch - LSU33 Language accepted:
Costas Busch - LSU34 Another NFA Example
Costas Busch - LSU35
Costas Busch - LSU36
Costas Busch - LSU37 “accept”
Costas Busch - LSU38 Another String
Costas Busch - LSU39
Costas Busch - LSU40
Costas Busch - LSU41
Costas Busch - LSU42
Costas Busch - LSU43
Costas Busch - LSU44 “accept”
Costas Busch - LSU45 Language accepted
Costas Busch - LSU46 Another NFA Example
Costas Busch - LSU47 Language accepted (redundant state)
Costas Busch - LSU48 Remarks: The symbol never appears on the input tape Simple automata:
Costas Busch - LSU49 NFADFA NFAs are interesting because we can express languages easier than DFAs
Costas Busch - LSU50 Formal Definition of NFAs Set of states, i.e. Input aplhabet, i.e. Transition function Initial state Accepting states
Costas Busch - LSU51 Transition Function resulting states with following one transition with symbol
Costas Busch - LSU52 States reachable from scanning
Costas Busch - LSU53 States reachable from scanning
Costas Busch - LSU54 States reachable from scanning nothing
Costas Busch - LSU55 States reachable from scanning
Costas Busch - LSU56 Extended Transition Function Same with but applied on strings
Costas Busch - LSU57 States reachable from scanning
Costas Busch - LSU58 States reachable from scanning
Costas Busch - LSU59 Special case: for any state
Costas Busch - LSU60 : there is a walk from to with label In general
Costas Busch - LSU61 The Language of an NFA The language accepted by is: Where for each and there is some (accepting state)
Costas Busch - LSU62
Costas Busch - LSU63
Costas Busch - LSU64
Costas Busch - LSU65
Costas Busch - LSU66
Costas Busch - LSU67
Costas Busch - LSU68 NFAs accept the Regular Languages
Costas Busch - LSU69 Equivalence of Machines Definition: Machine is equivalent to machine if
Costas Busch - LSU70 NFA DFA Example of equivalent machines
Costas Busch - LSU71 Theorem: Languages accepted by NFAs Regular Languages NFAs and DFAs have the same computation power, namely, they accept the same set of languages Languages accepted by DFAs
Costas Busch - LSU72 Languages accepted by NFAs Regular Languages accepted by NFAs Regular Languages we need to show Proof: AND
Costas Busch - LSU73 Languages accepted by NFAs Regular Languages Proof-Step 1 Every DFA is trivially a NFA Any language accepted by a DFA is also accepted by a NFA
Costas Busch - LSU74 Languages accepted by NFAs Regular Languages Proof-Step 2 Any NFA can be converted to an equivalent DFA Any language accepted by a NFA is also accepted by a DFA
Costas Busch - LSU75 Conversion of NFA to DFA NFA DFA
Costas Busch - LSU76 NFA DFA
Costas Busch - LSU77 NFA DFA empty set trap state
Costas Busch - LSU78 NFA DFA union
Costas Busch - LSU79 NFA DFA union
Costas Busch - LSU80 NFA DFA trap state
Costas Busch - LSU81 NFA DFA END OF CONSTRUCTION
Costas Busch - LSU82 General Conversion Procedure Input: an NFA Output: an equivalent DFA with
Costas Busch - LSU83 The NFA has states The DFA has states from the power set
Costas Busch - LSU84 1. Initial state of NFA: Initial state of DFA: Conversion Procedure Steps step
Costas Busch - LSU85 NFA DFA Example
Costas Busch - LSU86 2. For every DFA’s state compute in the NFA add transition to DFA Union step
Costas Busch - LSU87 NFA DFA Example
Costas Busch - LSU88 3. Repeat Step 2 for every state in DFA and symbols in alphabet until no more states can be added in the DFA step
Costas Busch - LSU89 NFA DFA Example
Costas Busch - LSU90 4. For any DFA state if some is accepting state in NFA Then, is accepting state in DFA step
Costas Busch - LSU91 NFA DFA Example
Costas Busch - LSU92 If we convert NFA to DFA then the two automata are equivalent: Lemma: Proof: AND We need to show:
Costas Busch - LSU93 First we show: We only need to prove:
Costas Busch - LSU94 symbols Consider NFA
Costas Busch - LSU95 denotes a possible sub-path like symbol
Costas Busch - LSU96 We will show that if then NFA DFA state label state label
Costas Busch - LSU97 More generally, we will show that if in : (arbitrary string) then NFA DFA
Costas Busch - LSU98 Proof by induction on Induction Basis: is true by construction of NFA DFA
Costas Busch - LSU99 Induction hypothesis: NFA DFA Suppose that the following hold
Costas Busch - LSU100 Induction Step: NFA DFA Then this is true by construction of
Costas Busch - LSU101 Therefore if NFA DFA then
Costas Busch - LSU102 We have shown: With a similar proof we can show: END OF PROOF Therefore: