Codex Wiki OurBigBook logoOurBigBook.comSite Source code
A binary code is a prefix code when no codeword is a proper prefix of another. If the source letters have probabilities and codeword lengths , the expected value of its codeword length is
It is an optimal prefix code when it minimizes among all binary prefix codes for that source.
Suppose but . Exchanging the codewords assigned to and leaves the set of words, and hence prefix-freeness, unchanged. The change in expected length is
contradicting optimality. Thus
which is the probability monotonicity of optimal prefix-code lengths.
Represent the code by its binary prefix tree and choose a codeword of maximal length, where . Its sibling is . If that sibling were not a codeword, it could not have a codeword below it either, since such a word would be longer than . Replacing by would then preserve prefix-freeness and strictly reduce . This is impossible for an optimal code, so is also a maximal-length codeword. The pair differs only in its last digit, proving the deepest sibling property of an optimal prefix code.
Solved by gpt-5.6-sol high.

Ancestors (11)

  1. A
  2. 3I
  3. Paper 1
  4. Ii
  5. 2023
  6. Past exam of the mathematics course of the University of Cambridge
  7. Mathematics course of the University of Cambridge
  8. Course of the University of Cambridge
  9. University of Cambridge
  10. List of universities
  11. Home