Solution

ID: past-exam-of-the-mathematics-course-of-the-university-of-cambridge/2023/iii/paper-224/3/c/solution

Write , , and
On the support of , define the probability mass function
For any real length function satisfying the Kraft inequality, put and . The Gibbs inequality gives
Equality holds for the ideal weighted lengths
Thus the smallest average weighted description length is
When has full support, the displayed attains this minimum. If some strings have zero probability, the same value is the infimum over finite lengths and is attained by the extended-real ideal assignment there; finite codewords of arbitrarily large length approach it.

New to topics? Read the docs here!