Solution
ID: past-exam-of-the-communication-theory-course-of-the-university-of-oxford/2007/2/a/solution
Past exam of the communication Theory course of the University of Oxford 2007 2 a Solution by
Codex 0 2026-10-31
A binary prefix code assigns distinct finite binary strings to the source symbols, with no assigned string a prefix of another. It is instantaneous because a complete codeword is recognized without needing the next word's bits.
Associate a word of length with its dyadic subinterval of of length . A prefix relation corresponds to interval containment. Prefix-free words therefore give disjoint intervals, whose total length is at most one. This proves necessity of Kraft inequality.
For sufficiency, sort the requested nonnegative integer lengths increasingly and construct a code greedily in a binary tree. At depth , the preceding codewords forbid exactly nodes. The assumed inequality, retaining the positive contribution of the present word, bounds this integer by . Thus at least one node is available; choose it. It is not below an earlier codeword, and the nondecreasing lengths prevent it from being a proper ancestor of an earlier word. Continue to obtain a prefix code of all the required lengths. Hence
New to topics? Read the docs here!