Past exam of the mathematics course of the University of Cambridge 2023 iii Paper 224 3 b Solution 2026-09-28
For the direct half of the code-distribution correspondence, let be the length function of a binary prefix code and putThen is a probability mass function andThus every prefix code determines a distribution whose ideal description lengths do not exceed the codeword lengths.
Conversely, given a probability mass function , setfor . Then , so the Kraft inequality is satisfied. Its converse supplies a binary prefix code with these lengths, andIf real lengths are allowed, the ideal choice satisfies Kraft with equality.
Past exam of the mathematics course of the University of Cambridge 2024 iii Paper 224 2 b Solution Created 2026-09-24 Updated 2026-09-25
The code-distribution correspondence starts from the Kraft inequality. For codeword lengths putConversely, a probability mass function determines ideal lengths , up to integer rounding. For the source law ,using nonnegativity of Kullback-Leibler divergence and .