Professional Documents
Culture Documents
Computation
Lecture 1
Finite Automat I
Lecture 1 - Outline
A first look at an application.
Examples of Deterministic Finite Automaton (DFA).
Other kinds of automata: finite state transducers,
automata with garbage collectors, automata with no
reaction on inputs.
Non-deterministic finite automata (NFA).
Non-deterministic finite automata with e-transition.
11/24/2015
11/24/2015
11/24/2015
Front Pad
Rear Pad
door
11/24/2015
Front Pad
Rear Pad
door
Front
CLOSED
Front, Rear,
Both
OPEN
Neither
11/24/2015
Front Pad
Rear Pad
door
Front
Rear
CLOSED
CLOSED
OPEN
CLOSED CLOSED
OPEN
CLOSED
OPEN
OPEN
11/24/2015
Both
OPEN
7
11/24/2015
11/25/2015
TCS3511
10
M1 = (Q, S, d, po, F)
with Q = {q1, q2, q3}
S = {0,1}
d: Q x S Q
p0 = q1
F = {q2}
If A is the set of all strings that machine M accepts, we say that A is the
language of machine M and write L(M) = A. We say that M recognizes or
11/25/2015 A.
TCS3511
11
accepts
M2 = (Q, S, d, po, F)
with
Q = {q1, q2}
S = {0,1}
d: Q x S Q
p0 = q1
F = {q2}
d is described as
L = {w | w ends with a 1}
M3 = (Q, S, d, po, F)
with
Q = {q1, q2}
S = {0,1}
d: Q x S Q
p0 = q1
F = {q1}
d is described as
13
M4 = (Q, S, d, po, F)
with
Q = {q,q0,q1,q2}
S = {0,1}
d: Q x S Q
p0 = q
F = {q2}
d
q
q0
q1
q2
0
q0
q1
q1
q2
1
q
q
q2
q2
M5 = (Q, S, d, po, F)
with
Q = {s,q1,q2,r1,r2}
S = {a,b}
d: Q x S Q
p0 = s
F = {q1,r1}
d
s
q1
q2
r1
r2
a
q1
q1
q1
r2
r2
b
r1
q2
q2
r1
r1
15
M6 = (Q, S, d, po, F)
with
Q = {q0,q1,q2}
S = {0,1,2}
d: Q x S Q
p0 = q 0
F = {q0}
17
q1
q2
0,1
q3
0
q1
0
q2
1
1
q3
20
Every state of a DFA always has exactly one exiting transition arrow for
each symbol in the alphabet. The NFA shown in Figure above violates that
rule. Ex: State q1 has one exiting arrow for 0, but it has two for 1. q2 has
one arrow for 0, but it has none for 1. In an NFA, a state may have zero,
21
one, or many exiting arrows for each alphabet symbol.
A = (Q, S, d, po, F)
with
Q = {q1,q2,q3,q4}
S = {0,1}
d: Q x S Pow(Q)
p0 = q1
F = {q4}
d
q1
q2
q3
q4
0
{q1}
{q3}
{q4}
1
{q1,q2}
{q3}
{q4}
e.g., 000100
22
A = (Q, S, d, po, F)
with
Q = {q1,q2}
S = {0,1}
d: Q x S Pow(Q)
p0 = q1
F = {q2}
d
q1
0
1
{q1,q2} {q2}
q2
{q1,q2}
24
e- transitions.
Multiple next state. in a DFA there is exactly one start state and exactly
one transition out of every state for each symbol in . In contrast to a DFA,
the next state is not necessarily uniquely determined by the current state and
input symbol in case of an NFA. In an NFA, a state may have zero, one, or
many (including e- transitions) exiting arrows for each alphabet symbol.
e- transitions. In an e-transition, the state of the automata can be changed
and go to next state without consuming the next input. d(q, e) = {q1,q2.qk}
implying that with e-transition the next state could by any one of
{q1,q2.qk}
25
Why an NFA?
Every NFA can be converted into an equivalent DFA; but sometimes that
DFA may have many more states.
Furthermore, understanding the functioning of the NFA is much easier, as
you may see by examining the following figure for the DFA.
NFA and DFA that recognize the language A
A = {w | w contains a 1 in the third position from the end}
Two machines
are equivalent if
they recognize
the same
language
Learning Outcomes
You should be able to:
Give a DFA/NFA for a given (Regular) language.
Explain the differences between a DFA and NFA.
Understand and describe the different kinds of
automata.
Next lecture: Are NFAs more powerful than DFAs???
28