Appendix 3: Ergodic Theorems and AEP
Rigorous Foundation for Typical Sequences
This appendix proves that for ergodic sources, almost all long sequences have probability \(\approx 2^{-nH}\).
The Asymptotic Equipartition Property (AEP)
Theorem: Let \(\{X_i\}\) be a stationary ergodic process with entropy rate \(H\). Then:
Proof Sketch (Shannon-McMillan-Breiman)
For \(n\)-th order Markov processes, decompose:
By ergodicity, the time average converges to the ensemble average:
Taking \(n \to \infty\), \(H_n \to H_{\infty} = H\).
Consequences
1. Typical Set
Define the typical set:
Properties:
- \(P(A_\epsilon^{(n)}) \to 1\) as \(n \to \infty\)
- \(|A_\epsilon^{(n)}| \approx 2^{nH}\)
- Non-typical sequences have total probability \(< \epsilon\)
2. Source Coding
Only \(\approx 2^{nH}\) sequences need unique codewords. Others can share a single "escape" code.
3. Data Compression
The entropy rate is both necessary and sufficient for lossless compression of ergodic sources.
The Law of Large Numbers for Information
The AEP is the analog of the law of large numbers for the random variable \(-\log p(X_i | \text{past})\).
Just as sample means converge to expectations, sample information rates converge to entropy rates.