Mutual Information

⚡ Key Takeaways

Mutual information I(X;Y)I(X;Y) measures the amount of information (in bits or nats) that one random variable carries about another — equivalently, the reduction in uncertainty about XX from observing YY. Key result: I(X;Y)=H(X)−H(X∣Y)≥0I(X;Y) = H(X) - H(X\mid Y) \ge 0, with equality iff X⊥YX \perp Y. It applies wherever dependence must be quantified: communication channels, feature selection, neuroscience, statistical inference. Introduced by Claude Shannon (1948).

💡 The Core Insight

Independence means p(x,y)=p(x)p(y)p(x,y)=p(x)p(y). Mutual information measures how far the true joint distribution is from this independence factorization, using relative entropy as the yardstick. Because relative entropy is nonnegative and vanishes only when its two arguments coincide, mutual information is a faithful "dependence detector": it is exactly zero precisely when independence holds, and it grows as the joint distribution concentrates away from the product structure.

Formal Statement

DefinitionMutual Information

Let XX and YY be random variables on (possibly distinct) spaces with joint distribution PXYP_{XY} and marginals PXP_X, PYP_Y. The mutual information is the relative entropy between the joint and the product of marginals:

1
I(X;Y)=DKL ⁣(PXY ∥ PX⊗PY).\quad I(X;Y) = D_{\mathrm{KL}}\!\big(P_{XY}\,\big\|\,P_X\otimes P_Y\big).

Derivation hint: This is the definition. The symbol ⊗\otimes denotes the product measure assigning mass PX(A)PY(B)P_X(A)P_Y(B) to rectangles A×BA\times B. In the discrete case with joint pmf p(x,y)p(x,y) and marginals p(x)=∑yp(x,y)p(x)=\sum_y p(x,y), p(y)=∑xp(x,y)p(y)=\sum_x p(x,y):

2
I(X;Y)=∑x∈X∑y∈Yp(x,y) log⁡p(x,y)p(x) p(y).\quad I(X;Y) = \sum_{x\in\mathcal X}\sum_{y\in\mathcal Y} p(x,y)\,\log\frac{p(x,y)}{p(x)\,p(y)}.

Derivation hint: Expand the KL definition DKL(P∥Q)=∑plog⁡(p/q)D_{\mathrm{KL}}(P\|Q)=\sum p\log(p/q) with P=p(x,y)P=p(x,y) and Q=p(x)p(y)Q=p(x)p(y). In the continuous case with joint density f(x,y)f(x,y) and marginals fX,fYf_X,f_Y (assuming PXY≪PX⊗PYP_{XY}\ll P_X\otimes P_Y):

3
I(X;Y)=∫ ⁣ ⁣∫f(x,y) log⁡f(x,y)fX(x) fY(y)  dx dy.\quad I(X;Y) = \int\!\!\int f(x,y)\,\log\frac{f(x,y)}{f_X(x)\,f_Y(y)}\;dx\,dy.

Derivation hint: Replace the joint pmf by the joint density and sums by integrals; the Radon–Nikodym derivative of PXYP_{XY} w.r.t. PX⊗PYP_X\otimes P_Y is f(x,y)/(fX(x)fY(y))f(x,y)/(f_X(x)f_Y(y)). Here log⁡\log base 2 gives bits, base ee gives nats, base 256 gives bytes. Symbols: X,Y\mathcal X,\mathcal Y are the alphabets; H(⋅)H(\cdot) below denotes Shannon entropy.

TheoremEquivalent Forms

For discrete random variables, mutual information admits the entropy decompositions

4
I(X;Y)=H(X)−H(X∣Y)=H(Y)−H(Y∣X),\quad I(X;Y) = H(X) - H(X\mid Y) = H(Y) - H(Y\mid X),
5
I(X;Y)=H(X)+H(Y)−H(X,Y),\quad I(X;Y) = H(X) + H(Y) - H(X,Y),

where H(X)=−∑xp(x)log⁡p(x)H(X)=-\sum_x p(x)\log p(x), H(X∣Y)=−∑x,yp(x,y)log⁡p(x∣y)H(X\mid Y)=-\sum_{x,y}p(x,y)\log p(x\mid y), and H(X,Y)=−∑x,yp(x,y)log⁡p(x,y)H(X,Y)=-\sum_{x,y}p(x,y)\log p(x,y). Derivation hint: Substitute p(x,y)=p(x∣y)p(y)p(x,y)=p(x\mid y)p(y) into [2] and split the logarithm; for [5] use p(x∣y)=p(x,y)/p(y)p(x\mid y)=p(x,y)/p(y) twice.

