Quiz 2
Registry Synced

Week 1.3: Conditional Distributions

1213 words
6 min read

Reading compass

Now · 1. Intuition: Updating Beliefs

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(AB)=P(AB)P(B)\mathbb{P}(A \mid B) = \frac{\mathbb{P}(A \cap B)}{\mathbb{P}(B)}. Conditional distributions extend this idea to random variables. When we observe X=xX = x, our uncertainty about YY updates — the conditional distribution YX=xY \mid X = x replaces the unconditional (marginal) distribution of YY. 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=2Y = 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 AA.
Definition (Conditional PMF given an event) Let XX be discrete with range TXT_X, and AA an event with P(A)>0\mathbb{P}(A) > 0. The conditional PMF of XX given AA is
>fXA(t)=P(X=tA)=P((X=t)A)P(A),tTX.>> f_{X \mid A}(t) = \mathbb{P}(X = t \mid A) = \frac{\mathbb{P}((X = t) \cap A)}{\mathbb{P}(A)}, \quad t \in T_X. >
Key properties:
  • fXAf_{X \mid A} is a valid PMF: tTXfXA(t)=1\sum_{t \in T_X} f_{X \mid A}(t) = 1
  • The range of (XA)(X \mid A) may differ from TXT_X (some values may become impossible)

3. Conditional Distribution of YY Given X=xX = x

Definition (Conditional PMF) Let X,YX, Y have joint PMF fXYf_{XY}. For any xTXx \in T_X with fX(x)>0f_X(x) > 0, the conditional PMF of YY given X=xX = x is
>fYX=x(y)=P(Y=yX=x)=fXY(x,y)fX(x),yTY.>> f_{Y \mid X = x}(y) = \mathbb{P}(Y = y \mid X = x) = \frac{f_{XY}(x, y)}{f_X(x)}, \quad y \in T_Y. >
Similarly, the conditional PMF of XX given Y=yY = y is
>fXY=y(x)=fXY(x,y)fY(y),fY(y)>0.>> f_{X \mid Y = y}(x) = \frac{f_{XY}(x, y)}{f_Y(y)}, \quad f_Y(y) > 0. >
Implications:
  • The joint PMF factorises as fXY(x,y)=fX(x)fYX=x(y)f_{XY}(x,y) = f_X(x) \cdot f_{Y \mid X = x}(y)
  • If XX and YY are independent, fYX=x(y)=fY(y)f_{Y \mid X = x}(y) = f_Y(y) — conditioning does nothing

4. Worked Examples

Example 1: Fair Coin Tossed Twice

From the joint PMF table:
X2\X1X_2 \backslash X_101
01/41/4
11/41/4
Compute fX2X1=0(y)f_{X_2 \mid X_1 = 0}(y):
fX2X1=0(0)=fX1X2(0,0)fX1(0)=1/41/2=12,fX2X1=0(1)=1/41/2=12.f_{X_2 \mid X_1 = 0}(0) = \frac{f_{X_1X_2}(0,0)}{f_{X_1}(0)} = \frac{1/4}{1/2} = \frac{1}{2}, \quad f_{X_2 \mid X_1 = 0}(1) = \frac{1/4}{1/2} = \frac{1}{2}.
This equals the marginal fX2f_{X_2} — as expected since X1X_1 and X2X_2 are independent.

Example 2: Random 2-Digit Number

From the joint PMF table, compute fYX=0(y)f_{Y \mid X = 0}(y): fX(0)=1/10f_X(0) = 1/10, and only Y=0Y=0 and Y=2Y=2 have non-zero joint probability with X=0X=0:
fYX=0(0)=1/201/10=12,fYX=0(2)=1/201/10=12,fYX=0(1)=fYX=0(3)=0.f_{Y \mid X=0}(0) = \frac{1/20}{1/10} = \frac{1}{2}, \quad f_{Y \mid X=0}(2) = \frac{1/20}{1/10} = \frac{1}{2}, \quad f_{Y \mid X=0}(1) = f_{Y \mid X=0}(3) = 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)

