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 . 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 , and right-continuity are not assumptions but theorems about . 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 is distributed and set , how is distributed? The cleanest route is always the CDF: is a statement about events, evaluated by pulling the set back through — 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 . In one dimension the Jacobian is the modulus of a derivative; in 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.
- The cumulative distribution function 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.
- is non-decreasing and right-continuous with , ; its jumps locate point masses and its derivative, where it exists, recovers the density .
- Under a strictly monotone map the CDF transforms by composition, giving the density rule ; the modulus keeps densities positive.
- In dimensions the density picks up — the same Jacobian determinant that governs multidimensional integration; non-monotone maps sum over every preimage branch.
- The probability integral transform and its inverse are the engine of inverse-transform sampling and Monte Carlo.
- Key idea: Always transform at the level of the CDF — is a manipulation of events that needs no density — and obtain the density rule by differentiation, picking up 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 is reported as a frequency , the exact transformed density comes from , and the linearised 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 , 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 to is exactly . Because it is built from the probabilities of nested events , the CDF exists even when no density does — a discrete variable has a staircase with no derivative at its steps, yet still tells you everything. That is why every clean derivation about transformations starts with 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 there.
The Jacobian factor is bookkeeping for stretching. A map that compresses a small interval crowds the same probability into less length, so the density must rise by ; 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 into and it lands exactly where the density is large, because the inverse CDF spends more horizontal room where 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.
The core equations
The starting definition is a probability of an event, nothing more: the CDF is the chance that does not exceed a threshold. Everything structural about it follows from the axioms applied to the nested events .
where: — cumulative distribution function of ; — real threshold value; — probability measure on events. Reading: is the accumulated probability to the left of and including , 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.
where: — right-hand limit, so is right-continuous; non-decreasing — from event inclusion for . Reading: jumps are allowed (point masses), plateaus are allowed (gaps in support), but never falls and always tops out at . Two thresholds give an interval probability by subtraction, and differentiating where it is smooth recovers the density — the density is the local rate of accumulation.
where: — probability density, exists where is differentiable; — interval endpoints with . Reading: is the probability in an infinitesimal window, so 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.
where: — transformed variable, strictly monotone and differentiable; — inverse map, ; — absolute reciprocal slope. Reading: compress by and the density rises; stretch and it falls; the modulus keeps it positive for decreasing maps. In dimensions the reciprocal slope becomes the absolute value of the Jacobian determinant of the inverse map — the exact factor from multivariable calculus.
where: — -dimensional random vectors with ; — Jacobian matrix of ; — determinant. Reading: the determinant is the local volume-scaling of the map, and the absolute value preserves positivity of the measure. When is not one-to-one, every real preimage of contributes, and their densities are added, each weighted by its own local slope.
where: — the -th real root of ; — slope of there. Reading: a fold such as gathers mass from both ; 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.
where: — uniform random variable on ; — quantile function, the generalised inverse of . 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.
where: — sum of independent random variables; the integral is the convolution . 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.
The goal is to prove that the three characterising properties of equation (2) — monotonicity, the limits and at , and right-continuity — are not conventions imposed on but forced consequences of the axioms of probability acting on the nested family of events . Each is the image under the measure 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 . Then , and monotonicity of on nested events gives , i.e. . Why: a threshold that admits fewer outcomes cannot carry more probability, so can never decrease — the single fact behind the S-shape.
Step 2. As the events increase to the whole sample space, , and as they decrease to the empty set, . Continuity of the measure along monotone sequences gives and . 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 because for every forces . Continuity from above on this decreasing intersection gives . Why: including the endpoint in makes jump on arrival at a point mass, not on departure — the convention that makes , not , the clean object. *Conversely, any right-continuous non-decreasing 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
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 back through to rewrite in terms of , 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 strictly increasing. Then , so . 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: , and here . For a strictly decreasing the event flips to , giving and ; differentiating, the minus signs cancel. Why: both cases collapse into — the modulus is the trace of the that appears only for decreasing maps.
Step 3. If is not one-to-one, the event pulls back to a union of intervals around each root of . Differentiating the sum of the corresponding CDF pieces gives , and in dimensions each becomes . 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 the rule returns ; applied to it returns the two-branch formula used below.*
Go deeper · Derivation C · 1 minWhy 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 is continuous and strictly increasing: asking whether is below is the same as asking whether is below the quantile — which by definition has probability .
Step 1. Let with continuous and strictly increasing, and take . Then . Why: on is exactly the CDF of a variable, so is uniform — the distribution of has been completely erased.
Step 2. Invert the statement: if then has CDF , since . Why: this is a change of variables whose Jacobian exactly cancels the target density — inverse-transform sampling is the Jacobian rule read backwards.
Step 3. For a variable with atoms is not strictly increasing, so replace by the generalised (quantile) inverse ; the same identity holds with 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 explicitly and recovers ; the median maps to the true median shown in the second figure.*
Limiting cases
| Case | Result | Meaning |
|---|---|---|
| Linear map , | Shift relocates, scale dilates and divides by ; a Gaussian stays Gaussian, standardising to . | |
| Vanishing Jacobian | near | Locally flat maps concentrate probability; the density diverges integrably, as in the arcsine law . |
| Non-monotone | Sum over all preimage branches; gathers contributions from . | |
| Discrete | A right-continuous staircase; no density, but the CDF and the mass-pushforward still work. | |
| Degenerate limit | unit step at | The 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 . Show that the standardising map produces a standard normal, then find .
Step 1. The map is affine, with inverse and . The linear-map rule (equation 4) gives . The density carries a factor because the map stretches by .
Step 2. Substitute the Gaussian : the argument makes , and the prefactor , so . Y is exactly standard normal, — the affine map has erased and .
Step 3. Because , the CDF transforms by composition: . From the standard normal table . So , i.e. about of readings fall at or below . 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 with (mean lifetime ). A random-number generator delivers uniforms . Convert them to decay times and check the median.
Step 1. Write the target CDF by integrating the density from : for . It is strictly increasing, so the inverse is unique. This is the exact setting of the probability integral transform.
Step 2. Invert: . With , . Feeding a uniform through the inverse CDF is the change of variables whose Jacobian cancels the target density.
Step 3. Evaluate at the three uniforms: ; ; . The samples crowd toward small , exactly as the second figure shows, because the exponential density is largest there.
Step 4. Check the median: gave , and the true median solves , i.e. — they agree. Confirming the distribution: , so the sampler reproduces as required. Since is uniform whenever is, 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 with and an integrable spike as .
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
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 that keeps probability conserved when a density is transformed. Jacobi did not work in probability — the measure-theoretic language of 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.
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 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 density evaluates to at , with normalisation confirmed via the substitution ; (2) the Box–Muller Jacobian gives ; (3) the exponential sampler reproduces and the median ; (4) the standardising affine map returns .
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 — 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 captures jumps (atoms), smooth rises (continuous parts), and even singular components inside one non-decreasing, right-continuous function. For transformations this is decisive: is a statement about events that is always meaningful, whereas the density rule only applies where things are smooth. Work with 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, and differentiating gives a positive slope. For a decreasing map the event flips: means , so . Differentiating that introduces a minus sign, which cancels the negative to leave a positive density. Writing packages both cases in one formula and guarantees the result stays non-negative — as any density must. In 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 values to the same , so a single inverse branch is not enough. For and the equation has two roots , and both regions of contribute to . The multi-branch rule sums their densities, each divided by the local slope . Keeping only one branch would throw away half the probability. Where a branch has vanishing slope — here at , so near — the density diverges, but integrably, which is exactly the spike at the origin.
How does the probability integral transform let one uniform stream sample anything?
If is uniform on , then has CDF , because . 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 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 and , the density of is , the convolution of the two densities. It is a special case of the bivariate Jacobian rule: change variables from to , whose Jacobian is , and integrate out . 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 . The identical Jacobian governs how a phase-space volume element 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.