Cumulative Distribution Functions and Change of Variables

A random variable is most safely described not by a density — which may not exist — but by its cumulative distribution function FX(x)=P(X≤x)F_X(x)=P(X\le x). This single non-decreasing function absorbs discrete jumps, smooth continuous parts, and even singular components into one object, and it is the natural surface on which the aq-mp-axioms-of-probability act: monotonicity, the limits at ±∞\pm\infty, and right-continuity are not assumptions but theorems about PP. From it you read interval probabilities by subtraction, recover the density by differentiation where it exists, and invert to get quantiles. This article is the hinge of the probability head — it takes the raw notion of a distribution from aq-mp-random-variables-distributions and the multivariate bookkeeping from aq-mp-joint-marginal-conditional-distributions, and turns them into a working machine for pushing distributions through transformations. That machine answers one central question. If we know how XX is distributed and set Y=g(X)Y=g(X), how is YY distributed? The cleanest route is always the CDF: FY(y)=P(g(X)≤y)F_Y(y)=P(g(X)\le y) is a statement about events, evaluated by pulling the set {g(X)≤y}\{g(X)\le y\} back through gg — no density required. Differentiate that relation and a Jacobian appears, identical in structure to the change-of-variables theorem for integrals, because a density is precisely an integrand against dx\mathrm{d}x. In one dimension the Jacobian is the modulus of a derivative; in nn dimensions the absolute value of a determinant — not cosmetic, since probability is a positive measure and an orientation-reversing map must never manufacture a negative density. From this one idea flow the probability integral transform, inverse-transform sampling, and the convolution rule that feeds forward into aq-mp-gaussian-normal-distribution and aq-mp-laws-of-large-numbers-convergence.

Key takeaways
  • The cumulative distribution function FX(x)=P(X≤x)F_X(x)=P(X\le x) is the master object of probability: defined for every random variable, discrete, continuous, or mixed, it fully determines the distribution and is the natural home of the axioms.
  • FXF_X is non-decreasing and right-continuous with FX(−∞)=0F_X(-\infty)=0, FX(+∞)=1F_X(+\infty)=1; its jumps locate point masses and its derivative, where it exists, recovers the density fX=FX′f_X=F_X'.
  • Under a strictly monotone map Y=g(X)Y=g(X) the CDF transforms by composition, giving the density rule fY(y)=fX ⁣(g−1(y)) ∣dx/dy∣f_Y(y)=f_X\!\big(g^{-1}(y)\big)\,\lvert\mathrm{d}x/\mathrm{d}y\rvert; the modulus keeps densities positive.
  • In nn dimensions the density picks up ∣det⁡(∂x/∂y)∣\lvert\det(\partial x/\partial y)\rvert — the same Jacobian determinant that governs multidimensional integration; non-monotone maps sum over every preimage branch.
  • The probability integral transform U=FX(X)∼Unif(0,1)U=F_X(X)\sim\mathrm{Unif}(0,1) and its inverse X=FX−1(U)X=F_X^{-1}(U) are the engine of inverse-transform sampling and Monte Carlo.
  • Key idea: Always transform at the level of the CDF — FY(y)=P(g(X)≤y)F_Y(y)=P(g(X)\le y) is a manipulation of events that needs no density — and obtain the density rule by differentiation, picking up ∣det⁡(∂x/∂y)∣\lvert\det(\partial x/\partial y)\rvert exactly as in the change-of-variables theorem for integrals.

Where this lives today

The CDF and its change-of-variables machinery are the working core of computational physics. Every Monte Carlo simulation — lattice QCD, radiation transport in reactor and medical dosimetry codes, path-integral sampling in condensed matter — rests on turning uniform pseudo-random numbers into physical samples, by inverse-transform sampling where the CDF inverts cleanly and by Box–Muller or the Ziggurat algorithm for Gaussians where it does not. Error propagation leans on the Jacobian rule directly: when a measured period TT is reported as a frequency ν=1/T\nu=1/T, the exact transformed density comes from ∣dT/dν∣\lvert\mathrm d T/\mathrm d\nu\rvert, and the linearised σν≈∣g′∣σT\sigma_\nu\approx\lvert g'\rvert\sigma_T is just its first-order shadow. In statistical mechanics the density of states is a change of variables from a uniform-in-phase-space measure to energy. And across data science the probability integral transform underlies quantile normalisation, copula models of dependence, and the goodness-of-fit tests (Kolmogorov–Smirnov, Anderson–Darling) that compare an empirical CDF to a theoretical one — the same FXF_X, now estimated from data.

The physical picture

