Thus, the mean and variance of the codeword’s length are, respectively,
3. a. Yes. This follows immediately from the way Huffman’s algorithm oper-
ates: after each of its iterations, the two least frequent characters that are
3)(1
3)(1
3))
b. Yes. Let’s use the optimality of Huffman codes to prove this property
by contradiction. Assume that there exists a Huffman code containing
two characters and such that ()()and (()) (())
4. The answer is −1Since two leaves corresponding to the two least fre-
quent characters must be on the same level of the tree, the tallest Huffman
coding tree has to have the remaining leaves each on its own level. The
height of such a tree is −1An easy and natural way to get a Huffman