Solution

ID: past-exam-of-the-mathematics-course-of-the-university-of-cambridge/2007/ii/paper-1/4g/solution

A uniquely decodable code is a map whose extension by concatenation to finite strings is injective. Write for its codeword lengths and assume the target alphabet has size . The Kraft–McMillan inequality gives . The Gibbs inequality says for probability distributions , with the usual convention for zero probabilities.
Set . For Shannon entropy , the Gibbs inequality becomes
Since , the entropy lower bound for prefix codes also applies to this uniquely decodable code:

New to topics? Read the docs here!