Motivation
Conditional distributions describe the distribution of one random variable given that another has a specific value. This is fundamental to regression, prediction, and Bayesian inference.
Discrete Case
Conditional PMF
pY∣X(y∣x)=P(Y=y∣X=x)=pX(x)p(x,y)
provided pX(x)>0.
Properties
For fixed x with pX(x)>0, pY∣X(y∣x) is a valid PMF:
- pY∣X(y∣x)≥0
- ∑ypY∣X(y∣x)=pX(x)∑yp(x,y)=pX(x)pX(x)=1
Example: Dice Game
Roll two dice: X = first die, Y = second die. Joint: p(x,y)=361.
Given X+Y=7, what is the distribution of X?
Let S=X+Y. We want pX∣S(x∣7).
Possible pairs with sum 7: (1,6),(2,5),(3,4),(4,3),(5,2),(6,1).
P(S=7)=366=61
pX∣S(x∣7)=P(X=x∣S=7)=61 for x=1,…,6
Given the sum is 7, the first die is equally likely to be any value 1 through 6.
Continuous Case
Conditional PDF
fY∣X(y∣x)=fX(x)f(x,y)
provided fX(x)>0.
Interpretation
fY∣X(y∣x) gives the density of Y given that X takes value x.
Example
f(x,y)=2e−xe−2y for x,y>0.
We found fX(x)=e−x.
fY∣X(y∣x)=e−x2e−xe−2y=2e−2y
The conditional distribution of Y given X=x is Exp(2), independent of x. This confirms X and Y are independent.
Conditional Expectation
The conditional expectation of Y given X=x:
E[Y∣X=x]=∑yy⋅pY∣X(y∣x)(discrete)
E[Y∣X=x]=∫y⋅fY∣X(y∣x)dy(continuous)
Example
From the example above: E[Y∣X=x]=E[Exp(2)]=21.
The conditional expectation is constant (doesn’t depend on x) when X and Y are independent.
Law of Total Expectation
E[Y]=E[E[Y∣X]]
More explicitly:
E[Y]=∑xE[Y∣X=x]⋅pX(x)(discrete)
E[Y]=∫E[Y∣X=x]⋅fX(x)dx(continuous)
Application
This law lets us compute E[Y] by conditioning on X, often simplifying complex problems.
Example
X∼Pois(λ) and given X=n, Y∼Bin(n,p).
Find E[Y].
By law of total expectation:
E[Y]=E[E[Y∣X]]=E[X⋅p]=pE[X]=pλ
Conditional Variance
Var(Y∣X=x)=E[Y2∣X=x]−(E[Y∣X=x])2
Summary
| Concept | Discrete | Continuous |
|---|
| Conditional PMF/PDF | pX(x)p(x,y) | fX(x)f(x,y) |
| Conditional expectation | $\sum_y y \cdot p_{Y | X}(y |
| Law of total expectation | $E[E[Y | X]]$ |