Quality of the Huffman Code
The Huffman code is within one bit of the entropy lower bound.
Huffman code does not work well with a two symbol alphabet.
- Example: P(0) = 1/100, P(1) = 99/100
- HC = 1 bits/symbol
-
-
- H = -((1/100)*log2(1/100) + (99/100)log2(99/100)) = .08 bits/symbol