Next: Problem 5 - Data
Up: Information Science I
Previous: Problem 3 - Finite
Answer following questions regarding Huffman codes.
- 1.
- Consider a string that consists of four characters , , ,
and . Assume that , , , and
appear with probabilities 0.5,
0.25, 0.125, 0.125, respectively. Write the Huffman codes for , , ,
and .
- 2.
- Compute the expected length of the codes.
- 3.
- Consider a string consisting of , with
.
appears with probability
where
and
, with
. Write an algorithm that computes
their Huffman codes.
- 1.
-
- 2.
- The expected length of the codes is:
- 3.
-
with
1's
with
1's
Reynald AFFELDT
2000-06-08