Solution

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

Relabel the symbols so and assign all finite binary strings in nondecreasing length order, beginning with the empty string. The th string has length
Since ,
Thus the optimal one-to-one binary code satisfies

New to topics? Read the docs here!