CS103
HO#28
Finite Automata II
4/22/11
1
Note:
It is important to do the reading in the Sipser text.
You should try to understand it line by line.
Come to office hours
, write us with questions,
or talk to your classmates!
Suppose L = {w
{
a
,
b
}
*
| no two consecutive characters are the same}
q
1
a
b
b
a
a, b
q
2
q
3
q
4
a
b
last character a, only b OK
reject input
last character b, only a OK
Q = {q
1
, q
2
, q
3
, q
4
}
= {a, b}
q
1
is the start state
F = {q
1
, q
2
, q
3
}
a
b
q
1
q
2
q
3
q
2
q
4
q
3
q
3
q
2
q
4
q
4
q
4
q
4
Suppose L = {w | w = a
m
b
n
for m, n > 0}
q
1
b
a
q
2
q
4
q
3
a
a
b
b
a, b
Suppose L = {w | w is the string representation of a floating point number }
d
.
d
+, –
E
d
d
d
d
d
+,
–
d
E
+2.0
532.67
0.3E123
1.5006E+27
-0.4E-2
-6E8
d stands for any decimal digit
(transitions to non-accepting state for illegal inputs not shown)
Let
= {a, b, c, d}
Let L
Missing
= {w | there is a symbol from
not in w}
Start state: all letters missing
After one character, the state could be
a read, b, c, d still missing
b read, a, c, d still missing
c read, a, b, d still missing
d read, a, b, c still missing
After two characters, the state could be any of the previous, or
a, b read, c, d still missing
a, c read, b, d still missing
...
After three characters, ...
Some Important Definitions
Let M = (Q,
,
, q
0
, F) be a finite automaton and let w = w
1
, w
2
, ..., w
n
be
a string where each w
i
.
Then
m accepts w
if there exists a sequence of states r
0
, r
1
, ..., r
n
in Q
such that:
1.
r
0
= q
0
,
2.
(r
i
, w
i+1
) = r
i+1
for i = 0, 1, ..., n – 1, and
3.
r
n
F.
q
1
a
b
b
a
a, b
q
2
q
3
q
4
a
b
Q = {q
1
, q
2
, q
3
, q
4
}
= {a, b}
q
1
is the start state
: Q
Q
F = {q
1
, q
2
, q
3
}
a
b
q
1
q
2
q
3
q
2
q
4
q
3
q
3
q
2
q
4
q
4
q
4
q
4

This ** preview** has intentionally

**sections.**

*blurred***to view the full version.**

*Sign up*