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 theory quantifies information using probability. Shannon entropy assigns to each random variable a number — measured in bits when the logarithm is base 2 — equal to the average number of yes/no questions needed to determine its value optimally. Mutual information measures the statistical dependence between two variables: the reduction in uncertainty about achieved by observing . These quantities matter because they set absolute, unbeatable limits on compression and communication that no engineering cleverness can surpass. The surprising fact: information content depends only on the probability distribution, not on the meaning or physical form of the data — and a perfectly random source of bits is genuinely incompressible.

The Core Insight

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

Self-Information (Surprisal)

For an event with probability , the self-information or surprisal is

1
⟳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.

Shannon Entropy

For a discrete random variable with alphabet and probability mass function , the entropy is

2
⟳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 .

Joint and Conditional Entropy

For two random variables with joint pmf :

3
⟳Apply to the pair treated as a single random variable over .

4
⟳Average the entropy of within each slice , weighting by ; use .

Chain Rule for Entropy

5
⟳Expand inside the sum and separate terms.

More generally, .

Mutual Information

The mutual information between and is

6
⟳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 :

7
⟳Substitute in , split the logarithm, and recognize and .

Relative Entropy (Kullback–Leibler Divergence)

For two pmfs on the same alphabet,

8
⟳Nonnegativity follows from Jensen's inequality applied to the convex function ; equality holds iff . This is
Gibbs' inequality.

Mutual information is the special case .

Why It Holds / Derivation

Mutual Information is Nonnegative and Symmetric

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 ).

Bounds on Entropy

For a variable on an alphabet of size ,

9
⟳Left bound: each term . Right bound: by .

iff is deterministic; iff is uniform.

Binary entropy function $H(p) = -p\log_2 p - (1-p)\log_2(1-p)$

p (probability of one outcome) H(p) bits 0 1 0.5 1 max = 1 bit symmetric, concave

Claude Elwood Shannon | 1916–2001

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

Entropy of a Biased Coin

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.

Mutual Information of a Binary Symmetric Channel

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.

Mutual information is not transitive

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

  1. Lossless data compression — Huffman coding, arithmetic coding, and the formats ZIP, PNG, and FLAC approach the entropy bound ; no scheme beats bits/symbol on average (Shannon's source coding theorem).
  2. Reliable communication — The channel capacity sets the maximum error-free data rate; modern LDPC and turbo codes used in 5G, Wi-Fi, and deep-space probes operate within a fraction of a dB of this Shannon limit.
  3. Cryptography — Shannon's notion of perfect secrecy requires the key entropy to equal the message entropy, proving the one-time pad unbreakable and bounding all ciphers.
  4. Machine learning — Decision trees split on the feature maximizing information gain (mutual information); cross-entropy is the standard loss for classification and language models.
  5. Neuroscience — Mutual information quantifies how much a neuron's spike train tells you about a stimulus, measuring the efficiency of neural coding.
  6. Genomics & bioinformatics — Mutual information detects co-evolving residues and gene-regulatory dependencies that linear correlation misses.
  7. Feature selection & medical diagnosis — Tests and biomarkers are ranked by the mutual information they carry about a disease state.

Historical Development

  • 1850s–1870s — Rudolf Clausius and Ludwig Boltzmann develop thermodynamic and statistical entropy; Boltzmann's foreshadows Shannon's formula.
  • 1928 — Ralph Hartley (Bell Labs) proposes as a measure of information for equally likely messages, anticipating the uniform-case entropy.
  • 1948 — Claude Shannon publishes A Mathematical Theory of Communication in the Bell System Technical Journal, defining entropy, mutual information, channel capacity, and proving the source and channel coding theorems.
  • 1949 — Shannon's Communication Theory of Secrecy Systems establishes information-theoretic cryptography and perfect secrecy.
  • 1951 — Solomon Kullback and Richard Leibler introduce relative entropy (KL divergence), unifying it with statistical inference.
  • 1957 — E. T. Jaynes formulates the maximum entropy principle, recasting statistical mechanics as inference and influencing Bayesian statistics.
  • 1959 — Shannon proves the rate–distortion theorem, extending the theory to lossy compression.
  • 1961 — Rolf Landauer establishes Landauer's principle: erasing one bit dissipates at least of heat, physically grounding information.
  • 1991 — Thomas Cover and Joy Thomas publish Elements of Information Theory, the canonical modern textbook.

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

Before this

  • Probability Theory — entropy is an expectation over a probability distribution.
  • Random Variables — entropy and mutual information are functions of distributions of random variables.
  • Logarithms — the logarithm is the heart of every information measure and sets the units.
  • Jensen's Inequality — the engine behind nonnegativity of KL divergence and entropy bounds.
  • Conditional Probability — required to define conditional and joint entropy.

Where this leads