Past exam of the mathematics course of the University of Cambridge 2007 iii Paper 31 1 e Solution Created 2026-10-03 Updated 2026-10-14
A full binary tree has Kraft sum one. For example, place mass one at the root and divide each internal vertex's mass equally between its children; a leaf at depth receives , and the total mass on leaves remains one. Using part d gives the two equationsMultiplying the second equation by and subtracting the first gives the uniform-source Huffman length distributionIf , the first number is zero and every codeword has length . Otherwise both levels occur. The corresponding mean length is .
Past exam of the mathematics course of the University of Cambridge 2007 iii Paper 31 1 f Solution Created 2026-10-03 Updated 2026-10-14
For the uniform 27-symbol model, . The uniform-source Huffman length distribution givesThus five symbols receive four-bit codewords and the other 22 receive five-bit codewords. To realize these lengths, start with all 32 binary words of length five and collapse any five disjoint sibling pairs into their four-bit parents. This leaves exactly five leaves at depth four and 22 at depth five. All source letters have the same probability, so which five letters receive the shorter codewords is arbitrary.