Information Theory and Entropy
Information theory quantifies information, uncertainty, and the limits of communication. Its central quantity, Shannon entropy , measures the average uncertainty (in bits) of a random variable. It governs data compression (source coding) and reliable transmission (channel coding). Founded by Claude Shannon in his 1948 paper A Mathematical Theory of Communication.Information theory is the mathematical study of the storage, transmission, and quantification of information. At its heart lies entropy, a number measuring the average unpredictability of a random source: a fair coin carries 1 bit per toss, while a biased coin carries less. Entropy sets a hard floor on how much data can be compressed without loss and—via channel capacity—a hard ceiling on how fast information can flow through a noisy medium. The surprising fact is that these two seemingly different limits emerge from a single coherent framework, and that reliable communication over noise is possible at all below capacity, with error probability driven arbitrarily close to zero. This unification, achieved in one 1948 paper, underpins every modern digital technology.
The Core Insight
Information is the resolution of uncertainty. The amount of information in an event is inversely related to its probability: rare events are surprising and informative; certain events tell us nothing. Entropy is the expected surprise. Once you measure uncertainty in bits, the entire theory of compression and communication follows as a matter of counting.
Formal Statement
Self-Information (Surprisal)
The self-information of an event with probability is
The base fixes the unit: gives bits, gives nats, gives dits/hartleys. Symbol is the probability mass of outcome .
Shannon Entropy
For a discrete random variable with alphabet and pmf , the entropy is the expected self-information:
Here is measured in bits, is the (finite or countable) set of outcomes, and the sum runs over all with .
Joint, Conditional Entropy, and Mutual Information
For two random variables :
Kullback–Leibler Divergence
The relative entropy between distributions and on the same alphabet is
Shannon's Source Coding Theorem
Let be i.i.d. samples from . For any , there exists a lossless code with expected length per symbol satisfying for large enough, and no lossless code can achieve . Entropy is the fundamental limit of lossless compression.
Noisy-Channel Coding Theorem
For a discrete memoryless channel with transition law , define capacity
For any rate , there exist codes of block length with error probability as . For , error probability is bounded away from zero.
Why It Holds / Derivation
Entropy Bounds and Non-negativity of KL
We establish and .
- Non-negativity of . Each term since makes . Hence , with equality iff some (a deterministic variable).
- Gibbs' inequality (KL ). Use for . Then
- Therefore , with equality iff everywhere, i.e. .
- Maximum entropy. Set to the uniform distribution . Then
- Hence , with equality iff is uniform. Uncertainty is maximized when all outcomes are equally likely.
Claude Shannon | 1916–2001
An American mathematician and electrical engineer at Bell Labs, Shannon single-handedly founded information theory with his 1948 monograph. His earlier 1937 master's thesis showed that Boolean algebra could describe switching circuits—arguably the most influential master's thesis ever, birthing digital logic design. Shannon was famously playful: he built juggling machines, a mechanical mouse that solved mazes ("Theseus"), and rode a unicycle through Bell Labs corridors. He chose the word "entropy" on the advice of John von Neumann, who reportedly told him no one understands entropy, so he'd always win an argument.
Building Intuition
Think of entropy as the average number of yes/no questions needed to pin down an outcome using an optimal questioning strategy. If a horse race has 8 equally likely horses, you need 3 questions ("Is it in the top half?" etc.)—and bits. If one horse is a near-certain favorite, you often guess right with one question, so the average drops below 3.
The biased coin is the cleanest mental model. A fair coin gives 1 bit. A coin that lands heads 90% of the time is mostly predictable: most flips tell you little, so its entropy is only about 0.47 bits. A two-headed coin gives 0 bits—you learn nothing.
Mutual information is the overlap of uncertainties: how much knowing shaves off your uncertainty about . It is symmetric—learning about smoke tells you exactly as much about fire as vice versa.
Binary entropy function $H(p) = -p\log_2 p - (1-p)\log_2(1-p)$, peaking at $p=0.5$
Worked Examples
Entropy of a Biased Coin
Given: A coin lands heads with probability , tails with . Steps:- Apply equation [2]: .
- bits.
- bits.
- Sum: bits.
Interpretation: a long sequence of such flips can be compressed to roughly bits, versus bits for naive storage—an 19% saving.
Capacity of a Binary Symmetric Channel
Given: A binary symmetric channel (BSC) flips each transmitted bit independently with probability . Steps:- Capacity of a BSC: bits per channel use, where is the binary entropy of the flip probability.
- Compute .
- bits.
- bits.
- bits, so .
Interpretation: despite 10% noise, you can transmit reliably (with vanishing error) at up to about 0.53 information bits per physical bit sent, using a good error-correcting code.
Common Misconceptions
Entropy is not disorder, and high entropy is not "bad." In information theory, entropy measures uncertainty about which message will occur, not physical messiness. A maximally compressed file looks like random noise precisely because it has maximal entropy—every bit is informative. Information is not the same as meaning. Shannon's theory is deliberately semantic-free: the string "asdfjkl" and a Shakespeare sonnet of equal length and letter statistics carry the same Shannon information. Meaning lives outside the theory. Bits-the-unit vs. bits-the-storage. A source with entropy 0.8 bits/symbol still requires whole physical bits to store one symbol; the entropy is the amortized limit over long sequences, not a per-symbol storage size. "More outcomes always means more entropy." False. Consider over 1000 outcomes where one outcome has probability and the remaining 999 share . Its entropy is about bits—far less than a fair coin's 1 bit over only 2 outcomes. Entropy depends on the shape of the distribution, not the alphabet size alone. Only the uniform distribution attains the maximum .Connections
Information theory sits at a crossroads. Its entropy formula is mathematically identical (up to Boltzmann's constant) to the Statistical Mechanics entropy , linking information to thermodynamics via Maxwell's Demon and Landauer's principle. The KL divergence is the workhorse of Bayesian Inference and underlies Maximum Likelihood Estimation, since maximizing likelihood minimizes . Mutual information is a central objective in Machine Learning, from feature selection to the information bottleneck. The maximum-entropy principle connects to Probability Theory as a least-biased way to assign distributions under constraints, recovering the Gaussian and exponential families.
Real-World Applications
- Data compression. ZIP, gzip, and PNG use entropy coders (Huffman, arithmetic coding) approaching the entropy limit; JPEG and MP3 combine this with lossy quantization guided by rate-distortion theory.
- Error-correcting codes. Reed–Solomon codes on CDs/DVDs/QR codes, LDPC codes in Wi-Fi (802.11n) and 5G, and Turbo codes in deep-space probes all operate near Shannon capacity.
- Cryptography. Shannon's notion of perfect secrecy (the one-time pad) and entropy as a measure of key unpredictability/randomness underpin secure key generation.
- Machine learning. Cross-entropy loss trains nearly every neural network classifier; decision trees split on information gain (mutual information).
- Genomics & neuroscience. Mutual information quantifies neural coding efficiency and identifies co-evolving residues or regulatory motifs in DNA sequences.
- Communication systems. The Shannon–Hartley theorem dictates modem, DSL, fiber, and cellular data-rate design.
- Quantum information. Von Neumann entropy generalizes Shannon entropy to density matrices, grounding quantum computing and entanglement measures.
Historical Development
- 1924–1928: Harry Nyquist and Ralph Hartley at Bell Labs quantify "information" via of the number of possible messages, anticipating the logarithmic measure.
- 1940–1945: Shannon works on cryptography and fire-control during WWII; his classified report A Mathematical Theory of Cryptography (1945) contains early entropy ideas.
- 1948: Shannon publishes A Mathematical Theory of Communication in the Bell System Technical Journal, defining entropy, channel capacity, and the coding theorems.
- 1949: The paper is republished as a book with Warren Weaver's accessible introduction; Shannon also proves the sampling theorem's role and analyzes the one-time pad.
- 1951: Shannon estimates the entropy of printed English at roughly 1 bit per letter using human prediction experiments.
- 1951: Solomon Kullback and Richard Leibler introduce relative entropy (KL divergence).
- 1957: Edwin Jaynes formulates the maximum entropy principle, recasting statistical mechanics as inference.
- 1961: Rolf Landauer establishes that erasing one bit dissipates at least of heat, physically grounding information.
- 1993–2008: Practical capacity-approaching codes arrive—Turbo codes (Berrou et al., 1993) and the rediscovery of LDPC codes (Gallager 1962; MacKay 1996)—finally realizing Shannon's 1948 promise.
Subtleties & Limits
Several deep issues remain active. Differential entropy for continuous variables can be negative and is not coordinate-invariant, requiring care; the right invariant object is relative entropy or mutual information. Finite-blocklength information theory (Polyanskiy–Poor–Verdú, 2010) sharpens Shannon's asymptotic limits for the short codes used in real low-latency systems—an ongoing refinement. The information bottleneck as a theory of deep learning generalization is debated. In the quantum realm, computing capacities of quantum channels exhibits superadditivity and remains only partially understood. Finally, algorithmic (Kolmogorov) complexity offers an alternative, individual-object notion of information that is provably uncomputable, sitting uneasily alongside Shannon's ensemble-based theory.