← 🔗 Joint Distributions, Covariance & Conditional Expectation
Subtopic 1 of 3

5.1Joint and marginal distributions, independence of variables

The idea

A joint distribution describes two random variables at once, usually as a table. Marginals are the row and column totals. The variables are independent when every cell equals the product of its margins.

Think of it like this: A table of students by (height class, weight class): the row totals describe height alone, the column totals describe weight alone.

Why it exists

Joint tables lead to covariance, correlation and independence tests of random variables.

How it works

  1. Fill the table p(x, y) = P(X = x, Y = y); all cells add to 1.
  2. Marginal p_X(x) = the row sum; p_Y(y) = the column sum.
  3. Independent ⇔ p(x, y) = p_X(x) p_Y(y) for every cell.
  4. E[XY] = Σ x y p(x, y).
  5. One cell that does not match is enough to show dependence.

Worked example: The independent preset

Row totals 0.2, 0.3, 0.5 and column totals 0.2, 0.4, 0.4. Every cell equals (row total) × (column total), for instance p(0, 0) = 0.2 × 0.2 = 0.04. The lab confirms independence and Cov = 0.

Now play with it

  • →Load "Y = X (perfectly dependent)" and see the independence check fail.
  • →Edit one cell of the independent table and watch the check break.
P(X = i, Y = j)Y = 0Y = 1Y = 2P(X = i)
X = 00.2
X = 10.3
X = 20.5
P(Y = j)0.20.40.41
E[X], E[Y]1.3, 1.2
E[XY]1.56
Cov(X, Y) = E[XY] − E[X]E[Y]0
correlation ρ0
Var(X + Y)1.17

✓ independent: every cell equals (row total) × (column total)

Independent ⇒ Cov = 0, but Cov = 0 does not imply independent (see the last example: Y = (X − 1)² is a function of X, yet the covariance is 0). Always Var(X + Y) = Var X + Var Y + 2Cov(X, Y).

P(X = i, Y = j)Y = 0Y = 1Y = 2P(X = i)
X = 00.3
X = 10.4
X = 20.3
P(Y = j)0.30.40.31
E[X], E[Y]1, 1
E[XY]1.6
Cov(X, Y) = E[XY] − E[X]E[Y]0.6
correlation ρ1
Var(X + Y)2.4

✗ not independent: some cell differs from (row total) × (column total)

Independent ⇒ Cov = 0, but Cov = 0 does not imply independent (see the last example: Y = (X − 1)² is a function of X, yet the covariance is 0). Always Var(X + Y) = Var X + Var Y + 2Cov(X, Y).

Check yourself

The table has P(X = 0, Y = 0) = 0.3 while P(X = 0) = 0.5 and P(Y = 0) = 0.5. Are X and Y independent?

Remember: Independent ⇔ every cell = (row total) × (column total).
Exam notes (the dense version)

The joint PMF p(x, y) = P(X = x, Y = y). Marginals are row and column sums: pₓ(x) = Σᵧ p(x, y). X and Y are independent iff p(x, y) = pₓ(x) pᵧ(y) for every cell, equivalently the table is the product of its margins.

Previous year questions: Joint Distributions, Covariance & Conditional Expectation (2)

PYQs are grouped by topic, so this is the full set for Joint Distributions, Covariance & Conditional Expectation; try the ones that match this subtopic. Open all 2 on the topic page.