Foundations to Frontier
Tests
A. Mathematical Foundations › A7 Information Theory

Mutual Information

Mutual information I(X;Y) is the number of bits one variable tells you about another: the drop in uncertainty about X once Y is known. It is symmetric, non-negative, zero exactly under independence, and catches nonlinear dependence that correlation misses. You will compute it from tables and entropies, derive the Gaussian formula, estimate it from samples, meet conditional MI and its chain rule, and use expected information gain to point a rover's sensors where they will learn the most.

Level 0: Foundation

★☆☆☆☆ Introductory⏱ 5 minGeneral audience. No mathematics required.

How much does one thing tell you about another?

If I tell you it’s raining, you learn something about whether people carry umbrellas. Mutual information counts how many bits of uncertainty about one thing disappear when you learn the other. If they’re unrelated, it’s zero. If one completely determines the other, it’s all the uncertainty there was.

Mutual information sees what correlation misses
correlation ρ = -0.035 · MI (histogram, 12×12 bins) ≈ 1.71 bits (Miller–Madow corrected 1.65)
Correlation only measures linear dependence. The parabola and the ring have ρ ≈ 0, yet knowing x tells you a lot about y, and mutual information shows it. With independent data the true MI is 0, but the plug-in estimate is slightly positive: binning bias of about (B−1)²/(2N ln 2) bits, which the correction removes. More noise means less information.
Why engineers care

Mutual information decides which sensor to point where (active perception), which features to keep, how much a channel can carry, and how to align images from different instruments. It’s also the training signal behind contrastive representation learning.

📝 Quick check (Level 0)
0/3 answered
  1. 1. If X and Y are independent, I(X;Y) is…
  2. 2. Is I(X;Y) the same as I(Y;X)?
  3. 3. Can MI detect a U-shaped relationship that has zero correlation?

Level 1: Beginner

★★☆☆☆ Basic⏱ 20 minSecondary-school mathematics: arithmetic and elementary algebra.

Definition

I(X;Y)=∑x,yp(x,y)log⁡p(x,y)p(x)p(y)=KL⁡(pXY ∥ pXpY)I(X;Y) = \sum_{x,y}p(x, y)\log\frac{p(x, y)}{p(x)p(y)} = \operatorname{KL}(p_{XY}\,\|\,p_Xp_Y)

It’s the KL divergence from the joint to the product of marginals: how far the variables are from independence.

In terms of entropy

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

Hence 0≤I(X;Y)≤min⁡(H(X),H(Y))0\le I(X;Y)\le\min(H(X), H(Y)) and I(X;X)=H(X)I(X;X) = H(X).

Pointwise MI

pmi⁡(x,y)=log⁡p(x,y)p(x)p(y)\operatorname{pmi}(x, y) = \log\frac{p(x, y)}{p(x)p(y)} can be negative for an individual pair. MI is its average, which is never negative.

📝 Quick check (Level 1)
0/3 answered
  1. 1. H(X) = 1.5, H(Y) = 1.2, H(X, Y) = 2.2 bits. I(X;Y) =
  2. 2. I(X;Y) = KL between…
  3. 3. The MI of a perfectly copied fair bit with itself is…

Level 2: Intermediate

★★★☆☆ Intermediate⏱ 40 minUndergraduate students and practising engineers.

Gaussian MI

For jointly Gaussian variables with correlation ρ\rho:

I(X;Y)=−12log⁡(1−ρ2)I(X;Y) = -\tfrac12\log(1 - \rho^2)

In dd dimensions, I=12log⁡∣ΣX∣∣ΣY∣∣Σ∣I = \frac12\log\frac{|\Sigma_X||\Sigma_Y|}{|\Sigma|}. For Gaussians, MI and correlation tell the same story. Outside the Gaussian world they don’t.

Conditional MI and the chain rule

I(X;Y∣Z)=H(X∣Z)−H(X∣Y,Z),I(X;Y1,Y2)=I(X;Y1)+I(X;Y2∣Y1)I(X;Y\mid Z) = H(X\mid Z) - H(X\mid Y, Z),\qquad I(X;Y_1, Y_2) = I(X;Y_1) + I(X;Y_2\mid Y_1)

Conditioning can raise or lower MI. In the XOR example, Z=X⊕YZ = X\oplus Y: I(X;Y)=0I(X;Y) = 0 but I(X;Y∣Z)=1I(X;Y\mid Z) = 1 bit.

Estimating MI from samples

  • Plug-in (histogram): simple, but biased upward by roughly (Bx−1)(By−1)/(2N)(B_x - 1)(B_y - 1)/(2N) nats.
  • KSG k-nearest-neighbour estimator (Kraskov, Stögbauer and Grassberger, 2004): better for continuous data.
  • Variational bounds (MINE, InfoNCE): for high-dimensional data. InfoNCE is capped at log⁡\log (batch size).
🐍 Exercise 1: computing and estimating MI
Compute MI from a joint table, check its identities (entropy form, symmetry, independence, I(X;X) = H(X)), implement the Gaussian formula and a histogram estimator, and show that MI detects a nonlinear dependence that correlation misses.
📝 Quick check (Level 2)
0/3 answered
  1. 1. Gaussian MI with ρ = 0.9 (bits) ≈
  2. 2. Histogram MI estimates are biased…
  3. 3. With Z = X XOR Y for independent fair bits, I(X;Y | Z) =

