Conditional distribution
Definition taught in Joint distributions, part of Probability
Conditional distribution

| Type | Definition |
| Taught in | Joint distributions |
| Part | Probability |
| Properties | 1 |
| Worked examples | 2 |
| Questions using it | 1 |
If X and Y are both discrete or both continuous, and f_X(x)>0, the conditional mass function or density of Y given X=x is
f_{Y\mid X}(y\mid x)=\frac{f_{X,Y}(x,y)}{f_X(x)}.
Properties
Tower property
Main article: Tower property
If the expectations exist, then \mathbb{E}\bigl(\mathbb{E}(Y\mid X)\bigr)=\mathbb{E} Y. More generally, \mathbb{E}\bigl(\mathbb{E}(Y\mid X,Z)\mid X\bigr)=\mathbb{E}(Y\mid X).
Examples
A uniform point on a triangle
Worked example from Joint distributions
A point (X,Y) is drawn uniformly from the 10 lattice points with 1\le x\le y\le4, so each has probability 1/10.
Question. Find the marginals, the conditional distribution of Y given X=x, and \mathbb{E}(Y\mid X). Check the tower property, and find the correlation.
Solution. For a given x there are 5-x admissible values of y, and for a given y there are y values of x, so
f_X(x)=\frac{5-x}{10},\qquad f_Y(y)=\frac{y}{10},\qquad x,y\in\{1,2,3,4\}.
X and Y are dependent: given X=2, Y can only be 2, 3 or 4. The conditional mass function is
f_{Y\mid X}(y\mid x)=\frac{1/10}{(5-x)/10}=\frac1{5-x},\qquad y=x,\ldots,4,
uniform on the admissible values. So \mathbb{E}(Y\mid X=x)=(x+4)/2. Averaging over X,
\mathbb{E}\bigl(\mathbb{E}(Y\mid X)\bigr)=\tfrac52\cdot\tfrac4{10}+3\cdot\tfrac3{10}+\tfrac72\cdot\tfrac2{10}+4\cdot\tfrac1{10}=3,
which agrees with \mathbb{E} Y=(1+4+9+16)/10=3. For the correlation, \mathbb{E} X=2, \mathbb{E}(XY)=13/2 and both variances are 1, so \operatorname{Cov}(X,Y)=13/2-6=1/2 and \rho(X,Y)=1/2. A larger X forces a larger Y.
A point in a triangle
Question page: A point in a triangle
A point (X,Y) is drawn from the triangle with vertices (0,0), (1,0) and (1,1) by this rule: draw X uniformly from [0,1], then draw Y uniformly from [0,X].
Give the conditional density of Y given X=x, and say where it is zero.
Find the joint density of (X,Y).
Find the marginal density of Y.
Given X=x, Y is uniform on [0,x], so f_{Y\mid X}(y\mid x)=1/x for 0\le y\le x and 0 otherwise.
By the product rule for densities,
f_{X,Y}(x,y)=f_X(x)\,f_{Y\mid X}(y\mid x)=\frac1x,\qquad 0\le y\le x\le1,
and zero elsewhere. The point is not uniform on the triangle, whose uniform density would be the constant 2: it is crowded towards the vertex at the origin, where the thin vertical slices are.
- Integrating out x,
f_Y(y)=\int_y^1\frac{\,\mathrm{d} x}x=-\log y,\qquad 0<y<1.
Used in
- Taught in Joint distributions, where the derivation and examples are.
- Questions that use it (1) — A point in a triangle
- All 8 questions on Joint distributions
See also
Discrete distribution · Joint probability mass function · Independent random variables · Joint probability density · Covariance · Expectation vector and covariance matrix · Tower property