Solution

ID: past-exam-of-the-mathematics-course-of-the-university-of-cambridge/2007/iii/paper-31/1/b/solution

If all leaves of a full binary tree have depth , all binary paths of length end in leaves. Thus it has exactly leaves and . Equivalently, equality in the Kraft inequality gives .
Conversely, when a complete depth- tree is a prefix code with mean length . For any prefix lengths , convexity gives
so . The complete tree is optimal. A Huffman code attains this optimum, and equality in the strictly convex first inequality forces all its lengths to equal . Hence, for ,
This also proves that ties in the Huffman construction do not change the conclusion.

New to topics? Read the docs here!