Conditional Distributions

Suppose a factory produces items with two measured traits, weight and length. These traits are statistically linked. If you learn the weight of an item, how should you update your beliefs about its length? This is the question of a conditional distribution. It is the distribution of one random variable once another has been pinned down to a specific value. It is the probabilistic engine behind regression, Bayesian updating, and every inference procedure. Such procedures use partial information to say something about the rest. The idea matters because raw joint distributions are unwieldy. Marginal distributions, meanwhile, throw away exactly the dependence structure we usually care about. Conditional distributions sit between the two. They keep the joint law intact but repackage it as a family of distributions, one for each value of the conditioning variable. This reframing turns "XX and YY are related" into a precise, computable statement. It becomes a formula you can differentiate, integrate, and simulate from. The big picture is that conditioning is really just a renormalization of probability mass or density. Restrict attention to the slice where the conditioning variable takes its observed value. Then rescale so the slice again integrates to one. This works cleanly for discrete random variables using conditional probability directly. With real analytic care about "probability zero events," it extends to continuous random variables via conditional density functions. This article builds the formal definitions of conditional PMFs and PDFs from Joint Distributions and Marginal Distributions. It proves the core consistency theorem relating joint, marginal, and conditional laws. It works through two fully computed examples with asymmetric numbers. It closes by flagging exactly where the continuous case needs extra hypotheses. Finally, it sets up the road to Conditional Expectation and the Bivariate Normal Distribution.

Key takeaways
  • The conditional PMF pY∣X(y∣x)=P(Y=y∣X=x)p_{Y|X}(y\mid x) = P(Y=y\mid X=x) is defined by ordinary conditional probability, valid whenever P(X=x)>0P(X=x)>0.
  • The conditional PDF fY∣X(y∣x)=fX,Y(x,y)/fX(x)f_{Y|X}(y\mid x) = f_{X,Y}(x,y)/f_X(x) is defined even though P(X=x)=0P(X=x)=0 for continuous XX, via a limiting/density argument.
  • For each fixed xx with positive marginal mass or density, y↦fY∣X(y∣x)y\mapsto f_{Y|X}(y\mid x) (or pY∣X(⋅∣x)p_{Y|X}(\cdot\mid x)) is itself a genuine probability distribution — it integrates or sums to 1.
  • The joint law factors as joint = marginal × conditional: fX,Y(x,y)=fX(x)fY∣X(y∣x)f_{X,Y}(x,y) = f_X(x) f_{Y|X}(y\mid x), and this factorization characterizes independence when the conditional law does not depend on xx.
  • Conditioning on a continuous variable requires fX(x)>0f_X(x) > 0 and continuity/regularity of fX,Yf_{X,Y} at xx for the pointwise definition to behave as expected — this is the Borel–Kolmogorov subtlety.
  • Key idea: conditioning is normalization — slice the joint distribution at the given value and divide by the total mass or density of that slice.

Where this lives today

Conditional distributions are the mathematical backbone of Bayesian statistics, where the posterior distribution of a parameter given data is precisely a conditional distribution, computed (up to normalization) via Bayes' rule as a ratio of a joint density to a marginal. In regression analysis, the conditional distribution of a response YY given a predictor X=xX=x underlies not just the conditional mean (the regression function) but the full predictive distribution used for prediction intervals. Markov chains and Markov processes, central to Conditional Expectation and used throughout physics and finance, are defined entirely through conditional distributions of the future state given the present state. In information theory, conditional entropy and mutual information are built from conditional distributions and measure how much a conditional law deviates from the marginal. Machine learning methods such as naive Bayes classifiers, hidden Markov models, and generative models (e.g., variational autoencoders) explicitly manipulate conditional PDFs/PMFs as their core computational object. In statistical physics, conditional distributions describe the state of a subsystem given the configuration of its environment, a precursor to the conditioning ideas needed for the Bivariate Normal Distribution and Gaussian graphical models used in signal processing.

Ask the tutor: How does the conditional density formula change when XX and YY are jointly normal, and why is the resulting conditional mean linear in xx?

DefinitionConditional PMF and Conditional PDF

Discrete case. Let X,YX, Y be discrete random variables with joint probability mass function pX,Y(x,y)=P(X=x,Y=y)p_{X,Y}(x,y) = P(X=x, Y=y) and marginal PMF pX(x)=P(X=x)p_X(x) = P(X=x). For any xx with pX(x)>0p_X(x) > 0, the conditional PMF of YY given X=xX = x is

pY∣X(y∣x)  =  P(Y=y∣X=x)  =  pX,Y(x,y)pX(x),y∈R.p_{Y\mid X}(y \mid x) \;=\; P(Y = y \mid X = x) \;=\; \frac{p_{X,Y}(x,y)}{p_X(x)}, \qquad y \in \mathbb{R}.

This is undefined when pX(x)=0p_X(x) = 0, since there is nothing to condition on.

Continuous case. Let X,YX, Y be jointly continuous random variables with joint probability density function fX,Y(x,y)f_{X,Y}(x,y) and marginal density fX(x)=∫−∞∞fX,Y(x,y) dyf_X(x) = \int_{-\infty}^{\infty} f_{X,Y}(x,y)\,dy. For any xx with fX(x)>0f_X(x) > 0, the conditional PDF of YY given X=xX = x is defined as