Level 3: Advanced

★★★★☆ Advanced⏱ 40 minGraduate level, with full derivations and proofs.

Proofs

  • Non-negativity: I=KL⁡(pXY ∥ pXpY)≥0I = \operatorname{KL}(p_{XY}\,\|\,p_Xp_Y)\ge0 by Gibbs, with equality iff pXY=pXpYp_{XY} = p_Xp_Y.
  • “Conditioning reduces entropy”: H(X∣Y)≤H(X)H(X\mid Y)\le H(X) follows at once, on average. For a specific yy, H(X∣Y=y)H(X\mid Y = y) can exceed H(X)H(X).
  • Entropy form: log⁡p(x,y)p(x)p(y)=log⁡p(x∣y)p(x)\log\frac{p(x, y)}{p(x)p(y)} = \log\frac{p(x\mid y)}{p(x)}. Take the expectation: −H(X∣Y)+H(X)-H(X\mid Y) + H(X). ∎

Gaussian derivation

I=h(X)+h(Y)−h(X,Y)I = h(X) + h(Y) - h(X, Y) with h=12log⁡((2πe)d∣Σ∣)h = \frac12\log((2\pi e)^d|\Sigma|). The 2πe2\pi e factors cancel, leaving 12log⁡σx2σy2σx2σy2(1−ρ2)\frac12\log\frac{\sigma_x^2\sigma_y^2}{\sigma_x^2\sigma_y^2(1 - \rho^2)}. ∎

Binary symmetric channel

Input X∼Bern⁡(p)X\sim\operatorname{Bern}(p), flip probability ε\varepsilon: I=h2(p(1−ε)+(1−p)ε)−h2(ε)I = h_2(p(1 - \varepsilon) + (1 - p)\varepsilon) - h_2(\varepsilon). It’s maximized at p=12p = \frac12, giving 1−h2(ε)1 - h_2(\varepsilon), the capacity (A7-8).

Exercise 3.1: BSC with ε = 0.11, fair input

h2(0.11)≈0.5h_2(0.11)\approx0.5, so I≈0.5I\approx0.5 bits per use.

📝 Quick check (Level 3)
0/3 answered
  1. 1. I(X;Y) ≥ 0 follows from…
  2. 2. H(X | Y = y) can exceed H(X) for a particular y?
  3. 3. The BSC's MI is maximized by input probability…

Level 4: Expert

★★★★★ Expert⏱ 35 minResearchers: original papers and open problems.

Active perception: look where you’ll learn the most

A rover hunts for a buried ice target among 16 candidate cells. Orbital data gives a prior. Each look at one cell detects the target with probability 0.8 and false-alarms with probability 0.1. The expected information gain of looking at a cell is

IG⁡(c)=H(b)−EzH(b∣z)=I(target;zc)\operatorname{IG}(c) = H(b) - \mathbb E_z H(b\mid z) = I(\text{target};z_c)

Greedily picking the most informative cell (Bayesian search theory; Krause and Guestrin, 2005) shrinks the remaining entropy far faster than a fixed sweep. Under a monotone submodular objective, greedy selection is within 1−1/e1 - 1/e of optimal (Nemhauser, Wolsey and Fisher, 1978).

🐍 Exercise 2 (research): sensor tasking by information gain
Compute the expected information gain of each look, verify that it equals I(target; observation), and compare greedy information-gain search with a fixed sweep: compare the remaining entropy and the localization rate after 10 looks.

Mutual information in AI, robotics and aerospace

  • Active perception and exploration: information-gain next-best-view planning and MI-based exploration mapping (Julian et al., 2014; Charrow et al., 2015).
  • Sensor placement: near-optimal greedy MI placement with Gaussian processes (Krause, Singh and Guestrin, 2008).
  • Image registration: aligning multi-modal medical and planetary images by maximizing MI (Viola and Wells, 1997).
  • Representation learning: InfoNCE and contrastive learning maximize a lower bound on MI (van den Oord et al., 2018).
  • Feature selection: mRMR (Peng et al., 2005).

References

  1. T. Cover, J. Thomas (2006). Elements of Information Theory, 2nd ed. Wiley. Ch. 2, 8.
  2. A. Kraskov, H. Stögbauer, P. Grassberger (2004). “Estimating mutual information.” Physical Review E, 69, 066138.
  3. A. Krause, A. Singh, C. Guestrin (2008). “Near-optimal sensor placements in Gaussian processes.” JMLR, 9.
  4. G. Nemhauser, L. Wolsey, M. Fisher (1978). “An analysis of approximations for maximizing submodular set functions.” Mathematical Programming, 14.
  5. B. Julian, S. Karaman, D. Rus (2014). “On mutual information-based control of range sensing robots for mapping applications.” IJRR, 33(10).
  6. B. Charrow et al. (2015). “Information-theoretic planning with trajectory optimization for dense 3D mapping.” RSS.
  7. P. Viola, W. Wells (1997). “Alignment by maximization of mutual information.” IJCV, 24(2).
  8. A. van den Oord, Y. Li, O. Vinyals (2018). “Representation learning with contrastive predictive coding.” arXiv:1807.03748.
  9. M. Belghazi et al. (2018). “Mutual information neural estimation.” ICML.
  10. H. Peng, F. Long, C. Ding (2005). “Feature selection based on mutual information.” IEEE TPAMI, 27(8).