TheoremFundamental Properties

1. Nonnegativity: I(X;Y)≥0I(X;Y)\ge 0, with equality iff X⊥YX\perp Y. 2. Symmetry: I(X;Y)=I(Y;X)I(X;Y)=I(Y;X). 3. Bounds: I(X;Y)≤min⁡{H(X),H(Y)}I(X;Y)\le \min\{H(X),H(Y)\} (discrete case). 4. Self-information: I(X;X)=H(X)I(X;X)=H(X). 5. Data Processing Inequality: if X→Y→ZX\to Y\to Z is a Markov chain, then I(X;Z)≤I(X;Y)I(X;Z)\le I(X;Y). 6. Chain rule: I(X;Y,Z)=I(X;Y)+I(X;Z∣Y)I(X;Y,Z)=I(X;Y)+I(X;Z\mid Y). 7. Invariance: for invertible smooth maps ϕ,ψ\phi,\psi, I(ϕ(X);ψ(Y))=I(X;Y)I(\phi(X);\psi(Y))=I(X;Y).

Why It Holds / Derivation

ProofNonnegativity via Jensen's Inequality

We prove I(X;Y)≥0I(X;Y)\ge0 and the equality condition.

Step 1. Write, using [2],

6
−I(X;Y)=∑x,yp(x,y)log⁡p(x)p(y)p(x,y).\quad -I(X;Y)=\sum_{x,y}p(x,y)\log\frac{p(x)p(y)}{p(x,y)}.

Derivation hint: Negate [2] and flip the fraction inside the log.

Step 2. The function log⁡\log is concave, so by Jensen's inequality applied to the expectation under p(x,y)p(x,y),

7
−I(X;Y)=E ⁣[log⁡p(X)p(Y)p(X,Y)]≤log⁡ E ⁣[p(X)p(Y)p(X,Y)].\quad -I(X;Y)=\mathbb E\!\left[\log\frac{p(X)p(Y)}{p(X,Y)}\right]\le \log\,\mathbb E\!\left[\frac{p(X)p(Y)}{p(X,Y)}\right].

Derivation hint: For concave log⁡\log, E[log⁡U]≤log⁡E[U]\mathbb E[\log U]\le \log \mathbb E[U] with U=p(X)p(Y)/p(X,Y)U=p(X)p(Y)/p(X,Y).

Step 3. Evaluate the inner expectation over the support of p(x,y)p(x,y):

8
E ⁣[p(X)p(Y)p(X,Y)]=∑(x,y):p(x,y)>0p(x,y) p(x)p(y)p(x,y)=∑(x,y):p(x,y)>0p(x)p(y)≤1.\quad \mathbb E\!\left[\frac{p(X)p(Y)}{p(X,Y)}\right]=\sum_{(x,y):p(x,y)>0}p(x,y)\,\frac{p(x)p(y)}{p(x,y)}=\sum_{(x,y):p(x,y)>0}p(x)p(y)\le 1.

Derivation hint: The p(x,y)p(x,y) cancels; the remaining sum over the support of the joint is ≤∑all x,yp(x)p(y)=1\le \sum_{\text{all }x,y}p(x)p(y)=1.

Step 4. Thus −I(X;Y)≤log⁡1=0-I(X;Y)\le\log 1=0, i.e. I(X;Y)≥0I(X;Y)\ge0.

Step 5 (equality). Jensen is tight iff UU is constant a.s., i.e. p(x)p(y)/p(x,y)=cp(x)p(y)/p(x,y)=c on the support, forcing p(x,y)=p(x)p(y)p(x,y)=p(x)p(y) everywhere — exactly independence. ■\blacksquare

∎
ProofData Processing Inequality

Assume the Markov chain X→Y→ZX\to Y\to Z, i.e. Z⊥X∣YZ\perp X\mid Y.

Step 1. By the chain rule [property 6] applied two ways,

9
I(X;Y,Z)=I(X;Z)+I(X;Y∣Z)=I(X;Y)+I(X;Z∣Y).\quad I(X;Y,Z)=I(X;Z)+I(X;Y\mid Z)=I(X;Y)+I(X;Z\mid Y).

