Two binary variables X and Y have the joint distribution P(0,0)=P(1,1)=0.4 and P(0,1)=P(1,0)=0.1. What is the mutual information I(X;Y) in bits, and what would it be if X and Y were independent?

Probability and statistics, Information theory
Level L2 Elementary. Length Medium. Nature Mat Mathematical.

What's being asked

Whether you can compute mutual information from a joint table as a KL divergence from the product of the marginals.

Key idea

I(X;Y)=∑x,yP(x,y)log⁡2P(x,y)P(x)P(y)=DKL(PXY ∥ PXPY).

Steps

  1. Find the marginals. P(X=0)=0.4+0.1=0.5, and the same for X=1, Y=0 and Y=1. So P(x)P(y)=0.25 in every cell.
  2. Diagonal cells: P=0.4, ratio 0.4/0.25=1.6, so each contributes 0.4log⁡21.6=0.4×0.678=0.2712.
  3. Off-diagonal cells: P=0.1, ratio 0.1/0.25=0.4, so each contributes 0.1log⁡20.4=0.1×(−1.322)=−0.1322.
  4. Add the four terms: 2(0.2712)+2(−0.1322)=0.2781. So I(X;Y)≈0.278 bits.
  5. If independent, P(x,y)=P(x)P(y) in every cell, every log is log⁡21=0, and I(X;Y)=0.
  6. Check: the answer should be below H(X)=1 bit, which it is.

Common mistakes

How long your answer should be

Half a page, 3 minutes.

Last checked on 4 December 2026.

Read this

Previous in Probability and statistics: Let p=(12,14,14) and q=(13,13,13) on three outcomes. Compute H(p), the cross-entropy H(p,q), and both DKL(p∥q) and DKL(q∥p) in bits. What do the numbers show?
Next in Probability and statistics: A classifier's accuracy is measured on n=16 independent random splits, giving a sample mean of 72% and sample standard deviation of 8%. Give a 95% confidence interval for the true mean accuracy, using t15, 0.975=2.131. Why not use 1.96?