Information Theory: Entropy and Mutual Information
One-line statement: Entropy measures the average uncertainty (in bits) of a random variable, while mutual information measures how much knowing one variable reduces uncertainty about another. Key result in words: A source with entropy bits per symbol cannot be losslessly compressed below bits/symbol on average; the maximum reliable communication rate over a noisy channel equals the channel's maximal mutual information. Where it applies: Data compression, communication theory, cryptography, machine learning, statistics, neuroscience, and statistical physics. Who/when: Claude E. Shannon, A Mathematical Theory of Communication (1948).
Information equals surprise. A certain event (probability 1) carries zero information; a rare event carries much. The right measure of the surprise of an event with probability is , because surprise should be additive for independent events and decreasing in probability. Entropy is the expected surprise, and every other quantity — joint entropy, conditional entropy, mutual information, relative entropy — is built from this single primitive.
Formal Statement
For an event with probability , the self-information or surprisal is
Derivation hint: Demand a measure that is continuous, decreasing in , and additive over independent events (); the only solutions are . The base fixes the unit: gives bits (shannons), gives nats, gives hartleys (dits). We use base 2 throughout unless noted.
For a discrete random variable with alphabet and probability mass function , the entropy is
Derivation hint: Take the expectation of the self-information over the distribution of ; adopt the convention (justified by ).
Symbols: = random variable; = its (finite or countable) alphabet; = pmf; = entropy in bits. Entropy depends only on the distribution , not on the values of .
For two random variables with joint pmf :
Derivation hint: Apply to the pair treated as a single random variable over .
Derivation hint: Average the entropy of within each slice , weighting by ; use .
Derivation hint: Expand inside the sum and separate terms. More generally, .
The mutual information between and is
Derivation hint: It is the relative entropy (KL divergence) between the joint distribution and the product of marginals — the "distance" from independence. Equivalent forms, all derivable from and :
Derivation hint: Substitute in , split the logarithm, and recognize and .
For two pmfs on the same alphabet,
Derivation hint: Nonnegativity follows from Jensen's inequality applied to the convex function ; equality holds iff . This is <strong>Gibbs' inequality</strong>. Mutual information is the special case .
Why It Holds / Derivation
We show with equality iff .
Step 1. By definition , , a KL divergence.
Step 2. Write .
Step 3. Apply Jensen's inequality to the concave function (expectation moves inside):
Step 4. Hence . Equality in Jensen requires the argument constant: , i.e. — independence.
Step 5. Symmetry is immediate because treats interchangeably.
Corollary (conditioning reduces entropy). From , . Knowing never increases uncertainty on average (it may increase it for a particular value ).
∎For a variable on an alphabet of size ,
Derivation hint: Left bound: each term . Right bound: by . iff is deterministic; iff is uniform.
An American mathematician and electrical engineer at Bell Labs, Shannon single-handedly founded information theory with his 1948 paper. He chose the name "entropy" on the suggestion of John von Neumann, who reputedly told him: "No one knows what entropy really is, so in a debate you will always have the advantage." The mathematical form of Shannon entropy is identical to the Gibbs entropy of statistical mechanics, a coincidence Shannon exploited deliberately. Beyond information theory, Shannon contributed to cryptography (proving the one-time pad's perfect secrecy), digital circuit design (his master's thesis applied Boolean algebra to switching), and built whimsical machines including a maze-solving mechanical mouse and a juggling robot.
Building Intuition
Think of entropy as the average number of yes/no questions in an optimal guessing game. If a horse race has 8 equally likely winners, you need questions ("Is it in the first half?" etc.), so bits. But if one horse wins half the time and others are rare, a smart questioner asks "Is it the favorite?" first — most games end in one question, and the average number of questions drops below 3. That average is exactly the entropy. Mutual information is how much a hint helps. Suppose you must guess , but a friend whispers a related variable . The reduction in your expected number of questions — from down to — is . If tells you everything, ; if is irrelevant, .
The Venn diagram picture. Draw two overlapping circles for and . The overlap is ; the union is ; the left crescent is ; the right crescent is . Every identity in and becomes obvious set arithmetic. Caution: this picture works beautifully for two variables but breaks for three or more, where "triple intersections" can be negative and have no set-theoretic meaning.
Worked Examples
Given: A coin with , .
Find: The entropy .
Steps:
Compute , so . Compute , so . Sum: .
Interpretation: Far below the maximum of 1 bit (fair coin). On average, 1000 flips of this coin carry only ~469 bits of information and could be compressed to ~469 bits.
Given: Send uniformly ( each) through a channel that flips the bit with probability . Output is .
Find: .
Steps: By symmetry, is also uniform: , so bit. The noise is independent of the input, so the conditional entropy is the entropy of the flip:
Apply form :
Interpretation: This equals the channel capacity of the BSC at . Each transmission reliably conveys about 0.53 bits despite carrying 1 raw bit — the 10% noise costs nearly half the channel.
Common Misconceptions
Conditioning reduces entropy only on average. The inequality holds for the average conditional entropy . For a specific outcome , it is entirely possible that — a particular observation can leave you more confused than before. Only the weighted average is guaranteed to drop.
Entropy is not "the amount of disorder you can see." depends only on the probability distribution, not on the meaning, structure, or perceptual disorder of outcomes. A perfectly ordered-looking deterministic sequence has zero entropy; a uniformly random sequence has maximal entropy. The famous text "to be or not to be" and a random scramble of the same letters can have very different entropies depending only on the assumed source distribution.
One might guess that if shares information with , and shares information with , then and must share information. False. Let be independent fair bits and define (XOR). Then:
- and : each of alone is independent of (knowing only tells you nothing about the XOR, since is still random).
- Yet bit: the pair fully determines .
Information can hide in joint structure invisible to any single variable, contradicting naive transitivity intuitions.
Connections
Mutual information is the bridge between Probability Theory and communication. The KL divergence underlies hypothesis testing and the Maximum Likelihood Estimation framework, where minimizing equals maximizing likelihood. In machine learning, the cross-entropy loss used to train classifiers equals , so minimizing it minimizes the KL divergence to the true labels. Entropy connects directly to Statistical Mechanics: Shannon's equals the Gibbs–Boltzmann entropy , and the maximum entropy principle derives equilibrium distributions (e.g. the Boltzmann distribution) as the least-biased choice given known constraints. Mutual information also generalizes Correlation and Covariance: unlike correlation, captures all dependence, including nonlinear, and is zero iff variables are truly independent.
Real-World Applications
Historical Development
Subtleties & Limits
Continuous and infinite alphabets. For continuous variables, the differential entropy replaces , but it is not a true measure of information: it can be negative, is not invariant under coordinate changes, and depends on units. Mutual information, by contrast, remains well-defined and nonnegative in the continuous case, which is why is the robust fundamental object.
Estimation from data. Entropy and mutual information must usually be estimated from finite samples, and naive plug-in estimators are systematically biased downward; debiasing high-dimensional mutual information remains an active research area (e.g. MINE and neural estimators).
Multivariate information. Decomposing the information that several sources jointly provide about a target into "unique," "redundant," and "synergistic" parts — the partial information decomposition problem — has no universally accepted definition and is an open question in information theory.
See Also
Source Coding Theorem · Channel Capacity · Kullback–Leibler Divergence · Statistical Mechanics · Cross-Entropy Loss · Kolmogorov Complexity · Maximum Likelihood Estimation