Professional Documents
Culture Documents
CST - HW2
CST - HW2
1a What is L1 L2 ? Provide two strings in this language and two strings not
in this language.
qw 0 qx 0 qy 0 qz
start
1 1 1 1,0
qa 1 qb 1 qc
start
0 0 1,0
DFA accepting L1 \L3 , where L1 \L3 = {w | w has at most two 0s and at least two 1s}
1 1
start {w, a} {w, b} {w, c} 1
0 0 0
1 1
{x, a} {x, b} {x, c} 1
0 0 0
1 1
{y, a} {y, b} {y, c} 1
0 0 0
1 1
{z, a} {z, b} {z, c} 1
0 0 0
1
Jeremy Corren [jdc2189] COMS W3261: HW2 2/4/2017
Suppose " 2 L2 . Then, for all a such that a 2 L1 , L1 L2 will include ev-
ery a ". Note that for any string w, w " = w. Then, for all a, it follows
that a 2 L1 L2 . Since all elements belonging to L1 also belong to L1 L2 ,
L1 L1 L2 .
Now consider the union of all Li for i = 0, 1, 2, ... Let us attempt to construct
an NFA for which the union L0 [ L1 [ ... is accepted, in order to show that L
is regular. We begin by creating a new start state q0 and drawing "-transitions
from q0 to each of the initial states for all Li . However, since i goes from
0...1, there are necessarily
S1 infinitely many states needed to process L, since,
by definition, L = i=0 Li . Since we cannot create an NFA with an infinite
number of states, there exists no NFA that accepts L. Therefore, L cannot be
regular.
2
Jeremy Corren [jdc2189] COMS W3261: HW2 2/4/2017
Q0 = {Q [ qv [ qw [ qx [ qy [ qz }
qv is the new start state.
F 0 = {qz }
Define 0 so that for any q 2 Q0 and any a 2 " ,
8
>
> {qw } q = qv and a = a
>
>
>
> {q1 } q = qw and a = b
>
>
>
>
< (q, a)
> q 2 Q and q 2 F
0
(q, a) = (q, a) q 2 F and a 6= "
>
>
>
> (q, a) [ {qx } q 2 F and a = "
>
>
>
>
>
> {qy } q = qx and a = b
>
:
{qz } q = qy and a = b
If B reads a and then b, the computation passes from the new start state qv
through qw to arrive at q1 , the former start state of A. If the string x 2 L, the
computation will reach at least one state q 2 F , where F is the set of former
accepting states in A. B will take "-transitions from any of these states to qx . If
B reads b and then a, the computation passes from qx through qy to the single
accept state in F 0 , qz .
Since we have defined the NFA B that accepts wrap(L), then wrap(L) must be
regular.