What is a conditional distribution?
A conditional distribution updates the distribution of one random variable after we learn information about another. The guiding question is: after we know $Y=y$, how is $X$ distributed?
$p_{X|Y}(x|y)=P(X=x\mid Y=y)$.
$f_{X|Y}(x|y)=f_{X,Y}(x,y)/f_Y(y)$.
$E[X]=E(E[X\mid Y])$.
Conditional PMF from a joint probability table
Edit the joint table below. The page normalizes the entries to form a joint PMF, then computes marginals and a conditional distribution such as $P(X=x\mid Y=y)$.
| $Y=0$ | $Y=1$ | $Y=2$ |
|---|
Blue bars show the marginal distribution of $X$; green bars show the conditional distribution of $X$ after observing the selected value of $Y$.
Continuous conditional density on a triangle
Let $(X,Y)$ be uniformly distributed on the triangle $0 The vertical slice at the selected $x$ is the conditional support for $Y\mid X=x$.
This example shows why conditional expectation and conditional variance are powerful.
First choose a hidden random probability $U\sim\operatorname{Uniform}(0,1)$, then run $n$ Bernoulli trials with success probability $U$.
The unconditional distribution of $S$ is much more spread out than a single binomial distribution with fixed $p=1/2$.
Suppose $(X,Y)$ is standard bivariate normal with correlation $\rho$.
Then the conditional distribution of $Y$ given $X=x$ is normal.
Learning $X=x$ shifts the conditional mean and reduces uncertainty when $|\rho|$ is large. The curve is the conditional density of $Y\mid X=x$.
Start with a stick of length 1, break it uniformly, and keep the longer piece $L_1$.
If $L_1=\ell$, breaking again and keeping the longer piece gives $L_2=\ell M$, where $M$ has the same distribution as the longer piece from a unit stick.
The histogram is a simulation of $L_2\mid L_1=\ell$; it is uniform on $[\ell/2,\ell]$. If $P(X=1,Y=2)=0.12$ and $P(Y=2)=0.30$, what is $P(X=1\mid Y=2)$? If $E[X\mid Y]=2Y+1$ and $E[Y]=3$, what is $E[X]$?
Suggested order: start with the discrete table, emphasize normalization by the marginal;
then show continuous slicing; then connect to conditional expectation and variance through the
random-$U$ binomial and stick-breaking examples.
Random success probability: $S\mid U=u\sim \operatorname{Bin}(n,u)$
Conditional distribution in the bivariate normal model
Conditional expectation in stick breaking
Quick checks
1. Conditional PMF
2. Total expectation
Teaching notes