Week 1.3: Conditional Distributions
1213 words
6 min read
Visual companion
Python
Type and operator map
Python Week 1: the first filter for runtime behavior
View
Revision summary
What this note is really saying
Short form
# Week 1.3: Conditional Distributions > **Prerequisites:** Joint PMF ([Week 1.1: Joint Probability Mass Function (Joint PMF)](/notes/01-foundation-bsma1004-stats-2-week01-01-joint-pmf)), Marginal Distributions ([Week 1.2: Marginal Distributions](/notes/01-foundation-bsma1004-stats-2-week01-02-marginal-distributions)...

Week 1.3: Conditional Distributions
Prerequisites: Joint PMF (Week 1.1: Joint Probability Mass Function (Joint PMF)), Marginal Distributions (Week 1.2: Marginal Distributions) Cross-links: BSMA1002 (Stats 1) — conditional probability, Bayes' theorem Core question: How does knowing the value of one random variable change the distribution of another?
1. Intuition: Updating Beliefs
In Statistics 1, you learned conditional probability: P(A∣B)=P(B)P(A∩B). Conditional distributions extend this idea to random variables.
When we observe X=x, our uncertainty about Y updates — the conditional distribution Y∣X=x replaces the unconditional (marginal) distribution of Y. This is the foundation of prediction and Bayesian inference.
Example: In the IPL over, before seeing wickets we expect ~6-7 runs. But if we learn Y=2 (two wickets fallen), our expectation drops to ~3 runs.
2. Conditional Distribution Given an Event
First, we review the simpler case: conditioning on an event A.
>fX∣A(t)=P(X=t∣A)=P(A)P((X=t)∩A),t∈TX.>Definition (Conditional PMF given an event) Let X be discrete with range TX, and A an event with P(A)>0. The conditional PMF of X given A is
Key properties:
- fX∣A is a valid PMF: ∑t∈TXfX∣A(t)=1
- The range of (X∣A) may differ from TX (some values may become impossible)
3. Conditional Distribution of Y Given X=x
>fY∣X=x(y)=P(Y=y∣X=x)=fX(x)fXY(x,y),y∈TY.>Definition (Conditional PMF) Let X,Y have joint PMF fXY. For any x∈TX with fX(x)>0, the conditional PMF of Y given X=x is
Similarly, the conditional PMF of X given Y=y is
>fX∣Y=y(x)=fY(y)fXY(x,y),fY(y)>0.>
Implications:
- The joint PMF factorises as fXY(x,y)=fX(x)⋅fY∣X=x(y)
- If X and Y are independent, fY∣X=x(y)=fY(y) — conditioning does nothing
4. Worked Examples
Example 1: Fair Coin Tossed Twice
From the joint PMF table:
| X2\X1 | 0 | 1 |
|---|---|---|
| 0 | 1/4 | 1/4 |
| 1 | 1/4 | 1/4 |
Compute fX2∣X1=0(y):
This equals the marginal fX2 — as expected since X1 and X2 are independent.
Example 2: Random 2-Digit Number
From the joint PMF table, compute fY∣X=0(y):
fX(0)=1/10, and only Y=0 and Y=2 have non-zero joint probability with X=0:
So if we see the units digit is 0, the remainder modulo 4 is equally likely 0 or 2 — it cannot be 1 or 3.
Example 3: Die Roll + Coin Tosses (Hierarchical)
X∼Uniform{1,…,6}, (Y∣X=t)∼Binomial(t,1/2).
The conditional PMF is given in the problem statement itself:
But what about the reverse conditional: fX∣Y=y(x)? Using Bayes' theorem:
For example, if we observed Y=3 heads, what's the probability the die showed X=4?
First compute fY(3):
Now:
5. Conditional Distributions for Multiple RVs
For n random variables, we can condition on any subset. The key idea: factorise the joint PMF as a product of conditionals:
This chain rule of probability can be applied in any order.
Example: For X1,X2,X3,X4:
6. Mermaid Flowchart: Choosing the Right Distribution
(Diagram)
7. Formula Summary
| Concept | Formula | When to Use |
|---|---|---|
| Conditional PMF | fY∣X=x(y)=fX(x)fXY(x,y) | Need distribution of Y after observing X=x |
| Factorisation | fXY(x,y)=fX(x)⋅fY∣X=x(y) | Building joint from conditionals |
| Chain rule (n RVs) | f=fX1∣X2,…,Xn⋅fX2∣X3,…,Xn⋯fXn | Factorising high-dimensional joints |
| Bayes for RVs | fX∣Y=y(x)=fY(y)fY∣X=x(y)fX(x) | Reversing the conditioning |
8. Practice Questions
Q1 (Easy)
From the joint PMF below, find fY∣X=1(y).
| Y\X | 0 | 1 |
|---|---|---|
| 0 | 0.3 | 0.2 |
| 1 | 0.1 | 0.4 |
>fY∣X=1(0)=0.60.2=31,fY∣X=1(1)=0.60.4=32.>Full SolutionfX(1)=0.2+0.4=0.6
Check: 1/3+2/3=1. ✓
Q2 (Medium)
For the same table, find fX∣Y=0(x). Compare with fX(x).
>fX∣Y=0(0)=0.50.3=0.6,fX∣Y=0(1)=0.50.2=0.4.>Full SolutionfY(0)=0.3+0.2=0.5
Marginal: fX(0)=0.4, fX(1)=0.6. These are different from the conditionals, confirming X and Y are dependent.
Q3 (Hard — IPL)
For the IPL example, find fY∣X=10(y).
>fX(10)=fXY(10,0)+fXY(10,1)+fXY(10,2)=1613⋅71+81⋅71+161⋅71=11216=71.>Full SolutionFirst compute fX(10):
>fY∣X=10(0)=1/713/112=1613,fY∣X=10(1)=1/71/56=81,fY∣X=10(2)=1/71/112=161.>Now:
So Y∣X=10 has the same distribution as the marginal of Y — interestingly, X=10 gives no extra info about Y in this model!
Next topic: Week 1.4: Multiple Random Variables (n > 2) — Extending to more than two random variables. Join Discord PreviousWeek 1.2: Marginal DistributionsNextWeek 1.4: Multiple Random Variables (n > 2)