Derivation hint: Expand I(X;(Y,Z))I(X;(Y,Z)) by conditioning first on ZZ, then on YY.

Step 2. The Markov property gives I(X;Z∣Y)=0I(X;Z\mid Y)=0, since XX and ZZ are conditionally independent given YY. Derivation hint: Conditional MI is zero exactly under conditional independence, by the equality case of nonnegativity applied to the conditional distributions.

Step 3. Substituting, I(X;Z)+I(X;Y∣Z)=I(X;Y)I(X;Z)+I(X;Y\mid Z)=I(X;Y). Since conditional mutual information I(X;Y∣Z)≥0I(X;Y\mid Z)\ge0,

10
I(X;Z)≤I(X;Y).■\quad I(X;Z)\le I(X;Y).\qquad\blacksquare

Derivation hint: Drop the nonnegative term I(X;Y∣Z)I(X;Y\mid Z).

∎
CE
Claude Elwood Shannon
1916–2001

Shannon, an American mathematician and electrical engineer at Bell Labs, founded information theory in his 1948 monograph A Mathematical Theory of Communication. He introduced entropy as a measure of uncertainty and what he called the rate of transmission — now mutual information — as the quantity governing reliable communication over noisy channels. Shannon's genius was to recognize that "information" could be made precise as a measure of reducible uncertainty, divorced from semantic meaning, and that this measure governs hard operational limits. His noisy channel coding theorem established channel capacity C=max⁡p(x)I(X;Y)C=\max_{p(x)}I(X;Y) as the supremum of achievable error-free rates, making mutual information not a mere mathematical convenience but a physical constant of a communication system.

Building Intuition

🧠 Intuition

Think of I(X;Y)I(X;Y) as "how many yes/no questions about XX you save by first looking at YY." Before seeing YY, your uncertainty about XX is H(X)H(X) bits. After seeing YY, it drops to H(X∣Y)H(X\mid Y). The mutual information is the average savings, H(X)−H(X∣Y)H(X)-H(X\mid Y). A second picture is the Venn diagram of entropies: draw two overlapping circles of areas H(X)H(X) and H(Y)H(Y). The total covered area is H(X,Y)H(X,Y), the overlap is I(X;Y)I(X;Y), and the crescents are the conditional entropies H(X∣Y)H(X\mid Y) and H(Y∣X)H(Y\mid X). Equation [5] is just "overlap = sum of circles minus union." (This picture is exactly correct for two variables; for three or more it can produce negative "interaction information" and must be used with care.) A third picture is statistical surprise: each observed pair (x,y)(x,y) carries pointwise information log⁡p(x,y)p(x)p(y)\log\frac{p(x,y)}{p(x)p(y)} — positive when xx and yy co-occur more than chance, negative when less. Mutual information is the average of this pointwise log-likelihood ratio, and the average is always nonnegative even though individual terms can be negative.

Figure
Venn-diagram decomposition of entropies. The overlap is the mutual information; the crescents are conditional entropies; the union is the joint entropy.
H(X|Y) H(Y|X) I(X;Y) (overlap) H(X) H(Y) union = H(X,Y) = H(X)+H(Y) − I(X;Y)

Worked Examples

ExampleBinary Symmetric Channel

Given: A binary input X∈{0,1}X\in\{0,1\} with P(X=0)=P(X=1)=12P(X=0)=P(X=1)=\tfrac12 passes through a channel that flips the bit with probability ε=0.1\varepsilon=0.1, producing output YY. Compute I(X;Y)I(X;Y) in bits.

Step 1 — Output marginal. By symmetry, P(Y=0)=P(Y=1)=12P(Y=0)=P(Y=1)=\tfrac12, so H(Y)=1H(Y)=1 bit.

Step 2 — Conditional entropy. Given XX, the output is wrong with probability ε\varepsilon:

11
H(Y∣X)=Hb(ε)=−εlog⁡2ε−(1−ε)log⁡2(1−ε).\quad H(Y\mid X)=H_b(\varepsilon)=-\varepsilon\log_2\varepsilon-(1-\varepsilon)\log_2(1-\varepsilon).

Derivation hint: Given X=xX=x, YY is Bernoulli(ε)(\varepsilon) away from xx; its entropy is the binary entropy function HbH_b.

