Past exam of the mathematics course of the University of Cambridge 2023 ii Paper 1 3I b Solution Created 2026-09-24 Updated 2026-09-25
The Huffman coding merges may be chosen asResolving the tied weights so that the original symbol is merged only at the final step gives the codeIts lengths are and its expected length isThe Huffman coding theorem proves optimality, so an optimal coding with all but one word of the same length does exist. This is an instance of a nonunique optimal prefix code: a different resolution of the ties also gives the optimal profile .