XUniform{1,,6}X \sim \text{Uniform}\{1,\dots,6\}, (YX=t)Binomial(t,1/2)(Y \mid X=t) \sim \text{Binomial}(t, 1/2). The conditional PMF is given in the problem statement itself:
fYX=t(y)=(ty)(12)t,y=0,1,,t.f_{Y \mid X = t}(y) = \binom{t}{y} \left(\frac{1}{2}\right)^t, \quad y = 0,1,\dots,t.
But what about the reverse conditional: fXY=y(x)f_{X \mid Y = y}(x)? Using Bayes' theorem:
fXY=y(x)=fYX=x(y)fX(x)fY(y)=(xy)(1/2)x(1/6)fY(y).f_{X \mid Y = y}(x) = \frac{f_{Y \mid X = x}(y) \cdot f_X(x)}{f_Y(y)} = \frac{\binom{x}{y}(1/2)^x \cdot (1/6)}{f_Y(y)}.
For example, if we observed Y=3Y = 3 heads, what's the probability the die showed X=4X = 4? First compute fY(3)f_Y(3):
fY(3)=t=16fXY(t,3)=t=3616(t3)(12)t=16[(33)18+(43)116+(53)132+(63)164]=16[18+416+1032+2064]=16[864+1664+2064+2064]=166464=16.\begin{aligned} f_Y(3) &= \sum_{t=1}^6 f_{XY}(t,3) = \sum_{t=3}^6 \frac{1}{6} \binom{t}{3} \left(\frac{1}{2}\right)^t \\ &= \frac{1}{6} \left[ \binom{3}{3}\frac{1}{8} + \binom{4}{3}\frac{1}{16} + \binom{5}{3}\frac{1}{32} + \binom{6}{3}\frac{1}{64} \right] \\ &= \frac{1}{6} \left[ \frac{1}{8} + \frac{4}{16} + \frac{10}{32} + \frac{20}{64} \right] \\ &= \frac{1}{6} \left[ \frac{8}{64} + \frac{16}{64} + \frac{20}{64} + \frac{20}{64} \right] = \frac{1}{6} \cdot \frac{64}{64} = \frac{1}{6}. \end{aligned}
Now:
fXY=3(4)=(43)(1/2)4(1/6)1/6=(43)116=416=14.f_{X \mid Y=3}(4) = \frac{\binom{4}{3}(1/2)^4 \cdot (1/6)}{1/6} = \binom{4}{3} \cdot \frac{1}{16} = \frac{4}{16} = \frac{1}{4}.

5. Conditional Distributions for Multiple RVs

For nn random variables, we can condition on any subset. The key idea: factorise the joint PMF as a product of conditionals:
fX1Xn(t1,,tn)=fX1X2=t2,,Xn=tn(t1)fX2X3=t3,,Xn=tn(t2)fXn(tn).f_{X_1\dots X_n}(t_1,\dots,t_n) = f_{X_1 \mid X_2 = t_2, \dots, X_n = t_n}(t_1) \cdot f_{X_2 \mid X_3 = t_3, \dots, X_n = t_n}(t_2) \cdots f_{X_n}(t_n).
This chain rule of probability can be applied in any order. Example: For X1,X2,X3,X4X_1, X_2, X_3, X_4:
fX1X2X3X4=fX1X2,X3,X4fX2X3,X4fX3X4fX4=fX4X3,X2,X1fX3X2,X1fX2X1fX1(same thing, different order)\begin{aligned} f_{X_1X_2X_3X_4} &= f_{X_1 \mid X_2, X_3, X_4} \cdot f_{X_2 \mid X_3, X_4} \cdot f_{X_3 \mid X_4} \cdot f_{X_4} \\ &= f_{X_4 \mid X_3, X_2, X_1} \cdot f_{X_3 \mid X_2, X_1} \cdot f_{X_2 \mid X_1} \cdot f_{X_1} \quad (\text{same thing, different order}) \end{aligned}

