Non Deterministic Automata - PowerPoint PPT Presentation

About This Presentation
Title:

Non Deterministic Automata

Description:

Title: Languages and Finite Automata Author: Costas Busch Last modified by: Student Created Date: 8/31/2000 1:12:33 AM Document presentation format – PowerPoint PPT presentation

Number of Views:93
Avg rating:3.0/5.0
Slides: 89
Provided by: Costas1
Learn more at: http://www.cs.rpi.edu
Category:

less

Transcript and Presenter's Notes

Title: Non Deterministic Automata


1
Non Deterministic Automata
2
Nondeterministic Finite Accepter (NFA)
Alphabet
3
Nondeterministic Finite Accepter (NFA)
Alphabet
Two choices
4
Nondeterministic Finite Accepter (NFA)
Alphabet
Two choices
No transition
No transition
5
First Choice
6
First Choice
7
First Choice
8
First Choice
accept
9
Second Choice
10
Second Choice
11
Second Choice
No transition the automaton hangs
12
Second Choice
reject
13
Observation
An NFA accepts a string if there is a computation
of the NFA that accepts the string
14
Example
is accepted by the NFA
15
Lambda Transitions
16
(No Transcript)
17
(No Transcript)
18
(read head doesnt move)
19
(No Transcript)
20
accept
String is accepted
21
Language accepted
22
Another NFA Example
23
(No Transcript)
24
(No Transcript)
25
(No Transcript)
26
accept
27
Another String
28
(No Transcript)
29
(No Transcript)
30
(No Transcript)
31
(No Transcript)
32
(No Transcript)
33
(No Transcript)
34
accept
35
Language accepted
36
Another NFA Example
37
Language accepted
38
Formal Definition of NFAs

Set of states, i.e.
Input aplhabet, i.e.
Transition function
Initial state
Final states
39
Transition Function
40
(No Transcript)
41
(No Transcript)
42
(No Transcript)
43
Extended Transition Function

44
(No Transcript)
45
(No Transcript)
46
Formally
It holds
if and only if
there is a walk from to with label
47
The Language of an NFA

48

49

50

51

52
Formally
  • The language accepted by NFA is
  • where
  • and there is some

(final state)
53

54
Equivalence of NFAs and DFAs

55
Equivalence of Machines
  • For DFAs or NFAs
  • Machine is equivalent to machine
  • if

56
Example
NFA

DFA
57
  • Since
  • machines and are equivalent

NFA
DFA
58
Equivalence of NFAs and DFAs
Question NFAs DFAs ?
Same power? Accept the same languages?
59
Equivalence of NFAs and DFAs
Question NFAs DFAs ?
YES!
Same power? Accept the same languages?
60
We will prove
Languages accepted by NFAs
Languages accepted by DFAs
61
We will prove
Languages accepted by NFAs
Languages accepted by DFAs
NFAs and DFAs have the same computation power
62
Step 1
Languages accepted by NFAs
Languages accepted by DFAs
63
Step 1
Languages accepted by NFAs
Languages accepted by DFAs
Proof
Every DFA is also an NFA
64
Step 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
65
Step 2
Languages accepted by NFAs
Languages accepted by DFAs
66
Step 2
Languages accepted by NFAs
Languages accepted by DFAs
Any NFA can be converted to an equivalent DFA
Proof
67
Step 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
68
NFA to DFA

NFA
DFA
69
NFA to DFA

NFA
DFA
70
NFA to DFA

NFA
DFA
71
NFA to DFA

NFA
DFA
72
NFA to DFA

NFA
DFA
73
NFA to DFA

NFA
DFA
74
NFA to DFA

NFA
DFA
75
NFA 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

77
Procedure NFA to DFA
  • 1. Initial state of NFA
  • Initial state of DFA

78
Example

NFA
DFA
79
Procedure NFA to DFA
  • 2. For every DFAs state
  • Compute in the NFA
  • Add transition

80
Exampe

NFA
DFA
81
Procedure NFA to DFA
  • Repeat Step 2 for all letters in alphabet,
  • until
  • no more transitions can be added.

82
Example

NFA
DFA
83
Procedure 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

84
Example

NFA
DFA
85
Theorem
Take NFA

Apply procedure to obtain DFA
Then and are equivalent

86
Finally
We have proven
Languages accepted by NFAs
Languages accepted by DFAs
87
We have proven
Languages accepted by NFAs
Languages accepted by DFAs
Regular Languages
88
We have proven
Languages accepted by NFAs
Languages accepted by DFAs
Regular Languages
Regular Languages
Write a Comment
User Comments (0)
About PowerShow.com