Information Theory and Coding Basics
A source emits the symbols A, B and C independently with probabilities 0.6, 0.3 and 0.1, and its entropy is about 1.30 bits. Which of the following is closest to the efficiency (entropy ÷ average code length) when this source is encoded with a Huffman code?
- AAbout 65%
- B70%
- CAbout 93%
Show answer and explanation
Answer: C. About 93%
The Huffman code merges 0.1 and 0.3 into 0.4 and then 0.4 and 0.6, so the code lengths are 1 bit for A and 2 bits for B and C. The average code length is 0.6 × 1 + 0.3 × 2 + 0.1 × 2 = 1.4 bits, and the efficiency is 1.30 ÷ 1.4 ≈ 0.93, that is, about 93%. The remaining 7% or so is waste that arises because code lengths are limited to whole numbers of bits.
- A. About 65% is 1.30 ÷ 2, the efficiency when the three symbols are represented with a 2-bit fixed-length code.
- B. 70% is 1.4 ÷ 2, the ratio of the average code length to that of the fixed-length code. It is not the efficiency.
- C. Correct. 1.30 ÷ 1.4 ≈ 93%.
Continue: 9 more Information Theory and Coding Basics questions