Cumulative Distribution Function

The cumulative distribution function (CDF) of a random variable X is the function F(x) = P(X ≤ x), giving, for every possible value x, the probability that the variable lands at or below x. Unlike a probability mass function or density, which describe where probability sits, the CDF accumulates it from the far left, so it starts near 0 at the bottom of the range, never decreases, and finishes at 1. The same definition works for every kind of random variable: for a discrete variable such as a die roll the CDF is a staircase that jumps at each possible value, while for a continuous variable such as height it is a smooth curve whose slope at any point is the probability density there.

The CDF's most useful property is that interval probabilities come from simple subtraction: P(a < X ≤ b) = F(b) − F(a). For a fair die, F(5) − F(2) = 5/6 − 2/6 = 3/6, the chance of rolling a 3, 4 or 5. For a standard normal variable, F(1.96) ≈ 0.975 and F(−1.96) ≈ 0.025, so the central region between them holds about 95% of the probability, which is exactly where the familiar 1.96 comes from. Statistical tables of the normal, t and chi-square distributions are all just tabulated CDFs (or their inverses), and a p-value is a CDF evaluation in disguise: the upper-tail probability 1 − F(observed statistic) under the null distribution used in hypothesis-testing.

Cumulative distribution function F(x) = P(X ≤ x): the running total of probability, for any kind of variable Discrete: fair die, F(x) steps up by 1/6 1 2 3 4 5 6 1 0 F(3) = 3/6 = 0.5 | P(2 < X ≤ 5) = F(5) − F(2) = 3/6 Continuous: standard normal, smooth S-curve F(0) = 0.5 F(1.96) = 0.975 -3 -2 -1 0 1 2 3 never decreases, starts near 0, ends at 1

Running the CDF backwards gives the quantile function, and that inversion is what makes the CDF a working tool rather than just a description. If p is a probability, the quantile F^(-1)(p) is the value below which a fraction p of the distribution lies: the median is the quantile at 0.5, and quartiles, percentiles and the critical values used in a confidence-interval are all quantiles. The same idea powers inverse transform sampling: if U is uniform between 0 and 1, then F^(-1)(U) has CDF F, so any distribution whose CDF can be inverted can be simulated from a plain uniform random number generator. The converse, the probability integral transform, says that applying a continuous variable's own CDF to it yields a uniform variable, which is why p-values are uniformly distributed when the null hypothesis is true.

The empirical CDF turns a dataset itself into a CDF: at each x it reports the fraction of observed values at or below x, producing a staircase that jumps by 1/n at every data point. The Glivenko–Cantelli theorem (1933) guarantees that this staircase converges uniformly to the true CDF as the sample grows, which is the theoretical backbone of treating a sample as a stand-in for its population. The Kolmogorov–Smirnov test, built on Kolmogorov's 1933 work and later extended by Smirnov, uses the largest vertical gap between an empirical CDF and a reference CDF (or between two empirical CDFs) to test whether data follow a hypothesized distribution or whether two samples come from the same one. In practice, ECDF plots are a favorite of data scientists because, unlike histograms, they involve no bin-width choice and let percentiles be read straight off the vertical axis, and the CDF of a model's predicted scores underlies ROC-style comparisons and calibration checks in machine learning.

Fair die, X = number rolled
P(X = k) = 1/6 for k = 1 to 6
Build the CDF by accumulating
F(1) = 1/6
about 0.167
F(3) = 3/6
0.5
F(6) = 6/6
1.0
P(3 ≤ X ≤ 5) = F(5) − F(2)
5/6 − 2/6 = 3/6 = 0.5
Invert it: the 0.5 quantile is the median
smallest x with F(x) ≥ 0.5 is 3

A common pitfall is confusing the CDF with the density, and with it the belief that a CDF value is a probability of equaling x. For a continuous variable, P(X = x) is exactly zero for every single x; only intervals carry probability, and a density can exceed 1 (a uniform density on an interval of width 0.1 is 10) while a CDF never can. A second trap is the direction: F(x) counts probability at or below x, so tail questions such as how likely a value this large or larger need the complement 1 − F(x), and for discrete variables the difference between less than and at most matters, since F(x) includes the point mass at x itself.

Read the cumulative distribution function as a distribution's complete fingerprint drawn as a running total of probability: every interval probability is a subtraction, every percentile and critical value is its inverse, and every dataset has one of its own, which is why a single curve can unify discrete and continuous variables, simulation, hypothesis tests and goodness-of-fit checks.

Take cumulative distribution function further

Ask the copilot about this term, or have our engineers assess it against your process.