Two ternary Huffman codes

1.2k Views Asked by At

There are two ternary exhaustive prefix, i.e. Huffman, codes for seven source words with probabilities $p_i$, $p_i ≥ p_2 ≥ … ≥ p_7$

What are the two codes and under what conditions on the ${p_i}$ is each code more efficient than the other?

2

There are 2 best solutions below

0
On

Here’s a hint to get you started. The two ternary trees that generate the two ternary Huffman codes are:

enter image description here

These are the only full ternary trees with $7$ leaves. You need to figure out what conditions on $p_1,\ldots,p_7$ would lead to each of these trees.

0
On

I think the first code (2, 2, 3) not (2, 2, 2, 1)