Step 3 — Evaluate. With ε=0.1\varepsilon=0.1:

Hb(0.1)=−0.1log⁡20.1−0.9log⁡20.9=0.1⋅3.3219+0.9⋅0.1520=0.3322+0.1368=0.4690.H_b(0.1)=-0.1\log_2 0.1-0.9\log_2 0.9 = 0.1\cdot3.3219+0.9\cdot0.1520=0.3322+0.1368=0.4690.

Step 4 — Combine. I(X;Y)=H(Y)−H(Y∣X)=1−0.4690I(X;Y)=H(Y)-H(Y\mid X)=1-0.4690.

I(X;Y)=0.531 bits\boxed{I(X;Y)=0.531\ \text{bits}}

This is exactly the channel capacity for a uniform input; over a noisy channel each transmitted bit conveys only about half a bit of information.

ExampleBivariate Gaussian

Given: (X,Y)(X,Y) jointly Gaussian with correlation coefficient ρ=0.8\rho=0.8. Compute I(X;Y)I(X;Y) in nats and bits.

Step 1 — Formula. For a zero-mean bivariate normal,

12
I(X;Y)=−12ln⁡ ⁣(1−ρ2) nats.\quad I(X;Y)=-\tfrac12\ln\!\big(1-\rho^2\big)\ \text{nats}.

Derivation hint: Use I=h(X)+h(Y)−h(X,Y)I=h(X)+h(Y)-h(X,Y) with differential entropy h=12ln⁡(2πe σ2)h=\tfrac12\ln(2\pi e\,\sigma^2) for marginals and 12ln⁡((2πe)2det⁡Σ)\tfrac12\ln\big((2\pi e)^2\det\Sigma\big) for the joint, with det⁡Σ=σX2σY2(1−ρ2)\det\Sigma=\sigma_X^2\sigma_Y^2(1-\rho^2); the σ\sigma and 2πe2\pi e terms cancel.

Step 2 — Evaluate. 1−ρ2=1−0.64=0.361-\rho^2=1-0.64=0.36, so

I=−12ln⁡(0.36)=−12(−1.0217)=0.5108 nats.I=-\tfrac12\ln(0.36)=-\tfrac12(-1.0217)=0.5108\ \text{nats}.

Step 3 — Convert to bits. Divide by ln⁡2=0.6931\ln 2=0.6931:

I=0.5108/0.6931=0.7370 bits.I=0.5108/0.6931=0.7370\ \text{bits}.
I(X;Y)=0.511 nats=0.737 bits\boxed{I(X;Y)=0.511\ \text{nats}=0.737\ \text{bits}}

Note that as ρ→1\rho\to1, I→∞I\to\infty: perfect deterministic dependence between continuous variables carries unbounded information, reflecting that differential entropy is unbounded below.

Common Misconceptions

⚠️ Common mistake

Differential mutual information is finite and nonnegative, but the differential entropy terms can be negative. Do not conclude that I(X;Y)I(X;Y) inherits the pathologies of differential entropy. Although h(X)h(X) can be negative and is not invariant under change of variables, the combination in [3] is a genuine relative entropy: it is nonnegative, invariant under invertible reparametrizations, and equals +∞+\infty when XX determines YY. Treat II, not hh, as the fundamental object in the continuous setting.

Zero correlation does not imply zero mutual information. Correlation captures only linear dependence; mutual information captures all dependence. The converse (independence) is the only condition that forces I=0I=0.

CounterexampleUncorrelated but Strongly Dependent

Let X∼Uniform(−1,1)X\sim\mathrm{Uniform}(-1,1) and Y=X2Y=X^2. Then

13
Cov(X,Y)=E[X3]−E[X]E[X2]=0−0⋅13=0,\quad \mathrm{Cov}(X,Y)=\mathbb E[X^3]-\mathbb E[X]\mathbb E[X^2]=0-0\cdot\tfrac13=0,

Derivation hint: XX is symmetric about 00, so all odd moments vanish. so the correlation is exactly zero. Yet YY is a deterministic function of XX, so observing XX removes all uncertainty about YY: H(Y∣X)=0H(Y\mid X)=0 and I(X;Y)=H(Y)>0I(X;Y)=H(Y)>0. A dependence-detector based on correlation reports "independent"; mutual information correctly reports strong dependence. This is precisely why MI is preferred for nonlinear feature screening.

Connections

