MATH 239 ASSIGNMENT 4
Sample Solutions
1.
12 marks
For each of the following sets, write down a decomposition that uniquely creates the elements
of that set.
(a) The
{
0
,
1
}
strings that have no substring of 1s with length 3, and no substrings of 0s of
length 2.
Solution:
Since we want to modify both the allowed lengths of strings of 1 and strings
of 0s, let us start with the block decomposition
{
0
}
*
(
{
1
}{
1
}
*
{
0
}{
0
}
*
)
*
{
1
}
*
=
{
²,
0
,
00
, . . .
}
(
{
1
,
11
,
111
, . . .
}{
0
,
00
,
000
, . . . ,
}
)
*
{
²,
1
,
11
,
111
, . . .
}
and remove all strings of 1s of length 3 or more, and remove all strings of 0s of length 2
or more.
This leaves us with
{
²,
0
}
(
{
1
,
11
}{
0
}
)
*
{
²,
1
,
11
}
.
One could also have started with the other block decomposition and arrived at
{
²,
1
,
11
}
(
{
0
}{
1
,
11
}
)
*
{
²,
0
}
.
(b) The
{
0
,
1
}
strings that have no blocks of 0s of size 2, and no blocks of 1s of size 3.
Solution:
Since we want to modify both the allowed lengths of blocks of 1 and blocks of 0s, let us
start with the block decomposition
{
0
}
*
(
{
1
}{
1
}
*
{
0
}{
0
}
*
)
*
{
1
}
*
=
{
²,
0
,
00
, . . .
}
(
{
1
,
11
,
111
, . . .
}{
0
,
00
,
000
, . . . ,
}
)
*
{
²,
1
,
11
,
111
, . . .
}
and remove all the blocks of 1s of length 3, and remove all blocks of 0s of length 2.
This leaves us with
{
²,
0
,
000
, . . .
}
(
{
1
,
11
,
1111
, . . .
}{
0
,
000
, . . . ,
}
)
*
{
²,
1
,
11
,
1111
, . . .
}
which can also be rewritten more compactly as
(
{
0
}
*
\{
00
}
) ((
{
1
}{
1
}
*
\{
111
}
)(
{
0
}{
0
}
*
\{
00
}
))
*
(
{
1
}
*
\{
111
}
)
.
A similar solution is possible starting with the other block decomposition.
(c) The set of
{
0
,
1
}
strings in which the substring 0111 does not occur.
Solution:
We start with the block decomposition where in the middle section the 0blocks precede
the 1blocks (i.e.
{
1
}
*
(
{
0
}{
0
}
*
{
1
}{
1
}
*
)
*
{
0
}
*
) and omit the 1blocks of length 3 or
more. This gives us
{
1
}
*
(
{
0
}{
0
}
*
{
1
,
11
}
)
*
{
0
}
*
.
Alternatively, we could start with the 0decomposition and remove all strings of 1s of
length 3 or more that follow a 0. This gives us
{
1
}
*
(
{
0
}{
²,
1
,
11
}
)
*
.
1
This preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
(d) The set of
{
0
,
1
}
strings in which the substring 0110 does not occur.
Solution:
We start with the block decomposition
{
1
}
*
(
{
0
}{
0
}
*
{
1
}{
1
}
*
)
*
{
0
}
*
. In the (
{
0
}{
0
}
*
{
1
}{
1
}
*
)
*
part, we can only allow a 11 block if there are no 0’s following it. So we can write
{
1
}
*
(
{
0
}{
0
}
*
{
1
,
111
,
1111
,
11111
, . . .
}
)
*
(
{
0
}{
0
}
*
{
11
} ∪ {
0
}
*
)
.
Alternatively, we could start with the 0decomposition and in the (
{
0
}{
1
}
*
) part omit
the string 011 unless it occurs at the very end of the string. This gives us
{
1
}
*
(
{
0
}{
²,
1
,
111
,
1111
, . . .
}
)
*
(
{
²
} ∪ {
0
}{
11
}
)
.
This is the end of the preview.
Sign up
to
access the rest of the document.
 Spring '09
 M.PEI
 Combinatorics, Sets, Characteristic polynomial, Recurrence relation, block decomposition

Click to edit the document details