Source coding
1 Codes
2 The source coding theorem
3 Coding with the wrong distribution
ProofProof
Proof. Every sum here runs over the values \(x\) with \(p(x) > 0\). Rounding up adds less than one binary digit, so for each such \(x\)
\[-\log_2 q(x) \le \ell(x) < -\log_2 q(x) + 1.\]
Multiply each part by \(p(x) > 0\) and sum. Since \(\sum_{x} p(x) = 1\),
\[ -\sum_{x} p(x) \log_2 q(x) \le \sum_{x} p(x) \, \ell(x) < -\sum_{x} p(x) \log_2 q(x) + 1. \]
The middle sum is \(L\), and the outer sums are \(H_2(p, q)\).
References
Cover, Thomas M., and Joy A. Thomas. 2006. Elements of Information Theory. 2nd ed. Wiley-Interscience. https://doi.org/10.1002/047174882X.
Shannon, C. E. 1948. “A Mathematical Theory of Communication.” Bell System Technical Journal 27 (3): 379–423. https://doi.org/10.1002/j.1538-7305.1948.tb01338.x.