Think of the CDF as accumulated probability mass swept in from the left. At a point mass it jumps by the size of that mass; over a smooth stretch it climbs at a rate equal to the density; the total height climbed from −∞-\infty to +∞+\infty is exactly 11. Because it is built from the probabilities of nested events {X≤x}\{X\le x\}, the CDF exists even when no density does — a discrete variable has a staircase FF with no derivative at its steps, yet FF still tells you everything. That is why every clean derivation about transformations starts with FF and only differentiates at the very end. The first figure shows the two faces at once: the bell of a density and the S-curve of its integral, tied together by the fact that the shaded area to the left of any threshold is the height of FF there.

Figure
The CDF F(x) = P(X ≤ x) accumulates the density from the left. For a standard normal the shaded area up to x = 1 equals F(1) = 0.8413, and by symmetry F(0) = 0.5; the S-curve climbs from 0 to 1 and its slope at every point is the density f(x)
F accumulates the density from the left — slope of F is f, total rise is 1 density f(x) peak φ(0) = 0.3989 1.0 0.5 0 CDF F(x) = P(X ≤ x) F(1) = 0.8413 F(0) = 0.5 x = 0 x = 1 x

The Jacobian factor is bookkeeping for stretching. A map gg that compresses a small interval crowds the same probability into less length, so the density must rise by ∣dx/dy∣\lvert\mathrm{d}x/\mathrm{d}y\rvert; a map that stretches thins it out. Probability — not density — is the invariant, and the modulus is the guarantee that a fold or a reflection never flips the sign of a positive measure. The most operational form of this idea is inverse-transform sampling: feed a uniform number u∈(0,1)u\in(0,1) into FX−1F_X^{-1} and it lands exactly where the density is large, because the inverse CDF spends more horizontal room where FF rises slowly. The second figure makes that concrete with a real distribution and a real number — the median of an exponential comes out where it must.

Figure
Inverse-transform sampling is a change of variables X = F⁻¹(U). Equally spaced uniforms U on the vertical axis map through the exponential CDF F(x) = 1 − e⁻ˣ to X-samples that crowd toward small x where the density is large. The median U = 0.5 lands at X = ln 2 = 0.6931
X = F⁻¹(U): uniform ticks in U become clustered samples in X x U 1 0 F(x) = 1 − e⁻ˣ U = 0.5 X = ln 2 = 0.6931 conserved probability: f_X(x) dx = dU, dU = F′(x) dx so samples crowd where f is large

The core equations

The starting definition is a probability of an event, nothing more: the CDF is the chance that XX does not exceed a threshold. Everything structural about it follows from the axioms applied to the nested events {X≤x}\{X\le x\}.

FX(x)=P(X≤x),FX:R→[0,1](1)F_X(x)=P(X\le x),\qquad F_X:\mathbb{R}\to[0,1] \qquad (1)

where: FXF_X — cumulative distribution function of XX; xx — real threshold value; P(⋅)P(\cdot) — probability measure on events. Reading: FX(x)F_X(x) is the accumulated probability to the left of and including xx, and it is defined for every random variable whatsoever. Three properties characterise a CDF completely — any function with them is the CDF of some random variable. They are consequences of monotonicity and continuity of the measure, derived below.

FX non-decreasing,FX(−∞)=0, FX(+∞)=1,FX(x+)=FX(x)(2)F_X\ \text{non-decreasing},\quad F_X(-\infty)=0,\ F_X(+\infty)=1,\quad F_X(x^+)=F_X(x) \qquad (2)

where: FX(x+)F_X(x^+) — right-hand limit, so FXF_X is right-continuous; non-decreasing — from event inclusion {X≤x1}⊆{X≤x2}\{X\le x_1\}\subseteq\{X\le x_2\} for x1≤x2x_1\le x_2. Reading: jumps are allowed (point masses), plateaus are allowed (gaps in support), but FF never falls and always tops out at 11. Two thresholds give an interval probability by subtraction, and differentiating FF where it is smooth recovers the density — the density is the local rate of accumulation.

P(a<X≤b)=FX(b)−FX(a),fX(x)=dFXdx(3)P(a<X\le b)=F_X(b)-F_X(a),\qquad f_X(x)=\frac{\mathrm{d}F_X}{\mathrm{d}x} \qquad (3)

where: fXf_X — probability density, exists where FXF_X is differentiable; a,ba,b — interval endpoints with a<ba<b. Reading: fX dxf_X\,\mathrm{d}x is the probability in an infinitesimal window, so fXf_X is an integrand, which is why transforming it obeys the integral change-of-variables rule. For a strictly monotone, differentiable map the CDF composes directly and the density picks up the reciprocal slope in modulus — the one-dimensional Jacobian.