6. Mermaid Flowchart: Choosing the Right Distribution

(Diagram)

7. Formula Summary

ConceptFormulaWhen to Use
Conditional PMFfYX=x(y)=fXY(x,y)fX(x)f_{Y \mid X=x}(y) = \frac{f_{XY}(x,y)}{f_X(x)}Need distribution of YY after observing X=xX=x
FactorisationfXY(x,y)=fX(x)fYX=x(y)f_{XY}(x,y) = f_X(x) \cdot f_{Y \mid X=x}(y)Building joint from conditionals
Chain rule (n RVs)f=fX1X2,,XnfX2X3,,XnfXnf = f_{X_1 \mid X_2,\dots,X_n} \cdot f_{X_2 \mid X_3,\dots,X_n} \cdots f_{X_n}Factorising high-dimensional joints
Bayes for RVsfXY=y(x)=fYX=x(y)fX(x)fY(y)f_{X \mid Y=y}(x) = \frac{f_{Y \mid X=x}(y) f_X(x)}{f_Y(y)}Reversing the conditioning

8. Practice Questions

Q1 (Easy)

From the joint PMF below, find fYX=1(y)f_{Y \mid X=1}(y).
Y\XY \backslash X01
00.30.2
10.10.4
Full Solution
fX(1)=0.2+0.4=0.6f_X(1) = 0.2 + 0.4 = 0.6
>fYX=1(0)=0.20.6=13,fYX=1(1)=0.40.6=23.>> f_{Y \mid X=1}(0) = \frac{0.2}{0.6} = \frac{1}{3}, \quad f_{Y \mid X=1}(1) = \frac{0.4}{0.6} = \frac{2}{3}. >
Check: 1/3+2/3=11/3 + 2/3 = 1. ✓

Q2 (Medium)

For the same table, find fXY=0(x)f_{X \mid Y=0}(x). Compare with fX(x)f_X(x).
Full Solution
fY(0)=0.3+0.2=0.5f_Y(0) = 0.3 + 0.2 = 0.5
>fXY=0(0)=0.30.5=0.6,fXY=0(1)=0.20.5=0.4.>> f_{X \mid Y=0}(0) = \frac{0.3}{0.5} = 0.6, \quad f_{X \mid Y=0}(1) = \frac{0.2}{0.5} = 0.4. >
Marginal: fX(0)=0.4f_X(0) = 0.4, fX(1)=0.6f_X(1) = 0.6. These are different from the conditionals, confirming XX and YY are dependent.

Q3 (Hard — IPL)

For the IPL example, find fYX=10(y)f_{Y \mid X=10}(y).
Full Solution
First compute fX(10)f_X(10):
>fX(10)=fXY(10,0)+fXY(10,1)+fXY(10,2)=131617+1817+11617=16112=17.>> \begin{aligned} f_X(10) &= f_{XY}(10,0) + f_{XY}(10,1) + f_{XY}(10,2) \\ &= \frac{13}{16}\cdot\frac{1}{7} + \frac{1}{8}\cdot\frac{1}{7} + \frac{1}{16}\cdot\frac{1}{7} = \frac{16}{112} = \frac{1}{7}. \end{aligned} >
Now:
>fYX=10(0)=13/1121/7=1316,fYX=10(1)=1/561/7=18,fYX=10(2)=1/1121/7=116.>> f_{Y \mid X=10}(0) = \frac{13/112}{1/7} = \frac{13}{16}, \quad f_{Y \mid X=10}(1) = \frac{1/56}{1/7} = \frac{1}{8}, \quad f_{Y \mid X=10}(2) = \frac{1/112}{1/7} = \frac{1}{16}. >
So YX=10Y \mid X=10 has the same distribution as the marginal of YY — interestingly, X=10X=10 gives no extra info about YY in this model!

Document outline

Keep your place and jump directly to a heading.

Table of Contents
System Normal // Awaiting Context

Intelligence Hub

Navigate the knowledge graph to generate context. The Hub adapts dynamically to surface backlinks, related notes, and metadata insights.