L=
{
w

w=xb, where x=0
*
1
*
0
*
and b=a
}
(c) Suppose that instead the levers switched before allowing the marble to
pass. How would you answers to parts(a) and (b) change.?
Since the string r and a mean previous state, when the levers switched before
allowing the marble to pass, we will have same symbol with opposite state
for last symbol. That is r change to a, and a change to r.
Exercise 2.2.2
Show that in fact,
ˆ
δ
(
q, xy
) =
ˆ
δ
(
ˆ
δ
(
q, x
)
, y
)
we start from y=
ε
,
when y=
ε
, we have
ˆ
δ
(
q, x
) =
p
, and
ˆ
δ
(
ˆ
δ
(
q, x
)
, ε
) =
ˆ
δ
(
p, ε
) =
p
, there for we
have
ˆ
δ
(
q, x
) =
ˆ
δ
(
ˆ
δ
(
q, x
)
, y
)
For y
6
=
ε
, that is letting
y
=
za
.
ˆ
δ
(
ˆ
δ
(
q, x
)
, za
) =
δ
(
ˆ
δ
(
ˆ
δ
(
q, x
)
, z
)
, a
)
⇒
δ
(
ˆ
δ
(
q, xz
)
.a
) =
δ
(
q, xza
) =
ˆ
δ
(
q, xy
)
Exercise 2.2.3
Show that for any state q, string x, and input symbol a,
ˆ
δ
(
q, ax
) =
ˆ
δ
(
δ
(
q, a
)
, x
)
For a=
ε
, we have
ˆ
δ
(
q, x
) =
ˆ
δ
(
δ
(
q, a
)
, x
) by
δ
(
q, a
) =
q
For a
6
=
ε
,
ˆ
δ
(
q, ax
) =
δ
(
ˆ
δ
(
q, a
)
, x
) by considering
ˆ
δ
(
q, a
) is a state
From Exercise 2.2.2 we have
δ
(
ˆ
δ
(
q, a
)
, x
) =
ˆ
δ
(
q, ax
) (Also see Example 2.4)
Exercise 2.2.4
Gives DFA’s accepting the following languages over the alphabet
{
0
,
1
}
:
(a) The set of all strings ending in 00.
ANS: (1 + 0)
*
00
(b)The set of all strings with three consecutive.
ANS: (1 + 0)
*
(000)
*
(1 + 0)
*
2