Solution

ID: past-exam-of-the-information-theory-course-of-the-university-of-oxford/2021/2/b/i/solution

Exchange the two complete codewords while leaving the code tree unchanged. The prefix code property is preserved because the set of codewords is unchanged. If but , the change in expected codeword length is
contradicting optimality. Hence implies . This probability monotonicity of optimal prefix-code lengths is valid even if some probabilities are zero; equal probabilities impose no order.[ref]

New to topics? Read the docs here!