UNIHIVE

Study Hub UNIPORT MTH 260

MTH 260 · Probability and Statistics

Conditional distributions and conditional expectation

The distribution of one variable given another, E(Y

Our notes

2 min read

Conditional distribution

For discrete variables: p(y | x) = p(x, y) / p_X(x).
From the tutorial table in the last topic:

  • Given X = 1 (attended): P(Y = 2 | X = 1) = 0.2/0.6 = 1/3, P(Y = 4 | X = 1) = 0.4/0.6 = 2/3.
  • Given X = 0: P(Y = 2 | X = 0) = 0.3/0.4 = 3/4, P(Y = 4 | X = 0) = 1/4.

For continuous variables: f(y | x) = f(x, y) / f_X(x).

Conditional expectation

E(Y | X = x) = Σ y p(y | x) (or ∫ y f(y | x) dy).

  • E(Y | X = 1) = 2(1/3) + 4(2/3) = 10/3 ≈ 3.33.
  • E(Y | X = 0) = 2(3/4) + 4(1/4) = 2.5.

So E(Y | X) is itself a random variable: a function of X. The regression of Y on X is exactly E(Y | X = x).

Law of total expectation

E(Y) = E[E(Y | X)] = Σ E(Y | X = x) p_X(x).
Check: 3.33 × 0.6 + 2.5 × 0.4 = 2.0 + 1.0 = 3.0, which equals E(Y) from the marginal (0.5 × 2 + 0.5 × 4 = 3). ✓

Law of total variance

Var(Y) = E[Var(Y | X)] + Var[E(Y | X)].
The variation inside the groups plus the variation between group means: the same idea as analysis of variance.

  • Var(Y | X = 1): E(Y² | X = 1) = 4(1/3) + 16(2/3) = 12; minus (10/3)² = 100/9; gives 8/9.
  • Var(Y | X = 0): 4(3/4) + 16(1/4) = 7; minus 6.25 = 0.75.
  • E[Var(Y | X)] = 0.6(8/9) + 0.4(0.75) = 0.5333 + 0.3 = 0.8333.
  • Var[E(Y | X)] = 0.6(10/3 − 3)² + 0.4(2.5 − 3)² = 0.0667 + 0.1 = 0.1667.
  • Sum = 1.0. Directly: Var(Y) = E(Y²) − 9 = (0.5 × 4 + 0.5 × 16) − 9 = 1. ✓

Where it is used

  • Predicting the best guess of Y once X is known (least mean square error).
  • Splitting a problem into cases: expected repair cost = Σ (expected cost given fault type) × P(fault type).
  • Random sums: if N calls arrive and each lasts X minutes on average, E(total) = E(N) E(X) when N and the Xs are independent.

Exams usually ask

  • Conditional distribution and conditional mean from a joint table or pdf.
  • Verify E(Y) = E[E(Y | X)].

Common mistake

Dividing by the wrong marginal. For p(y | x) divide by the total for that x (the row total when x indexes rows).

Written by the UniHive team in our own words. Spotted a mistake? Tell us on WhatsApp.

Read

Watch

We link to free material and never copy it. Every link was opened by our team before it went up; video data is a rough guide at 360p.

All MTH 260 topics

Report

Sign in to report this. It is free.

Is this your work (a lecturer, author or publisher)? Ask us to take it down.