Question
A source emits the four letters with probabilities . Compute the entropy and compare it with the code : the mean length is bits; it coincides with (optimal Huffman code).
Solution
Entropy: With , , : Mean code length (bits per letter probability): The two values coincide: . When the probabilities are powers of , the Huffman code reaches exactly the Shannon limit — it is impossible to compress any further.
Links
Topics: Probability distributions
Concepts: Entropy
Skills: Computing
People: Shannon
Exercise type: Expression evaluation