Compare average code length with source entropy to compute redundancy (avgLen - H) / H; lower redundancy means a better code.
冗余越低编码越优,理想情况趋近 0。
| Item | Formula / Rule | Source / Standard |
|---|---|---|
| Redundancy definition | R = 1 − H(X) / Hmax, ranging from 0 to 1 | Shannon, A Mathematical Theory of Communication, 1948 |
| Maximum entropy | Hmax = log2(n) where n is the alphabet size | Shannon 1948 §1 Discrete noiseless source |
| Coding efficiency | Efficiency η = H(X) / Hmax = 1 − R | ISO/IEC 2382 Information technology vocabulary — information theory terms |