Past exam of the mathematics course of the University of Cambridge 2018 ii Paper 1 3H Solution Created 2026-09-24 Updated 2026-10-03
Let a memoryless source have probabilities , and let a uniquely decodable -ary code have word lengths and mean length . The Shannon source coding theorem statesand that some prefix code satisfies
For the lower bound, the Kraft inequality gives . Set . The Gibbs inequality, or nonnegativity of relative entropy, givesTherefore .
Past exam of the mathematics course of the University of Cambridge 2019 iii Paper 323 2 i b Solution Created 2026-10-03 Updated 2026-10-05
Every member of the typical set has probability at least . Summing these probabilities givessoThe upper bound itself holds at every block length. For sufficiently large , the high-probability property also gives the companion lower boundhence . Together these are the typical-set cardinality bounds underlying Shannon source coding theorem.
Past exam of the mathematics course of the University of Cambridge 2019 iii Paper 323 2 iii Solution Created 2026-10-03 Updated 2026-10-05
Let indicate whether the outcome differs from . Then . The chain rule for information entropy givessince is determined when . The remaining conditional distribution has at most outcomes, so the maximum entropy on a finite alphabet is . Therefore the Shannon source coding theorem limit obeysHere is the binary entropy function; equality holds when the rare outcomes are equiprobable. A convenient explicit small- bound isbecause . For a fixed alphabet, this upper bound tends to zero as .
Past exam of the mathematics course of the University of Cambridge 2020 ii Paper 1 3I b iii Solution Created 2026-09-24 Updated 2026-10-03
The binary entropy isThe Shannon source coding theorem requiresfor the standard Shannon construction, while every prefix code obeys the lower bound. Numerically,Thus both codes satisfy the theorem, with the Huffman code closer to the entropy lower bound.