Date: April 21, 2008
2
Figure 1: Counter example for 1(c). Greedy set cover algorithm would choose
{
9, 1, 3, 5,
7
}
. However, the optimal set cover is
{
2, 4, 6, 8
}
.
1. True or false (2 points each, 14 points total).
No negative points for wrong answers. If it is true give a short justification. If
it is false give a counterexample.
(a) (TRUE or FALSE) In a Huffman encoding scheme, if all characters occur with fre-
quency less than 1/3, then there is guaranteed to be no codeword of length 1.
Answer: True
Justification: Suppose this is not the case. Let
x
be a node corresponding to a single
character with
p
(
x
)
<
1
/
3 such that the encoding of
x
is of length 1. Then
x
must not
merge with any other node until the end. Consider the stage when there are only three
leaves -
x, y
and
z
left in the tree. At the last stage
y, z
must merge to form another
node so that
x
still corresponds to a codeword of length 1. But,
p
(
x
)+
p
(
y
)+
p
(
z
) = 1
and
p
(
x
)
<
1
/
3 implies
p
(
y
) +
p
(
z
)
>
2
/
3.
Hence, at least one of
p
(
y
) or
p
(
z
), say
p
(
z
), must be greater than 1
/
3. But then these two cannot merge since
p
(
x
) and
p
(
y
)
would be the minimum. This leads to a contradiction.
(b) (TRUE or FALSE) In a Huffman encoding scheme, if all characters occur with fre-
quency less than 2/5, then there is guaranteed to be no codeword of length 1.
Answer: False
Counter exmaple: (0.39, 0.39, 0.22), the corresponding huffman coding length is (1,
2, 2).
(c) (TRUE or FALSE) The greedy set cover algorithm (which repeatedly chooses the
largest set) gives the optimal set cover.
Answer: False
Counter example: In Figure 1, greedy set cover algorithm would choose
{
9, 1, 3, 5,
7
}
. However, the optimal set cover is
{
2, 4, 6, 8
}
.
(d) (TRUE or FALSE) If
s
and
t
are at least
D
hops apart (i.e. every path from
s
to
t
has at least
D
edges), then there is an
s
−
t
cut with at most
m/D
edges, where
m
is
the number of edges.