fY(y)=fX ⁣(g−1(y))∣dxdy∣(4)f_Y(y)=f_X\!\big(g^{-1}(y)\big)\left\lvert\frac{\mathrm{d}x}{\mathrm{d}y}\right\rvert \qquad (4)

where: Y=g(X)Y=g(X) — transformed variable, gg strictly monotone and differentiable; g−1g^{-1} — inverse map, x=g−1(y)x=g^{-1}(y); ∣dx/dy∣\lvert\mathrm{d}x/\mathrm{d}y\rvert — absolute reciprocal slope. Reading: compress by gg and the density rises; stretch and it falls; the modulus keeps it positive for decreasing maps. In nn dimensions the reciprocal slope becomes the absolute value of the Jacobian determinant of the inverse map — the exact factor from multivariable calculus.

fY(y)=fX ⁣(x(y)) ∣det⁡∂x∂y∣(5)f_{\mathbf Y}(\mathbf y)=f_{\mathbf X}\!\big(\mathbf x(\mathbf y)\big)\,\Big\lvert\det\frac{\partial\mathbf x}{\partial\mathbf y}\Big\rvert \qquad (5)

where: X,Y\mathbf X,\mathbf Y — nn-dimensional random vectors with Y=g(X)\mathbf Y=\mathbf g(\mathbf X); ∂x/∂y\partial\mathbf x/\partial\mathbf y — Jacobian matrix of x=g−1(y)\mathbf x=\mathbf g^{-1}(\mathbf y); det⁡\det — determinant. Reading: the determinant is the local volume-scaling of the map, and the absolute value preserves positivity of the measure. When gg is not one-to-one, every real preimage of yy contributes, and their densities are added, each weighted by its own local slope.

