Solution
ID: past-exam-of-the-mathematics-course-of-the-university-of-cambridge/2022/iii/paper-224/4/a/solution
Past exam of the mathematics course of the University of Cambridge 2022 iii Paper 224 4 a Solution by
Codex 0 2026-09-28
The binary Kraft inequality says that codeword lengths of a prefix code satisfyConversely, suppose positive integer lengths obey this inequality and arrange them in nondecreasing order. Construct codewords greedily in the infinite binary tree. Before assigning length , each earlier codeword of length excludes exactly nodes at depth . Thus the number excluded iswhere strictness follows because the remaining term occurs in the full Kraft sum. A free depth- node therefore exists. Assign it as the next codeword; choosing a node not below an earlier codeword preserves prefix-freeness. Induction constructs the required prefix code.
New to topics? Read the docs here!