MTH 260 · Probability and Statistics
Our notes
2 min readConditional 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
-
Conditional expectation
(opens en.wikipedia.org in a new tab)
Wikipedia, Conditional expectation, CC BY-SA 4.0 · licence
-
Law of total expectation
(opens en.wikipedia.org in a new tab)
Wikipedia, Law of total expectation, CC BY-SA 4.0 · licence
-
OpenStax, Introductory Statistics 2e (whole free textbook)
The whole book, free to read online or download as a PDF (the PDF is large: Wi-Fi).
(opens openstax.org in a new tab)
OpenStax, OpenStax, Introductory Statistics 2e (whole free textbook), CC BY-NC-SA 4.0 · licence
Watch
-
Best pick L13.2 Conditional Expectation as a Random Variable
5 min · ≈ 23 MB · about ₦13
(opens youtube.com in a new tab)
-
Marginal distribution and conditional distribution | AP Statistics | Khan Academy
7 min · ≈ 32 MB · about ₦18
(opens youtube.com in a new tab)
-
Conditional Probability Distributions
9 min · ≈ 41 MB · about ₦23
(opens youtube.com in a new tab)
-
Intro to Conditional Probability
6 min · ≈ 27 MB · about ₦15
(opens youtube.com in a new tab)
-
Mod-01 Lec-37 CONDITIONAL EXPECTATION
53 min · ≈ 239 MB · about ₦134
(opens youtube.com in a new tab)
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.