fY(y)=∑kfX(xk)∣g′(xk)∣,xk∈g−1({y})(6)f_Y(y)=\sum_{k}\frac{f_X(x_k)}{\lvert g'(x_k)\rvert},\qquad x_k\in g^{-1}(\{y\}) \qquad (6)

where: xkx_k — the kk-th real root of g(x)=yg(x)=y; g′(xk)g'(x_k) — slope of gg there. Reading: a fold such as Y=X2Y=X^2 gathers mass from both ±y\pm\sqrt{y}; a vanishing slope on any branch makes the density diverge. Feeding a variable through its own CDF flattens it to a uniform, and inverting that statement turns a uniform generator into a sampler for any target.

U=FX(X)∼Unif(0,1),X=FX−1(U)(7)U=F_X(X)\sim\mathrm{Unif}(0,1),\qquad X=F_X^{-1}(U) \qquad (7)

where: UU — uniform random variable on (0,1)(0,1); FX−1F_X^{-1} — quantile function, the generalised inverse of FXF_X. Reading: this is the probability integral transform, the reason a single stream of uniforms can simulate any continuous distribution. Finally, the density of a sum of independent variables is the convolution of their densities — a two-dimensional Jacobian rule with the marginal integrated out.

fZ(z)=∫−∞∞fX(x) fY(z−x) dx(8)f_Z(z)=\int_{-\infty}^{\infty} f_X(x)\,f_Y(z-x)\,\mathrm{d}x \qquad (8)

where: Z=X+YZ=X+Y — sum of independent random variables; the integral is the convolution fX∗fYf_X*f_Y. Reading: convolution is why sums smooth out and, iterated, drift toward the Gaussian — the thread picked up in aq-mp-laws-of-large-numbers-convergence.

Derivation AThe defining properties of a CDF from the axioms

The goal is to prove that the three characterising properties of equation (2) — monotonicity, the limits 00 and 11 at ∓∞\mp\infty, and right-continuity — are not conventions imposed on FXF_X but forced consequences of the axioms of probability acting on the nested family of events {X≤x}\{X\le x\}. Each is the image under the measure PP of a set-theoretic fact about how those events nest, grow to fill the sample space, or shrink to a threshold, so that the shape of every CDF is dictated by measure theory alone.

Step 1. Fix x1≤x2x_1\le x_2. Then {X≤x1}⊆{X≤x2}\{X\le x_1\}\subseteq\{X\le x_2\}, and monotonicity of PP on nested events gives P(X≤x1)≤P(X≤x2)P(X\le x_1)\le P(X\le x_2), i.e. FX(x1)≤FX(x2)F_X(x_1)\le F_X(x_2). Why: a threshold that admits fewer outcomes cannot carry more probability, so FF can never decrease — the single fact behind the S-shape.

Step 2. As x→+∞x\to+\infty the events increase to the whole sample space, {X≤x}↑Ω\{X\le x\}\uparrow\Omega, and as x→−∞x\to-\infty they decrease to the empty set, {X≤x}↓∅\{X\le x\}\downarrow\varnothing. Continuity of the measure along monotone sequences gives FX(+∞)=P(Ω)=1F_X(+\infty)=P(\Omega)=1 and FX(−∞)=P(∅)=0F_X(-\infty)=P(\varnothing)=0. Why: all the probability is eventually collected, and none is left below every threshold — the endpoints are pinned by normalisation.

Step 3. For right-continuity, note ⋂n{X≤x+1n}={X≤x}\bigcap_n\{X\le x+\tfrac1n\}=\{X\le x\} because X≤x+1nX\le x+\tfrac1n for every nn forces X≤xX\le x. Continuity from above on this decreasing intersection gives FX(x+)=lim⁡nFX(x+1n)=FX(x)F_X(x^+)=\lim_n F_X(x+\tfrac1n)=F_X(x). Why: including the endpoint in {X≤x}\{X\le x\} makes FF jump on arrival at a point mass, not on departure — the convention that makes P(X≤x)P(X\le x), not P(X<x)P(X<x), the clean object. *Conversely, any right-continuous non-decreasing FF with these limits is the CDF of some random variable; the staircase CDF of a die and the smooth CDF of a Gaussian both satisfy all three properties.*

Go deeper · Derivation B · 1 minFrom CDF composition to the Jacobian density rule
Derivation BFrom CDF composition to the Jacobian density rule

The aim is to derive the change-of-variables density rule of equations (4)–(6) entirely at the level of events, so that no assumption about the existence of a density is needed until the final differentiation. We push {g(X)≤y}\{g(X)\le y\} back through gg to rewrite FYF_Y in terms of FXF_X, differentiate once, and watch the reciprocal slope emerge with the sign structure that forces the absolute value — first for a monotone map, then for a fold with several preimages.

Step 1. Take gg strictly increasing. Then g(X)≤y  ⟺  X≤g−1(y)g(X)\le y\iff X\le g^{-1}(y), so FY(y)=P(g(X)≤y)=P(X≤g−1(y))=FX(g−1(y))F_Y(y)=P(g(X)\le y)=P\big(X\le g^{-1}(y)\big)=F_X\big(g^{-1}(y)\big). Why: an increasing map preserves the ordering of the threshold, so the event simply relabels — this is the whole content of transforming a CDF.

Step 2. Differentiate with the chain rule: fY(y)=fX(g−1(y)) dg−1dyf_Y(y)=f_X\big(g^{-1}(y)\big)\,\dfrac{\mathrm{d}g^{-1}}{\mathrm{d}y}, and here dg−1/dy>0\mathrm{d}g^{-1}/\mathrm{d}y>0. For a strictly decreasing gg the event flips to X≥g−1(y)X\ge g^{-1}(y), giving FY(y)=1−FX(g−1(y))F_Y(y)=1-F_X\big(g^{-1}(y)\big) and dg−1/dy<0\mathrm{d}g^{-1}/\mathrm{d}y<0; differentiating, the minus signs cancel. Why: both cases collapse into fY=fX ∣dx/dy∣f_Y=f_X\,\lvert\mathrm{d}x/\mathrm{d}y\rvert — the modulus is the trace of the 1−FX1-F_X that appears only for decreasing maps.

Step 3. If gg is not one-to-one, the event {g(X)≤y}\{g(X)\le y\} pulls back to a union of intervals around each root xkx_k of g(x)=yg(x)=y. Differentiating the sum of the corresponding CDF pieces gives fY(y)=∑kfX(xk)/∣g′(xk)∣f_Y(y)=\sum_k f_X(x_k)/\lvert g'(x_k)\rvert, and in nn dimensions each 1/∣g′∣1/\lvert g'\rvert becomes ∣det⁡(∂x/∂y)∣\lvert\det(\partial\mathbf x/\partial\mathbf y)\rvert. Why: probability from disjoint preimage branches simply adds, and a branch with vanishing slope contributes a divergent — but integrable — spike, the fingerprint of a fold. *For example, applied to g(x)=ax+bg(x)=ax+b the rule returns fY(y)=∣a∣−1fX((y−b)/a)f_Y(y)=\lvert a\rvert^{-1}f_X((y-b)/a); applied to g(x)=x2g(x)=x^2 it returns the two-branch formula used below.*

Go deeper · Derivation C · 1 minWhy F_X(X) is uniform — the probability integral transform
Derivation CWhy F_X(X) is uniform — the probability integral transform

The target is to prove that pushing a continuous variable through its own CDF produces a variable uniform on the unit interval, and to read off the inverse statement that underlies all inverse-transform sampling. The argument is a single line of event algebra once FXF_X is continuous and strictly increasing: asking whether FX(X)F_X(X) is below uu is the same as asking whether XX is below the quantile FX−1(u)F_X^{-1}(u) — which by definition has probability uu.

Step 1. Let U=FX(X)U=F_X(X) with FXF_X continuous and strictly increasing, and take u∈(0,1)u\in(0,1). Then P(U≤u)=P(FX(X)≤u)=P(X≤FX−1(u))=FX(FX−1(u))=uP(U\le u)=P\big(F_X(X)\le u\big)=P\big(X\le F_X^{-1}(u)\big)=F_X\big(F_X^{-1}(u)\big)=u. Why: P(U≤u)=uP(U\le u)=u on (0,1)(0,1) is exactly the CDF of a Unif(0,1)\mathrm{Unif}(0,1) variable, so UU is uniform — the distribution of XX has been completely erased.

Step 2. Invert the statement: if U∼Unif(0,1)U\sim\mathrm{Unif}(0,1) then X=FX−1(U)X=F_X^{-1}(U) has CDF FXF_X, since P(FX−1(U)≤x)=P(U≤FX(x))=FX(x)P\big(F_X^{-1}(U)\le x\big)=P\big(U\le F_X(x)\big)=F_X(x). Why: this is a change of variables x=FX−1(u)x=F_X^{-1}(u) whose Jacobian dx/du=1/fX(x)\mathrm{d}x/\mathrm{d}u=1/f_X(x) exactly cancels the target density — inverse-transform sampling is the Jacobian rule read backwards.

Step 3. For a variable with atoms FXF_X is not strictly increasing, so replace FX−1F_X^{-1} by the generalised (quantile) inverse FX−1(u)=inf⁡{x:FX(x)≥u}F_X^{-1}(u)=\inf\{x:F_X(x)\ge u\}; the same identity holds with ≤\le becoming a one-sided statement, and discrete masses are reproduced exactly. Why: the quantile function is what lets a single uniform stream sample a mixed distribution, atoms and continuous part alike. *As a check, the exponential worked example below inverts FXF_X explicitly and recovers Exp(λ)\mathrm{Exp}(\lambda); the median U=0.5U=0.5 maps to the true median shown in the second figure.*

Limiting cases

CaseResultMeaning
Linear map Y=aX+bY=aX+b, a≠0a\neq0fY(y)=1∣a∣ fX ⁣(y−ba)f_Y(y)=\tfrac{1}{\lvert a\rvert}\,f_X\!\big(\tfrac{y-b}{a}\big)Shift relocates, scale dilates and divides by ∣a∣\lvert a\rvert; a Gaussian stays Gaussian, standardising to N(0,1)\mathcal N(0,1).
Vanishing Jacobian g′(x0)=0g'(x_0)=0fY(y)→∞f_Y(y)\to\infty near y0=g(x0)y_0=g(x_0)Locally flat maps concentrate probability; the density diverges integrably, as in the arcsine law Y=cos⁡XY=\cos X.
Non-monotone ggfY(y)=∑kfX(xk)/∣g′(xk)∣f_Y(y)=\sum_k f_X(x_k)/\lvert g'(x_k)\rvertSum over all preimage branches; Y=X2Y=X^2 gathers contributions from ±y\pm\sqrt{y}.
Discrete XXFX(x)=∑xi≤xpiF_X(x)=\sum_{x_i\le x}p_iA right-continuous staircase; no density, but the CDF and the mass-pushforward pg(xi)p_{g(x_i)} still work.
Degenerate limit σ→0\sigma\to0FX→F_X\to unit step at μ\muThe density becomes a Dirac spike; all probability collapses onto a single value.

Worked examples

1 · Standardising a Gaussian is an affine change of variables (confidence builder)

A calibration voltage reads X∼N(μ=5.00 V, σ=0.20 V)X\sim\mathcal N(\mu=5.00\ \mathrm V,\ \sigma=0.20\ \mathrm V). Show that the standardising map Y=(X−μ)/σY=(X-\mu)/\sigma produces a standard normal, then find P(X≤5.30 V)P(X\le 5.30\ \mathrm V).

Step 1. The map is affine, Y=g(X)=(X−μ)/σY=g(X)=(X-\mu)/\sigma with inverse x=σy+μx=\sigma y+\mu and dx/dy=σ\mathrm{d}x/\mathrm{d}y=\sigma. The linear-map rule (equation 4) gives fY(y)=σ fX(σy+μ)f_Y(y)=\sigma\,f_X(\sigma y+\mu). The density carries a factor ∣a∣=σ\lvert a\rvert=\sigma because the map stretches by σ\sigma.

Step 2. Substitute the Gaussian fX(x)=1σ2πe−(x−μ)2/2σ2f_X(x)=\tfrac{1}{\sigma\sqrt{2\pi}}e^{-(x-\mu)^2/2\sigma^2}: the argument σy+μ\sigma y+\mu makes (x−μ)2/2σ2=y2/2(x-\mu)^2/2\sigma^2=y^2/2, and the prefactor σ⋅1σ2π=12π\sigma\cdot\tfrac{1}{\sigma\sqrt{2\pi}}=\tfrac{1}{\sqrt{2\pi}}, so fY(y)=12πe−y2/2f_Y(y)=\tfrac{1}{\sqrt{2\pi}}e^{-y^2/2}. Y is exactly standard normal, N(0,1)\mathcal N(0,1) — the affine map has erased μ\mu and σ\sigma.

Step 3. Because {X≤5.30}={Y≤(5.30−5.00)/0.20}={Y≤1.5}\{X\le 5.30\}=\{Y\le(5.30-5.00)/0.20\}=\{Y\le 1.5\}, the CDF transforms by composition: FX(5.30)=Φ(1.5)F_X(5.30)=\Phi(1.5). From the standard normal table Φ(1.5)=0.9332\Phi(1.5)=\mathbf{0.9332}. So P(X≤5.30 V)=0.9332P(X\le 5.30\ \mathrm V)=0.9332, i.e. about 93.3%93.3\% of readings fall at or below 5.30 V5.30\ \mathrm V. The whole computation is one change of variables plus one table lookup.

2 · Inverse-transform sampling of radioactive lifetimes (fully worked)

Decay times of an unstable nucleus follow X∼Exp(λ)X\sim\mathrm{Exp}(\lambda) with λ=0.5 s−1\lambda=0.5\ \mathrm{s^{-1}} (mean lifetime τ=1/λ=2 s\tau=1/\lambda=2\ \mathrm s). A random-number generator delivers uniforms U=0.1, 0.5, 0.9U=0.1,\ 0.5,\ 0.9. Convert them to decay times and check the median.

Step 1. Write the target CDF by integrating the density from 00: FX(x)=1−e−λxF_X(x)=1-e^{-\lambda x} for x≥0x\ge0. It is strictly increasing, so the inverse is unique. This is the exact setting of the probability integral transform.

Step 2. Invert: u=1−e−λx⇒x=FX−1(u)=−1λln⁡(1−u)u=1-e^{-\lambda x}\Rightarrow x=F_X^{-1}(u)=-\tfrac1\lambda\ln(1-u). With λ=0.5\lambda=0.5, X=−2ln⁡(1−U)X=-2\ln(1-U). Feeding a uniform through the inverse CDF is the change of variables x=FX−1(u)x=F_X^{-1}(u) whose Jacobian cancels the target density.

Step 3. Evaluate at the three uniforms: U=0.1⇒X=−2ln⁡0.9=0.2107 sU=0.1\Rightarrow X=-2\ln 0.9=\mathbf{0.2107\ s}; U=0.5⇒X=−2ln⁡0.5=1.3863 sU=0.5\Rightarrow X=-2\ln 0.5=\mathbf{1.3863\ s}; U=0.9⇒X=−2ln⁡0.1=4.6052 sU=0.9\Rightarrow X=-2\ln 0.1=\mathbf{4.6052\ s}. The samples crowd toward small xx, exactly as the second figure shows, because the exponential density is largest there.

Step 4. Check the median: U=0.5U=0.5 gave X=1.3863 sX=1.3863\ \mathrm s, and the true median solves FX(m)=0.5F_X(m)=0.5, i.e. m=ln⁡2/λ=0.6931/0.5=1.3863 sm=\ln 2/\lambda=0.6931/0.5=\mathbf{1.3863\ s} — they agree. Confirming the distribution: P(X≤1.3863)=1−e−0.5×1.3863=1−e−0.6931=1−0.5=0.5P(X\le 1.3863)=1-e^{-0.5\times1.3863}=1-e^{-0.6931}=1-0.5=\mathbf{0.5}, so the sampler reproduces Exp(λ)\mathrm{Exp}(\lambda) as required. Since 1−U1-U is uniform whenever UU is, X=−1λln⁡UX=-\tfrac1\lambda\ln U works equally and saves one subtraction — the form used in production Monte Carlo codes. As a cross-check of the folding rule, the derivation above gives Y=X2∼χ12Y=X^2\sim\chi^2_1 with fY(1)=12πe−1/2=0.2420f_Y(1)=\tfrac{1}{\sqrt{2\pi}}e^{-1/2}=\mathbf{0.2420} and an integrable spike as y→0+y\to0^+.

Physics of the portrait

The change-of-variables factor that runs through this whole article is one man's determinant: when a distribution is pushed through a map, the density is rescaled by the absolute value of the Jacobian — Carl Gustav Jacob Jacobi's functional determinant, introduced in a memoir whose subject was exactly how integrands transform under a change of variables.

Origins · 1 minCarl Gustav Jacob Jacobi and how this was discovered
CG
Carl Gustav Jacob Jacobi
1804–1851 · the functional determinant behind change of variables

Jacobi was born in Potsdam in 1804 and became one of the great analysts of the nineteenth century, remembered for elliptic functions, the Hamilton–Jacobi equation of mechanics, and the determinant that bears his name. The object central to this article — the Jacobian — appeared in his 1841 memoir De determinantibus functionalibus, which asked precisely the question a change of variables poses: when new coordinates replace old ones, by what factor does a volume element, and hence an integrand, rescale? His answer, the determinant of the matrix of partial derivatives, is exactly the ∣det⁡(∂x/∂y)∣\lvert\det(\partial\mathbf x/\partial\mathbf y)\rvert that keeps probability conserved when a density is transformed. Jacobi did not work in probability — the measure-theoretic language of FXF_X came later — but every modern derivation of the multivariate density rule is his determinant applied to an integrand that happens to integrate to one. The same functional determinants guarantee that phase-space volume is preserved under canonical transformations (Liouville's theorem), tying the probability change-of-variables rule to the flow of statistical mechanics. He died of smallpox in Berlin in 1851 at forty-six. That a purely analytic determinant should govern how randomness transforms is the quiet unity this article rests on: probability is a measure, a measure is an integral, and integrals transform by Jacobi's rule.

History
1812
— Laplace's Théorie analytique des probabilités systematises distribution functions and their transformations
1841
— Jacobi introduces the functional determinant, the Jacobian, in De determinantibus functionalibus
1851
— Jacobi dies of smallpox in Berlin at forty-six
1933
— Kolmogorov's axioms put the CDF on a rigorous measure-theoretic footing
1958
— Box and Muller publish their two-uniform recipe for Gaussian random numbers

Going further

Texts. Stone and Goldbart, Mathematics for Physics (CUP, 2009), probability chapter · Arfken, Weber and Harris, Mathematical Methods for Physicists, 7th ed., Ch. 23 · Riley, Hobson and Bence, Mathematical Methods for Physics and Engineering, 3rd ed., Ch. 30 · Grimmett and Stirzaker, Probability and Random Processes, 3rd ed. · Feller, An Introduction to Probability Theory and Its Applications, Vol. II · Press et al., Numerical Recipes, 3rd ed., Ch. 7 (random deviates). The three defining properties of FXF_X are derived from the axioms (monotonicity and continuity of the measure); the change-of-variables rule is Jacobi's functional determinant applied to a normalised integrand. Key numerical anchors: (1) the χ12\chi^2_1 density fY(y)=1/2πy e−y/2f_Y(y)=1/\sqrt{2\pi y}\,e^{-y/2} evaluates to 0.24200.2420 at y=1y=1, with normalisation confirmed via the substitution y=t2y=t^2; (2) the Box–Muller Jacobian gives ∣det⁡∂(u1,u2)/∂(z1,z2)∣=12πe−(z12+z22)/2\lvert\det\partial(u_1,u_2)/\partial(z_1,z_2)\rvert=\tfrac{1}{2\pi}e^{-(z_1^2+z_2^2)/2}; (3) the exponential sampler X=−1λln⁡(1−U)X=-\tfrac1\lambda\ln(1-U) reproduces FX=1−e−λxF_X=1-e^{-\lambda x} and the median ln⁡2/λ\ln2/\lambda; (4) the standardising affine map returns Φ(1.5)=0.9332\Phi(1.5)=0.9332.

Prerequisites. Axioms of Probability · Random Variables and Probability Distributions · Joint, Marginal and Conditional Distributions. Leads to. Gaussian (Normal) Distribution · Multivariate Gaussian Distribution · Moment-Generating and Characteristic Functions · Laws of Large Numbers and Convergence of Random Variables.

Ask the tutor: Bring me any transformation Y=g(X)Y=g(X) — a square, a log, or a distribution you want to sample — and we will push it through the CDF and read off the Jacobian together.

Why prefer the CDF over the density when they seem to carry the same information?

Because the density may not exist, but the CDF always does. A discrete variable has point masses, not a continuous density; a mixed variable has both. The CDF FX(x)=P(X≤x)F_X(x)=P(X\le x) captures jumps (atoms), smooth rises (continuous parts), and even singular components inside one non-decreasing, right-continuous function. For transformations this is decisive: FY(y)=P(g(X)≤y)F_Y(y)=P(g(X)\le y) is a statement about events that is always meaningful, whereas the density rule only applies where things are smooth. Work with FF throughout and differentiate at the end, and you never have to worry mid-calculation about whether a density exists.

Where exactly does the absolute value on the Jacobian come from?

From the decreasing case of the CDF relation. For an increasing map, FY(y)=FX(g−1(y))F_Y(y)=F_X(g^{-1}(y)) and differentiating gives a positive slope. For a decreasing map the event flips: g(X)≤yg(X)\le y means X≥g−1(y)X\ge g^{-1}(y), so FY(y)=1−FX(g−1(y))F_Y(y)=1-F_X(g^{-1}(y)). Differentiating that introduces a minus sign, which cancels the negative dg−1/dy\mathrm{d}g^{-1}/\mathrm{d}y to leave a positive density. Writing ∣dx/dy∣\lvert\mathrm{d}x/\mathrm{d}y\rvert packages both cases in one formula and guarantees the result stays non-negative — as any density must. In nn dimensions the same reasoning promotes it to the absolute value of the Jacobian determinant.

What goes wrong for a non-monotone map like Y = X²?

A non-monotone map sends several xx values to the same yy, so a single inverse branch is not enough. For Y=X2Y=X^2 and y>0y>0 the equation x2=yx^2=y has two roots ±y\pm\sqrt y, and both regions of xx contribute to {X2≤y}={−y≤X≤y}\{X^2\le y\}=\{-\sqrt y\le X\le\sqrt y\}. The multi-branch rule sums their densities, each divided by the local slope ∣g′(xk)∣=2y\lvert g'(x_k)\rvert=2\sqrt y. Keeping only one branch would throw away half the probability. Where a branch has vanishing slope — here at x=0x=0, so near y=0y=0 — the density diverges, but integrably, which is exactly the χ12\chi^2_1 spike at the origin.

How does the probability integral transform let one uniform stream sample anything?

If UU is uniform on (0,1)(0,1), then X=FX−1(U)X=F_X^{-1}(U) has CDF FXF_X, because P(FX−1(U)≤x)=P(U≤FX(x))=FX(x)P(F_X^{-1}(U)\le x)=P(U\le F_X(x))=F_X(x). So to sample any continuous target you only need to invert its CDF and feed in uniforms. This is inverse-transform sampling, and it works whenever FX−1F_X^{-1} is available in closed form — the exponential, Cauchy, and logistic are textbook cases. When the inverse is awkward, as for the Gaussian, you switch to a purpose-built change of variables such as Box–Muller, or to rejection and Ziggurat methods. Either way, a single generator of uniform numbers becomes a generator for the whole zoo of distributions.

Why is the sum of independent variables a convolution, and why does it matter?

For independent XX and YY, the density of Z=X+YZ=X+Y is fZ(z)=∫fX(x)fY(z−x) dxf_Z(z)=\int f_X(x)f_Y(z-x)\,\mathrm{d}x, the convolution of the two densities. It is a special case of the bivariate Jacobian rule: change variables from (X,Y)(X,Y) to (Z,X)(Z,X), whose Jacobian is 11, and integrate out XX. It matters because convolution smooths — the sum is more spread and more bell-shaped than either summand — and iterating it is the mechanism behind the central limit theorem, where repeated convolution drives a normalised sum toward the Gaussian regardless of the starting shape.

Does a phase-space or coordinate change in physics use the same rule as a probability change of variables?

Yes — they are the same theorem wearing different clothes. A probability density is an integrand that integrates to one, so transforming it obeys the multivariable change-of-variables theorem, picking up ∣det⁡(∂x/∂y)∣\lvert\det(\partial\mathbf x/\partial\mathbf y)\rvert. The identical Jacobian governs how a phase-space volume element dΓ\mathrm d\Gamma transforms under a coordinate or canonical change, and Liouville's theorem is the statement that for Hamiltonian flow this determinant is one, so the phase-space density is conserved. That shared structure is why the density of states, error propagation, and Monte Carlo sampling all reduce to one Jacobian — the through-line traced by Jacobi above.

Before this

Where this leads