connection

Mutual information sits at the hub of several quantitative theories.

  • <span class="wiki-link-missing">Kullback–Leibler Divergence</span>: MI is a KL divergence ([1]); all its properties descend from those of relative entropy.
  • <span class="wiki-link-missing">Shannon Entropy</span> and <span class="wiki-link-missing">Conditional Entropy</span>: the decompositions [4]–[5] express MI through these, giving the Venn-diagram picture.
  • <span class="wiki-link-missing">Channel Capacity</span>: C=max⁡p(x)I(X;Y)C=\max_{p(x)}I(X;Y) is the operational meaning of MI in communication, via Shannon's noisy channel coding theorem.
  • <span class="wiki-link-missing">Fisher Information</span>: for a parametric family near independence, MI is approximated by a quadratic form in the Fisher information metric; locally MI behaves like a squared statistical distance.
  • <span class="wiki-link-missing">Total Correlation</span> and <span class="wiki-link-missing">Interaction Information</span>: these multivariate generalizations extend MI beyond two variables, where the naive Venn picture breaks down.
  • <span class="wiki-link-missing">Maximal Information Coefficient</span> and distance correlation: practical estimators built to inherit MI's "zero iff independent" property.

Real-World Applications

🔬 Where this appears

Historical Development

⏳ History
- 1948 — Claude Shannon publishes A Mathematical Theory of Communication, introducing entropy, conditional entropy, and the "rate of transmission" R=H(X)−H(X∣Y)R=H(X)-H(X\mid Y), the original mutual information, together with the noisy channel coding theorem.
- 1951 — Solomon Kullback and Richard Leibler formalize directed divergence (relative entropy), retroactively revealing MI as a special case.
- 1957–1959 — Aleksandr Khinchin and Andrey Kolmogorov give axiomatic and measure-theoretic foundations; Kolmogorov defines MI for general (non-discrete) probability spaces via the supremum over finite partitions.
- 1959 — I. M. Gelfand and A. M. Yaglom express mutual information between Gaussian processes via spectral densities, extending MI to continuous-time signals.
- 1964 — Alfréd Rényi proposes generalized information measures, prompting study of which axioms uniquely pin down Shannon's MI.
- 1972 — Suguru Arimoto and Richard Blahut independently devise the Arimoto–Blahut algorithm to compute channel capacity max⁡pI(X;Y)\max_p I(X;Y) numerically.
- 1980s — Imre Csiszár and János Körner develop the "method of types," giving sharp, MI-based proofs of coding theorems.
- 1990s — MI becomes the dominant criterion in medical image registration (Viola & Wells; Maes et al., 1997).
- 2003–2004 — Alexander Kraskov, Harald Stögbauer, and Peter Grassberger publish the KSG estimator, a kk-nearest-neighbor method that estimates continuous MI accurately from samples.
- 2018 — Belghazi et al. introduce MINE, estimating MI with neural networks via the Donsker–Varadhan variational bound, fueling MI-based deep representation learning.

Subtleties & Limits

open-problem

Estimating mutual information from finite samples is fundamentally hard. For continuous variables, no estimator can be uniformly consistent at a guaranteed rate over all distributions; the convergence rate depends on unknown smoothness, and high-dimensional MI estimation suffers a curse of dimensionality. Popular neural estimators (MINE, InfoNCE) produce lower bounds that are provably loose: McAllester and Stratos (2020) showed any distribution-free lower bound from nn samples cannot exceed O(ln⁡n)O(\ln n), so estimated MI of "tens of bits" from modest data is statistically meaningless. Open and active questions include: (i) the optimal minimax sample complexity for MI estimation under structural assumptions; (ii) trustworthy upper bounds usable as regularizers; (iii) the right multivariate generalization — interaction information can be negative and the Venn picture fails for ≥3\ge3 variables, leaving "synergy versus redundancy" decompositions (the partial information decomposition of Williams & Beer, 2010) without a fully agreed-upon definition; (iv) MI as a representation-learning objective is invariant to any invertible map, so maximizing it alone cannot prefer "useful" representations — a tension that current theory only partially resolves.

See Also

Shannon Entropy · Kullback–Leibler Divergence · Conditional Entropy · Channel Capacity · Rate–Distortion Theory · Information Bottleneck Method · Fisher Information · Data Processing Inequality · Total Correlation · Differential Entropy