Suppose the letters have probabilities , respectively.
What is the average length of the Huffman code for the letters ?
GATE CSE 2007Algorithms › Greedy Method, Dynamic Programming & Algorithm Design TechniquesVerified
(D) 1.9375 1.9375 1.9375
Construct the Huffman tree by repeatedly merging the two smallest probabilities until one root remains. Then read each codeword length from the tree and compute the weighted average length using the given letter probabilities.
The Huffman procedure produces code lengths 1,2,3,4,5,5 for letters $a,b,c,d,e,f$ respectively. Therefore the average Huffman code length is 1.9375, which matches option D.
Reviewed by GateIQ Editorial Team: IIT & IISc Alumni.