Title: Non Deterministic Automata
1Non Deterministic Automata
2Nondeterministic Finite Accepter (NFA)
Alphabet
3Nondeterministic Finite Accepter (NFA)
Alphabet
Two choices
4Nondeterministic Finite Accepter (NFA)
Alphabet
Two choices
No transition
No transition
5First Choice
6First Choice
7First Choice
8First Choice
accept
9Second Choice
10Second Choice
11Second Choice
No transition the automaton hangs
12Second Choice
reject
13Observation
An NFA accepts a string if there is a computation
of the NFA that accepts the string
14Example
is accepted by the NFA
15Lambda Transitions
16(No Transcript)
17(No Transcript)
18(read head doesnt move)
19(No Transcript)
20accept
String is accepted
21Language accepted
22Another NFA Example
23(No Transcript)
24(No Transcript)
25(No Transcript)
26accept
27Another String
28(No Transcript)
29(No Transcript)
30(No Transcript)
31(No Transcript)
32(No Transcript)
33(No Transcript)
34accept
35Language accepted
36Another NFA Example
37Language accepted
38Formal Definition of NFAs
Set of states, i.e.
Input aplhabet, i.e.
Transition function
Initial state
Final states
39Transition Function
40(No Transcript)
41(No Transcript)
42(No Transcript)
43Extended Transition Function
44(No Transcript)
45(No Transcript)
46Formally
It holds
if and only if
there is a walk from to with label
47The Language of an NFA
48 49 50 51 52Formally
- The language accepted by NFA is
- where
- and there is some
(final state)
53 54Equivalence of NFAs and DFAs
55Equivalence of Machines
- For DFAs or NFAs
- Machine is equivalent to machine
- if
-
56Example
NFA
DFA
57- Since
- machines and are equivalent
NFA
DFA
58Equivalence of NFAs and DFAs
Question NFAs DFAs ?
Same power? Accept the same languages?
59Equivalence of NFAs and DFAs
Question NFAs DFAs ?
YES!
Same power? Accept the same languages?
60We will prove
Languages accepted by NFAs
Languages accepted by DFAs
61We will prove
Languages accepted by NFAs
Languages accepted by DFAs
NFAs and DFAs have the same computation power
62Step 1
Languages accepted by NFAs
Languages accepted by DFAs
63Step 1
Languages accepted by NFAs
Languages accepted by DFAs
Proof
Every DFA is also an NFA
64Step 1
Languages accepted by NFAs
Languages accepted by DFAs
Proof
Every DFA is also an NFA
A language accepted by a DFA is also accepted by
an NFA
65Step 2
Languages accepted by NFAs
Languages accepted by DFAs
66Step 2
Languages accepted by NFAs
Languages accepted by DFAs
Any NFA can be converted to an equivalent DFA
Proof
67Step 2
Languages accepted by NFAs
Languages accepted by DFAs
Any NFA can be converted to an equivalent DFA
Proof
A language accepted by an NFA is also accepted by
a DFA
68NFA to DFA
NFA
DFA
69NFA to DFA
NFA
DFA
70NFA to DFA
NFA
DFA
71NFA to DFA
NFA
DFA
72NFA to DFA
NFA
DFA
73NFA to DFA
NFA
DFA
74NFA to DFA
NFA
DFA
75NFA to DFA Remarks
- We are given an NFA
- We want to convert it
- to an equivalent DFA
- With
76- If the NFA has states
- the DFA has states in the powerset
-
77Procedure NFA to DFA
-
- 1. Initial state of NFA
-
- Initial state of DFA
78Example
NFA
DFA
79Procedure NFA to DFA
- 2. For every DFAs state
- Compute in the NFA
-
- Add transition
80Exampe
NFA
DFA
81Procedure NFA to DFA
- Repeat Step 2 for all letters in alphabet,
- until
- no more transitions can be added.
82Example
NFA
DFA
83Procedure NFA to DFA
- 3. For any DFA state
- If some is a final state in the NFA
- Then,
- is a final state in the DFA
-
84Example
NFA
DFA
85Theorem
Take NFA
Apply procedure to obtain DFA
Then and are equivalent
86Finally
We have proven
Languages accepted by NFAs
Languages accepted by DFAs
87We have proven
Languages accepted by NFAs
Languages accepted by DFAs
Regular Languages
88We have proven
Languages accepted by NFAs
Languages accepted by DFAs
Regular Languages
Regular Languages