fY∣X(y∣x)  =  fX,Y(x,y)fX(x),y∈R.f_{Y\mid X}(y \mid x) \;=\; \frac{f_{X,Y}(x,y)}{f_X(x)}, \qquad y \in \mathbb{R}.

The associated conditional CDF is

FY∣X(y∣x)=∫−∞yfY∣X(t∣x) dt,F_{Y\mid X}(y \mid x) = \int_{-\infty}^{y} f_{Y\mid X}(t\mid x)\, dt,

and for a Borel set A⊆RA \subseteq \mathbb{R} we define P(Y∈A∣X=x)=∫AfY∣X(y∣x) dyP(Y \in A \mid X = x) = \int_A f_{Y\mid X}(y\mid x)\,dy. In both cases the conditioning value xx ranges only over the support of XX (points, or in the continuous case a set of full measure, where the marginal is strictly positive).

Intuition

Picture the joint density fX,Y(x,y)f_{X,Y}(x,y) as a mountain range sitting over the (x,y)(x,y)-plane. Slicing this mountain range with a vertical plane at X=xX = x produces a cross-sectional curve in yy — the shape of fX,Y(x,⋅)f_{X,Y}(x, \cdot). That curve is not itself a probability density in general: its total area is fX(x)f_X(x), the height of the marginal density at xx, not 1. Dividing the cross-section by its own area — that is, by fX(x)f_X(x) — rescales it into a genuine density. That rescaled cross-section is exactly fY∣X(⋅∣x)f_{Y\mid X}(\cdot \mid x). The discrete picture is the same idea with a bar chart instead of a mountain: fix a column X=xX = x, look at the relative heights of the joint-probability bars within that column, and renormalize them to sum to 1. A key visual fact: if XX and YY are independent, then every vertical slice has the same shape, just possibly rescaled — so after normalizing, all conditional densities coincide with the marginal density of YY. Dependence is precisely what makes the slice's shape change as xx varies.

Figure
Slicing a joint density at X = x to get a conditional density
Joint density f(x,y): contours, with slice at x = 1.5 x=0 x=3 y=3 y=0 x = 1.5 Cross-section f(1.5, y), then rescaled to f_{Y|X}(y | 1.5) y raw slice (area = f_X(1.5)) f_{Y|X}(y | 1.5), area = 1
TheoremFactorization and Well-Definedness of Conditional Distributions

(A) Discrete case. Let X,YX,Y be discrete random variables with joint PMF pX,Yp_{X,Y} and marginal PMFs pX,pYp_X, p_Y. Fix xx with pX(x)>0p_X(x) > 0. Then: 1. The function y↦pY∣X(y∣x)y \mapsto p_{Y\mid X}(y \mid x) is a valid PMF: it is nonnegative and ∑ypY∣X(y∣x)=1\sum_y p_{Y\mid X}(y \mid x) = 1. 2. Factorization: for all x,yx, y,

pX,Y(x,y)=pX(x) pY∣X(y∣x).p_{X,Y}(x,y) = p_X(x)\, p_{Y\mid X}(y\mid x).

3. Independence criterion: XX and YY are independent if and only if pY∣X(y∣x)=pY(y)p_{Y\mid X}(y\mid x) = p_Y(y) for every yy and every xx with pX(x)>0p_X(x)>0.

(B) Continuous case. Let X,YX,Y be jointly continuous with joint density fX,Yf_{X,Y}, continuous at every point of interest, and marginal density fXf_X. Fix xx with fX(x)>0f_X(x) > 0. Then: 1. The function y↦fY∣X(y∣x)y \mapsto f_{Y\mid X}(y\mid x) is a valid PDF: it is nonnegative and ∫−∞∞fY∣X(y∣x) dy=1\int_{-\infty}^{\infty} f_{Y\mid X}(y\mid x)\,dy = 1. 2. Factorization: for all x,yx,y,

fX,Y(x,y)=fX(x) fY∣X(y∣x).f_{X,Y}(x,y) = f_X(x)\, f_{Y\mid X}(y\mid x).

3. Independence criterion: XX and YY are independent if and only if fY∣X(y∣x)=fY(y)f_{Y\mid X}(y \mid x) = f_Y(y) for (almost) every yy and every xx with fX(x)>0f_X(x) > 0. 4. Limiting interpretation: for every yy at which fX,Y(⋅,y)f_{X,Y}(\cdot, y) is continuous in the first argument at xx, and every ε>0\varepsilon > 0 small,

