355 HW 1 S 11 Sol
355 HW 1 S 11 Sol
b
a
b
a,b
5
(e) Using the method in Theorem 1.45 and your answers to the (a) and (c) parts, construct
a state diagram for an NFA M
3
to recognize the language over = {a, b} dened by
L
3
= L
1
L
2
.
Answer:
q8 q9 q10
a
a,b
b
q0
q1
q2 q3
q4 q5 q6
q7
a a
a
a
a
a a
b b
b
b
b
b b b
b
a
q0'
(f) Using the method of Theorem 1.47 and your answers to the (a) and (c) parts, construct
a state diagram for an NFA M
4
to recognize the language over = {a, b} dened by
L
4
= L
1
L
2
.
Answer:
q8 q9 q10
a
a,b
b
q0
q1
q2 q3
q4 q5 q6
a a
a
a
a
a a
b b
b
b
b
b b b
b
a
q7
6
(g) By whatever method you like, construct a state diagram for an NFA M
5
to recognize
the language over = {a, b} dened by L
5
= L
1
L
2
. Use as few states as you can!
Explain your method.
Answer:
Since for a string w to be in L
1
it must begin and end with the same letter, while
to be in L
2
it must begin with an a and end with a b, there are no strings that can be
in both L
1
and L
2
. Therefore, L
5
= L
1
L
2
= , whose state diagram is given below.
q0
(3) Sipser 1.15, page 85.
Answer:
The main dierence between the construction proposed in the problem and the one given
in Theorem 1.49 is that the construction in this problem does not create a new start state.
That is what we will use in the construction of a counterexample. Let N
1
be the machine
given by the following state diagram:
q1 q0
a
b
Then A
1
= {a
i
b : i 0}, in other words, 0 or more as followed by a single b. Note that
since everything in A
1
ends with a b, then everything in A
1
exept for also ends in a b. In
particular, the string a / A
1
. Following the construction given in the problem, we generate
the NFA N given by its state diagram:
q1
a
b
q0
It is clear from the state diagram that a is in the language recognized by N, L(N). Since
a L(N) but a / A
1
, L(N) = A
1
. Therefore N does not recognize A
1
.
7
(4) Sipser 1.16, page 86.
Answer:
(a)
{1,2}
a
b
{1}
{2}
b
a,b
a
a,b
(b) Only the states reachable from the start state are included in the state diagram.
a,b
a
{1,2}
b
b
a
{1,2,3}
a
b
{2,3}
(5) Sipser 1.24 and 1.25, page 87.
Answer:
1.24
a. 000
b. 111
c. 011
d. 0101
e. 1
f. 1111
g. 110110
h.
8
1.25
A nite state transducer (FST) is a 5-tuple (Q, , , q
0
, ), where
1. Q is a nite set called the states,
2. is a nite set called the input alphabet,
3. : Q Q is the transition function,
4. q
0
Q is the start state, and
5. is a nite set called the output alphabet.
A computation of an FST F = (Q, , , q
0
, ) on input w = w
1
w
2
. . . w
n
outputs
x = x
1
x
2
. . . x
n
= (Q, , , q
0
, Q \ F).
This problem asks us to show that B = L(M
). w
1
w
2
. . . w
n
= w B i there is a computation
consisting of states r
0
, r
1
, . . . , r
n
in Q such that r
0
= q
0
, (r
i
, w
i+1
) = r
i+1
for 0 i < n, but such
that r
n
/ F i r
n
Q\ F i r
0
, r
1
, . . . , r
n
is an accepting computation for M
i w L(M
).
This shows that B = L(M
). Since for every regular language there exists a nite automaton that
recognizes its complement (constructed by M
) =
), but
b / C. Therefore, L(M