fY∣X(y∣x)=lim⁡h→0+P(Y≤y∣x−h<X≤x+h)′more preciselyfY∣X(y∣x)=lim⁡h→0+P(y<Y≤y+dy, x−h<X≤x+h)P(x−h<X≤x+h)/dy,f_{Y\mid X}(y\mid x) = \lim_{h \to 0^+} \frac{P(Y \le y \mid x - h < X \le x + h)'}{} \quad\text{more precisely}\quad f_{Y\mid X}(y \mid x) = \lim_{h\to 0^+} \frac{P\big(y < Y \le y+ dy,\ x-h<X\le x+h\big)}{P(x-h<X\le x+h)}\Big/dy,

i.e. it is the density obtained as the limit of conditioning on a shrinking interval around xx, so the formal definition agrees with the naive "conditioning on X=xX=x" intuition.

Proof

We give the argument technique-by-technique: (A) is a direct computation from the definition of conditional probability (Kolmogorov's elementary definition, valid since P(X=x)>0P(X=x)>0); (B) requires an approximation/limiting argument because P(X=x)=0P(X=x)=0 in the continuous case, so the naive conditional-probability definition is not directly applicable, and instead we justify the density formula as a limit of conditioning on shrinking intervals, then verify it satisfies the defining properties of a density.

Part (A), discrete case. (1) Valid PMF. By definition pY∣X(y∣x)=pX,Y(x,y)/pX(x)p_{Y|X}(y\mid x) = p_{X,Y}(x,y)/p_X(x). Since pX,Y(x,y)=P(X=x,Y=y)≥0p_{X,Y}(x,y) = P(X=x,Y=y) \ge 0 and pX(x)>0p_X(x) > 0, each term is nonnegative. Summing over all values yy of YY,

∑ypY∣X(y∣x)=1pX(x)∑ypX,Y(x,y)=1pX(x)⋅pX(x)=1,\sum_y p_{Y\mid X}(y\mid x) = \frac{1}{p_X(x)} \sum_y p_{X,Y}(x,y) = \frac{1}{p_X(x)} \cdot p_X(x) = 1,

where the middle equality is exactly the definition of the marginal PMF as a sum of the joint PMF over yy (Marginal Distributions). This proves pY∣X(⋅∣x)p_{Y|X}(\cdot\mid x) is a genuine PMF. (2) Factorization. This is immediate algebra: multiply both sides of pY∣X(y∣x)=pX,Y(x,y)/pX(x)p_{Y|X}(y\mid x) = p_{X,Y}(x,y)/p_X(x) by pX(x)p_X(x) (which is nonzero by hypothesis) to recover pX,Y(x,y)=pX(x)pY∣X(y∣x)p_{X,Y}(x,y) = p_X(x) p_{Y|X}(y\mid x). If instead pX(x)=0p_X(x) = 0, then since 0≤pX,Y(x,y)≤pX(x)=00 \le p_{X,Y}(x,y) \le p_X(x) = 0 (because {X=x,Y=y}⊆{X=x}\{X=x,Y=y\} \subseteq \{X=x\}), we get pX,Y(x,y)=0p_{X,Y}(x,y)=0 too, so the identity pX,Y(x,y)=pX(x)⋅(anything)=0p_{X,Y}(x,y) = p_X(x)\cdot(\text{anything})=0 holds trivially, and no conditional probability need be assigned. (3) Independence criterion. Recall X⊥YX \perp Y means pX,Y(x,y)=pX(x)pY(y)p_{X,Y}(x,y) = p_X(x) p_Y(y) for all x,yx,y (definition of independence for discrete random variables). (⇒\Rightarrow) If X⊥YX \perp Y, then for any xx with pX(x)>0p_X(x) > 0,

pY∣X(y∣x)=pX,Y(x,y)pX(x)=pX(x)pY(y)pX(x)=pY(y),p_{Y|X}(y \mid x) = \frac{p_{X,Y}(x,y)}{p_X(x)} = \frac{p_X(x) p_Y(y)}{p_X(x)} = p_Y(y),

for every yy, as claimed. (⇐\Leftarrow) Suppose pY∣X(y∣x)=pY(y)p_{Y|X}(y\mid x) = p_Y(y) for all yy and all xx with pX(x)>0p_X(x) > 0. By the factorization in Part (2), for such xx,

pX,Y(x,y)=pX(x)pY∣X(y∣x)=pX(x)pY(y).p_{X,Y}(x,y) = p_X(x) p_{Y|X}(y\mid x) = p_X(x) p_Y(y).

For xx with pX(x)=0p_X(x) = 0, we showed above pX,Y(x,y)=0=pX(x)pY(y)p_{X,Y}(x,y) = 0 = p_X(x) p_Y(y) automatically. Hence pX,Y(x,y)=pX(x)pY(y)p_{X,Y}(x,y) = p_X(x)p_Y(y) for all x,yx,y, which is exactly independence.

Part (B), continuous case. Preliminary: the limiting argument justifying the definition. Fix xx with fX(x)>0f_X(x) > 0, and suppose fX,Yf_{X,Y} is continuous in a neighborhood of (x,y)(x,y) for the yy in question. For small h>0h > 0, condition on the event Ah={x−h<X≤x+h}A_h = \{x - h < X \le x+h\}, which has P(Ah)=∫x−hx+hfX(t) dt>0P(A_h) = \int_{x-h}^{x+h} f_X(t)\,dt > 0 for hh small since fX(x)>0f_X(x)>0 and (by continuity of fXf_X, which follows from continuity of fX,Yf_{X,Y} and dominated convergence applied to fX(t)=∫fX,Y(t,y) dyf_X(t)=\int f_{X,Y}(t,y)\,dy under mild regularity) fXf_X is positive near xx. Define the conditional CDF given this event:

P(Y≤y∣Ah)=P(Y≤y, x−h<X≤x+h)P(Ah)=∫x−hx+h∫−∞yfX,Y(t,s) ds dt∫x−hx+hfX(t) dt.P(Y \le y \mid A_h) = \frac{P(Y \le y, \, x-h < X \le x+h)}{P(A_h)} = \frac{\int_{x-h}^{x+h}\int_{-\infty}^y f_{X,Y}(t,s)\,ds\,dt}{\int_{x-h}^{x+h} f_X(t)\,dt}.

As h→0+h \to 0^+, by continuity of t↦∫−∞yfX,Y(t,s) dst \mapsto \int_{-\infty}^y f_{X,Y}(t,s)\,ds at t=xt=x (which holds if fX,Yf_{X,Y} is continuous and dominated appropriately, e.g. bounded on compact sets) and the mean value property of integrals,

12h∫x−hx+h∫−∞yfX,Y(t,s) ds dt  ⟶  ∫−∞yfX,Y(x,s) ds,\frac{1}{2h}\int_{x-h}^{x+h}\int_{-\infty}^y f_{X,Y}(t,s)\,ds\,dt \;\longrightarrow\; \int_{-\infty}^y f_{X,Y}(x,s)\,ds,

and similarly 12h∫x−hx+hfX(t) dt→fX(x)\frac{1}{2h}\int_{x-h}^{x+h} f_X(t)\,dt \to f_X(x). Dividing these two limits,

lim⁡h→0+P(Y≤y∣Ah)=∫−∞yfX,Y(x,s) dsfX(x)=∫−∞yfX,Y(x,s)fX(x) ds=∫−∞yfY∣X(s∣x) ds.\lim_{h\to 0^+} P(Y\le y \mid A_h) = \frac{\int_{-\infty}^y f_{X,Y}(x,s)\,ds}{f_X(x)} = \int_{-\infty}^y \frac{f_{X,Y}(x,s)}{f_X(x)}\,ds = \int_{-\infty}^y f_{Y|X}(s\mid x)\,ds.

This shows FY∣X(y∣x):=∫−∞yfY∣X(s∣x) dsF_{Y|X}(y\mid x) := \int_{-\infty}^y f_{Y|X}(s\mid x)\,ds is exactly the limit of the well-defined conditional CDFs P(Y≤y∣Ah)P(Y \le y \mid A_h) as the conditioning interval shrinks to the point xx. This is the rigorous sense in which fY∣X(⋅∣x)f_{Y|X}(\cdot\mid x) represents "the distribution of YY given X=xX=x" — it is not obtained by conditioning on a probability-zero event directly, but as this limit. This establishes claim (4) and justifies the definition itself. (1) Valid PDF. Nonnegativity of fY∣X(y∣x)=fX,Y(x,y)/fX(x)f_{Y|X}(y\mid x) = f_{X,Y}(x,y)/f_X(x) is immediate since both numerator and denominator are nonnegative densities. For the total integral,

∫−∞∞fY∣X(y∣x) dy=1fX(x)∫−∞∞fX,Y(x,y) dy=fX(x)fX(x)=1,\int_{-\infty}^{\infty} f_{Y|X}(y\mid x)\,dy = \frac{1}{f_X(x)}\int_{-\infty}^{\infty} f_{X,Y}(x,y)\,dy = \frac{f_X(x)}{f_X(x)} = 1,

using the definition of the marginal density fX(x)=∫fX,Y(x,y) dyf_X(x) = \int f_{X,Y}(x,y)\,dy (Marginal Distributions) in the middle step. Hence fY∣X(⋅∣x)f_{Y|X}(\cdot\mid x) integrates to 1 and is a genuine density. (2) Factorization. Multiply both sides of the defining equation fY∣X(y∣x)=fX,Y(x,y)/fX(x)f_{Y|X}(y\mid x) = f_{X,Y}(x,y)/f_X(x) by fX(x)≠0f_X(x) \neq 0 to obtain fX,Y(x,y)=fX(x)fY∣X(y∣x)f_{X,Y}(x,y) = f_X(x) f_{Y|X}(y\mid x) directly. (3) Independence criterion. Recall X⊥YX \perp Y (jointly continuous) means fX,Y(x,y)=fX(x)fY(y)f_{X,Y}(x,y) = f_X(x)f_Y(y) for almost every (x,y)(x,y). (⇒\Rightarrow) If X⊥YX\perp Y, then for every xx with fX(x)>0f_X(x)>0 and almost every yy,

fY∣X(y∣x)=fX,Y(x,y)fX(x)=fX(x)fY(y)fX(x)=fY(y).f_{Y|X}(y\mid x) = \frac{f_{X,Y}(x,y)}{f_X(x)} = \frac{f_X(x)f_Y(y)}{f_X(x)} = f_Y(y).

(⇐\Leftarrow) Conversely, if fY∣X(y∣x)=fY(y)f_{Y|X}(y\mid x) = f_Y(y) for almost every yy and every xx with fX(x)>0f_X(x)>0, then by the factorization identity (Part 2),

fX,Y(x,y)=fX(x)fY∣X(y∣x)=fX(x)fY(y)f_{X,Y}(x,y) = f_X(x)f_{Y|X}(y\mid x) = f_X(x) f_Y(y)

for almost every (x,y)(x,y) with fX(x)>0f_X(x) > 0; on the null set {x:fX(x)=0}\{x: f_X(x)=0\} both sides vanish almost everywhere in yy since fX,Y(x,⋅)≤f_{X,Y}(x,\cdot) \le constant multiple considerations force the integral of fX,Y(x,⋅)f_{X,Y}(x,\cdot) over such xx to be zero as a set (a standard measure-theoretic fact: if ∫fX(x) dx\int f_X(x)\,dx-null set has fX=0f_X=0, then fX,Y(x,y)=0f_{X,Y}(x,y)=0 for a.e. yy for a.e. such xx, by Tonelli's theorem applied to ∫{fX=0}∫fX,Y dy dx=∫{fX=0}fX(x) dx=0\int_{\{f_X=0\}}\int f_{X,Y}\,dy\,dx = \int_{\{f_X=0\}} f_X(x)\,dx = 0). Hence fX,Y(x,y)=fX(x)fY(y)f_{X,Y}(x,y) = f_X(x)f_Y(y) almost everywhere, which is the definition of independence. ■\blacksquare

∎

Worked examples

Example 1 (discrete, asymmetric joint table). A quality-control station inspects items for two independent defect types, but the joint counts recorded are as follows. Let X∈{0,1,2}X \in \{0,1,2\} be the number of Type-A blemishes and Y∈{0,1}Y \in \{0,1\} the number of Type-B blemishes on a randomly chosen item, with joint PMF given by the table (each entry is pX,Y(x,y)p_{X,Y}(x,y)):

x\yx \backslash y0011
000.300.300.050.05
110.200.200.100.10
220.150.150.200.20

Check: all entries sum to 0.30+0.05+0.20+0.10+0.15+0.20=1.000.30+0.05+0.20+0.10+0.15+0.20 = 1.00. ✓.

Step 1: marginals. Summing rows,

pX(0)=0.35,pX(1)=0.30,pX(2)=0.35.p_X(0) = 0.35,\quad p_X(1) = 0.30,\quad p_X(2) = 0.35.

Summing columns,

pY(0)=0.65,pY(1)=0.35.p_Y(0) = 0.65, \quad p_Y(1) = 0.35.

Step 2: conditional PMF of YY given X=2X=2. Here pX(2)=0.35>0p_X(2) = 0.35 > 0, so

pY∣X(0∣2)=pX,Y(2,0)pX(2)=0.150.35=37≈0.4286,p_{Y|X}(0\mid 2) = \frac{p_{X,Y}(2,0)}{p_X(2)} = \frac{0.15}{0.35} = \frac{3}{7} \approx 0.4286,
pY∣X(1∣2)=pX,Y(2,1)pX(2)=0.200.35=47≈0.5714.p_{Y|X}(1\mid 2) = \frac{p_{X,Y}(2,1)}{p_X(2)} = \frac{0.20}{0.35} = \frac{4}{7} \approx 0.5714.

Check normalization: 3/7+4/7=13/7 + 4/7 = 1. ✓

Step 3: conditional PMF of YY given X=0X=0, for comparison.

pY∣X(0∣0)=0.300.35=67≈0.8571,pY∣X(1∣0)=0.050.35=17≈0.1429.p_{Y|X}(0\mid 0) = \frac{0.30}{0.35} = \frac{6}{7}\approx 0.8571, \qquad p_{Y|X}(1\mid 0) = \frac{0.05}{0.35} = \frac{1}{7} \approx 0.1429.

Since pY∣X(⋅∣0)≠pY∣X(⋅∣2)≠pY(⋅)=(0.65,0.35)p_{Y|X}(\cdot \mid 0) \neq p_{Y|X}(\cdot\mid 2) \neq p_Y(\cdot) = (0.65, 0.35), the independence criterion from the theorem tells us immediately that XX and YY are not independent — knowing X=2X=2 roughly doubles the chance of a Type-B blemish (from marginal 0.350.35 to conditional 4/7≈0.5714/7\approx 0.571) compared to knowing X=0X=0 (conditional 1/7≈0.1431/7 \approx 0.143).

Example 2 (continuous, asymmetric joint density). Let (X,Y)(X,Y) have joint density

fX,Y(x,y)={6xy2,0<x<1, 0<y<?f_{X,Y}(x,y) = \begin{cases} 6xy^2, & 0 < x < 1,\ 0 < y < ?\end{cases}

To make the numbers genuinely asymmetric and nontrivial, use the density

fX,Y(x,y)=c x(1+3y2),0<x<1,0<y<2,f_{X,Y}(x,y) = c\, x(1+3y^2), \qquad 0 < x < 1, \quad 0 < y < 2,

and zero elsewhere, with normalizing constant cc to be found.

Step 1: find cc. We require ∫01∫02c x(1+3y2) dy dx=1\int_0^1\int_0^2 c\,x(1+3y^2)\,dy\,dx = 1. Compute the inner integral first:

∫02(1+3y2) dy=[y+y3]02=2+8=10.\int_0^2 (1+3y^2)\,dy = \Big[y + y^3\Big]_0^2 = 2 + 8 = 10.

Then

∫01c x⋅10 dx=10c∫01x dx=10c⋅12=5c.\int_0^1 c\, x \cdot 10\, dx = 10c \int_0^1 x\,dx = 10c \cdot \frac12 = 5c.

Setting 5c=15c = 1 gives c=15c = \tfrac15. So

fX,Y(x,y)=x(1+3y2)5,0<x<1, 0<y<2.f_{X,Y}(x,y) = \frac{x(1+3y^2)}{5}, \qquad 0<x<1,\ 0<y<2.

Step 2: marginal of XX.

fX(x)=∫02x(1+3y2)5 dy=x5∫02(1+3y2) dy=x5⋅10=2x,0<x<1.f_X(x) = \int_0^2 \frac{x(1+3y^2)}{5}\,dy = \frac{x}{5}\int_0^2 (1+3y^2)\,dy = \frac{x}{5}\cdot 10 = 2x, \qquad 0<x<1.

Check: ∫012x dx=1\int_0^1 2x\,dx = 1. ✓ (This also reveals X∼X \sim the distribution with density 2x2x on (0,1)(0,1), i.e., XX has CDF x2x^2.)

Step 3: marginal of YY.

fY(y)=∫01x(1+3y2)5 dx=1+3y25∫01x dx=1+3y25⋅12=1+3y210,0<y<2.f_Y(y) = \int_0^1 \frac{x(1+3y^2)}{5}\,dx = \frac{1+3y^2}{5}\int_0^1 x\,dx = \frac{1+3y^2}{5}\cdot \frac12 = \frac{1+3y^2}{10}, \qquad 0<y<2.

Check: ∫021+3y210 dy=110(2+8)=1\int_0^2 \frac{1+3y^2}{10}\,dy = \frac{1}{10}\big(2+8\big) = 1. ✓

Step 4: conditional density of YY given X=x0=0.4X = x_0 = 0.4. First confirm fX(0.4)=2(0.4)=0.8>0f_X(0.4) = 2(0.4) = 0.8 > 0. Then

fY∣X(y∣0.4)=fX,Y(0.4,y)fX(0.4)=0.4(1+3y2)/50.8=0.4(1+3y2)5×0.8=1+3y210,0<y<2.f_{Y|X}(y \mid 0.4) = \frac{f_{X,Y}(0.4, y)}{f_X(0.4)} = \frac{0.4(1+3y^2)/5}{0.8} = \frac{0.4(1+3y^2)}{5 \times 0.8} = \frac{1+3y^2}{10}, \qquad 0<y<2.

Observation: this conditional density is exactly fY(y)=(1+3y2)/10f_Y(y) = (1+3y^2)/10, independent of the chosen x0=0.4x_0=0.4. Indeed for any x0∈(0,1)x_0 \in (0,1),

fY∣X(y∣x0)=x0(1+3y2)/52x0=1+3y210=fY(y),f_{Y|X}(y\mid x_0) = \frac{x_0(1+3y^2)/5}{2x_0} = \frac{1+3y^2}{10} = f_Y(y),

since the x0x_0 factors cancel. By the independence criterion of the theorem, this proves XX and YY are independent in this example — consistent with the fact that the joint density factored from the start as fX,Y(x,y)=(2x)⋅(1+3y210)=fX(x)fY(y)f_{X,Y}(x,y) = \big(2x\big)\cdot\Big(\frac{1+3y^2}{10}\Big) = f_X(x) f_Y(y).

Step 5: a numeric conditional probability. Compute P(Y≤1∣X=0.4)P(Y \le 1 \mid X = 0.4):

P(Y≤1∣X=0.4)=∫011+3y210 dy=110[y+y3]01=1+110=210=0.2.P(Y \le 1 \mid X=0.4) = \int_0^1 \frac{1+3y^2}{10}\,dy = \frac{1}{10}\Big[y+y^3\Big]_0^1 = \frac{1+1}{10} = \frac{2}{10} = 0.2.
CounterexampleWhy fX(x)>0f_X(x) > 0 (and regularity of fX,Yf_{X,Y}) is needed

Drop the hypothesis "fX(x)>0f_X(x) > 0" and see the definition break down entirely — and separately, drop "fX,Yf_{X,Y} continuous near the conditioning point" and see the value of fY∣X(y∣x)f_{Y|X}(y\mid x) become ambiguous, not just undefined.

Part 1: fX(x)=0f_X(x) = 0 makes the ratio meaningless. Let (X,Y)(X,Y) be uniform on the triangle T={(x,y):0<y<x<1}T = \{(x,y): 0 < y < x < 1\}, so fX,Y(x,y)=2f_{X,Y}(x,y) = 2 on TT and 00 elsewhere (check: area of TT is 1/21/2, and density 22 makes total mass 2⋅12=12 \cdot \tfrac12 = 1 ✓). The marginal of XX is

fX(x)=∫0x2 dy=2x,0<x<1,f_X(x) = \int_0^x 2\,dy = 2x, \qquad 0<x<1,

so fX(0)=0f_X(0) = 0. At x=0x=0, the formula fY∣X(y∣0)=fX,Y(0,y)/fX(0)f_{Y|X}(y\mid 0) = f_{X,Y}(0,y)/f_X(0) is literally 0/00/0: there is no sensible way to divide, and no amount of algebra recovers a meaningful conditional law, because the event {X near 0}\{X \text{ near } 0\} forces YY into a shrinking sliver (0,x)(0,x) whose shape changes with xx — the limit in the theorem's part (4) does not stabilize to a fixed density as h→0h \to 0 in the same way, because fXf_X itself vanishes at the boundary and the renormalizing denominator collapses along with the numerator. The conditional distribution simply is not defined at x=0x=0 (a single point, consistent with the theorem, which only asserts existence where fX(x)>0f_X(x)>0).

Part 2: discontinuous joint density gives two "reasonable" but different limits (the Borel–Kolmogorov phenomenon). Consider trying to define "the distribution of YY given X=xX=x" for (X,Y)(X,Y) uniform on the unit disk D={(x,y):x2+y2≤1}D = \{(x,y): x^2+y^2 \le 1\}, so fX,Y(x,y)=1/πf_{X,Y}(x,y) = 1/\pi on DD. This density is continuous on the open disk, so conditioning at any interior point via vertical strips is perfectly well-posed and gives

fY∣X(y∣x)=1/πfX(x)=121−x2,−1−x2<y<1−x2,f_{Y|X}(y \mid x) = \frac{1/\pi}{f_X(x)} = \frac{1}{2\sqrt{1-x^2}}, \quad -\sqrt{1-x^2} < y < \sqrt{1-x^2},

(a uniform density on the vertical chord at xx, since fX(x)=∫−1−x21−x21π dy=21−x2πf_X(x) = \int_{-\sqrt{1-x^2}}^{\sqrt{1-x^2}} \tfrac1\pi\, dy = \tfrac{2\sqrt{1-x^2}}{\pi}). This part is fine and illustrates the theorem correctly. The trap arises if one instead tries to condition on a different zero-probability event describing the same point set differently — e.g., conditioning "given X2+Y2X^2+Y^2 near 1" versus "given XX near x0x_0 on the boundary" of the disk — these differing parametrizations of an approach to a probability-zero set can yield genuinely different limiting conditional laws. This is the classical Borel–Kolmogorov paradox: conditioning on a probability-zero event is only well-defined relative to a specific limiting family of positive-probability approximating events (as built rigorously in part (4) of the theorem), not as an intrinsic property of the zero-probability event alone. Dropping the explicit "vertical-strip" regularization silently, and instead conditioning along some other family of shrinking neighborhoods, can and does change the answer. Both failures disappear once the stated hypotheses — fX(x)>0f_X(x) > 0, and continuity of fX,Yf_{X,Y} used consistently with the "shrinking interval in xx" limiting scheme — are respected exactly as the theorem requires.

Scope, edge cases & common traps

SituationWhat happensCorrect handling
XX discrete, YY discrete, pX(x)=0p_X(x) = 0pY∣X(⋅∣x)p_{Y\mid X}(\cdot\mid x) undefinedRestrict conditioning values to the support of XX
X,YX, Y jointly continuous, fX(x)>0f_X(x) > 0Conditional density well-defined via ratio and limiting argumentUse fY∣X(y∣x)=fX,Y(x,y)/fX(x)f_{Y\mid X}(y\mid x) = f_{X,Y}(x,y)/f_X(x)
XX continuous, YY discrete (mixed case)Define P(Y=y∣X=x)=lim⁡h→0P(Y=y∣x−h<X≤x+h)P(Y=y\mid X=x) = \lim_{h\to0} P(Y=y \mid x-h<X\le x+h); often computed via Bayes-type formula with densitiesTreat as its own case; not covered by either pure formula above
Conditioning on a probability-zero event described in two different waysCan give different answers — Borel–Kolmogorov paradoxAlways specify the limiting family of positive-probability events used
X,YX, Y independentfY∣X(y∣x)=fY(y)f_{Y\mid X}(y\mid x) = f_Y(y) for all valid xx (conditional = marginal)Use as a defining test for independence, both directions
Conditional distribution mistaken for conditional expectationConditional distribution is a whole distribution, not a numberConditional expectation is a summary (mean) of the conditional distribution — see Conditional Expectation

The mathematician behind it

Origins · 1 minAndrey Nikolaevich Kolmogorov and how this was discovered
AN
Andrey Nikolaevich Kolmogorov
1903–1987 · Soviet Union

Kolmogorov built the first fully rigorous axiomatic foundation for probability theory, published in his 1933 monograph Grundbegriffe der Wahrscheinlichkeitsrechnung (Foundations of the Theory of Probability). Before this work, conditional probability was used freely and informally, but conditioning on events of probability zero — exactly the situation needed for continuous conditional distributions — had no rigorous definition and was a known source of paradox. Kolmogorov resolved this using measure theory, defining conditional expectation and conditional distributions via the Radon–Nikodym theorem relative to a sub-σ\sigma-algebra, subsuming both the discrete ratio formula and the continuous limiting-density construction as special cases of one unified framework. He also identified and analyzed the paradox that bears his name jointly with Émile Borel, clarifying that conditioning on a probability-zero event requires specifying an approximating sequence of positive-probability events.

History
- 1909: Émile Borel poses an early version of the paradox of conditioning on probability-zero events, in the context of uniform distributions on a sphere.
- 1933: Kolmogorov publishes the Grundbegriffe, providing the axiomatic measure-theoretic foundation for probability and a rigorous general definition of conditional distribution and conditional expectation.
- 1933–1940s: The Borel–Kolmogorov paradox is analyzed in depth, clarifying that conditional densities depend on the limiting scheme used to approximate a probability-zero conditioning event.
- 1940s–1950s: Conditional distributions become a standard tool in the development of statistical inference, regression theory, and stochastic processes (Markov chains defined via conditional distributions of future given past).
- 1960s onward: Conditional distributions and conditional expectation become foundational to martingale theory, Bayesian statistics, and modern stochastic calculus.
Why can't we just define fY∣X(y∣x)f_{Y|X}(y\mid x) as P(Y=y∣X=x)P(Y=y \mid X=x) directly, the way we do for discrete variables?

Because for continuous XX, the event {X=x}\{X = x\} has probability exactly zero, and Kolmogorov's elementary formula P(A∣B)=P(A∩B)/P(B)P(A\mid B) = P(A\cap B)/P(B) requires P(B)>0P(B) > 0 to make sense — dividing by zero is not defined. Instead, the conditional density is defined as the ratio fX,Y(x,y)/fX(x)f_{X,Y}(x,y)/f_X(x), and separately justified by showing it arises as the limit of ordinary (well-defined) conditional probabilities given that XX lies in a shrinking interval around xx. This limiting argument, carried out in the proof above, is what makes the ratio formula meaningful rather than a formal trick.

Does the conditional distribution of YY given X=xX=x always have to be a "nice" distribution, like normal or exponential?

No — it can be any valid probability distribution whatsoever, and its shape can change substantially as xx varies. There is one important structural exception: if XX and YY are jointly normal (bivariate normal), then the conditional distribution of YY given X=xX=x is always normal, with a mean that is linear in xx and a variance that does not depend on xx at all. This special rigidity is a defining feature of the Bivariate Normal Distribution and does not hold for general joint distributions.

How is a conditional distribution different from a conditional expectation?

A conditional distribution is an entire probability law — a full PMF or PDF describing all the probabilistic behavior of YY once X=xX=x is known. A conditional expectation, E[Y∣X=x]E[Y\mid X=x], is a single real number: the mean of that conditional distribution. The conditional distribution contains strictly more information; from it one can compute not just the conditional mean but the conditional variance, conditional median, or any other feature. Conditional Expectation builds directly on the conditional distribution defined here by integrating yy against fY∣X(y∣x)f_{Y|X}(y\mid x) (or summing against pY∣X(y∣x)p_{Y|X}(y\mid x)).

If the conditional PDF equals the marginal PDF for one particular value of x, does that mean X and Y are independent?

No, and this is a subtle but important trap. Independence requires fY∣X(y∣x)=fY(y)f_{Y|X}(y\mid x) = f_Y(y) for every xx in the support of XX (and for almost every yy), not just for one specific value. It is entirely possible for the conditional distribution to coincide with the marginal at one value of xx purely by coincidence, while differing at other values of xx — in that case XX and YY are still dependent. The independence criterion in the theorem is a universally quantified statement over all valid xx, and checking a single xx proves nothing in general.

What goes wrong if the joint density fX,Yf_{X,Y} is not continuous at the point where we condition?

The ratio formula fX,Y(x,y)/fX(x)f_{X,Y}(x,y)/f_X(x) can still be written down formally, but the justification linking it to "conditioning on XX near xx" (via the shrinking-interval limit in the theorem) may fail or depend on exactly how the density is defined at that discontinuity, since densities are only unique up to sets of measure zero. In practice, if fX,Yf_{X,Y} has a jump discontinuity along the line X=xX=x, the conditional density there should be computed using a specific one-sided or averaged version of fX,Yf_{X,Y}, chosen so the limiting argument goes through — this requires care beyond the routine formula and is a genuine edge case rather than a purely formal exercise.

Can we condition a discrete random variable on a continuous one, or vice versa?

Yes, but neither pure formula above directly applies, and the construction is a genuinely separate (mixed) case. For YY discrete and XX continuous, one typically writes P(Y=y∣X=x)=fX(x∣Y=y)P(Y=y)/fX(x)P(Y=y \mid X=x) = f_X(x\mid Y=y) P(Y=y) / f_X(x), a version of Bayes' rule mixing a density and a PMF, valid when fX(x)=∑yfX(x∣Y=y)P(Y=y)>0f_X(x) = \sum_y f_X(x\mid Y=y) P(Y=y) > 0. This mixed-case formula is exactly the mechanism behind Bayesian posterior computation with continuous data and discrete parameters (or vice versa), and is built from the same normalize-the-slice principle, just applied across the discrete/continuous boundary.

Is the conditional distribution of Y given X=x unique?

Yes, up to the usual "almost everywhere" ambiguity inherent to densities. For discrete random variables, pY∣X(y∣x)p_{Y|X}(y\mid x) is uniquely determined by the joint and marginal PMFs at every xx with pX(x)>0p_X(x)>0, with no ambiguity, since PMFs are pointwise well-defined probabilities. For continuous random variables, fY∣X(⋅∣x)f_{Y|X}(\cdot \mid x) is well-defined at every xx where fX(x)>0f_X(x)>0 and fX,Y(x,⋅)f_{X,Y}(x,\cdot) is a valid representative of the joint density (densities are themselves only unique up to modification on a measure-zero set), and different valid representatives of fX,Yf_{X,Y} can give conditional densities differing on measure-zero sets of yy, which does not affect any probability computed from them.

Before this

Where this leads