The cumulative distribution function (CDF) of a random variable X gives the probability that X is less than or equal to a particular value x.
The CDF always satisfies 0 ≤ F(x) ≤ 1. If F(10) = 0.75, there is a 75% probability that X is less than or equal to 10.
Think of the CDF as asking: "How much probability has accumulated up to this point?" It gives you a running total as x moves from left to right across all possible values.
| Question | Answer |
|---|---|
| What does CDF stand for? | Cumulative Distribution Function |
| Core definition | F(x) = P(X ≤ x) |
| Range of output | 0 to 1 |
| Can CDF decrease? | No — always nondecreasing |
| CDF at −∞ | → 0 |
| CDF at +∞ | → 1 |
| Works for | Discrete and continuous variables |
| Related functions | PMF, PDF, survival function |
What Is a Cumulative Distribution Function?
Suppose X represents the number of customers entering a shop in one hour. If F(20) = 0.80, that means P(X ≤ 20) = 0.80 — there's an 80% chance that 20 or fewer customers arrive. The CDF doesn't tell you the probability of exactly 20 customers; it tells you the probability of at most 20.
This accumulation property is what makes the CDF so useful. Rather than looking at probability piece by piece, the CDF gives you the full picture up to any chosen value.
The CDF answers: "What fraction of the distribution lies below x?" A CDF value of 0.60 at x = 5 means 60% of the probability mass sits at or below 5.
The CDF applies to every type of random variable — discrete (like counts) and continuous (like heights or weights). This makes it one of the most general tools in probability and statistics.
CDF Formula
The formula depends on whether X is discrete or continuous.
X = random variable
x = specific value
F(x) = cumulative probability
f(t) = probability density function
Accumulated area under the PDF from −∞ to x
CDF for Discrete Random Variables
For a discrete random variable, the CDF is built by adding up probabilities one value at a time. At each possible value, you accumulate what has come before.
| x | P(X = x) | CDF — F(x) | How to read it |
|---|---|---|---|
| 1 | 0.10 | 0.10 | P(X ≤ 1) = 10% |
| 2 | 0.20 | 0.30 | P(X ≤ 2) = 30% |
| 3 | 0.30 | 0.60 | P(X ≤ 3) = 60% |
| 4 | 0.25 | 0.85 | P(X ≤ 4) = 85% |
| 5 | 0.15 | 1.00 | P(X ≤ 5) = 100% |
The discrete CDF has a step-function shape: it stays flat between possible values and jumps at each one. The size of each jump equals the probability of that exact value.
Worked Example — Discrete CDF
Problem: A quality inspector counts defective products per batch. The PMF is: P(X=0)=0.20, P(X=1)=0.35, P(X=2)=0.25, P(X=3)=0.15, P(X=4)=0.05. Find P(X ≤ 2), P(X < 3), P(X > 2), and P(1 ≤ X ≤ 3).
Build the CDF table:
F(0) = 0.20 | F(1) = 0.55 | F(2) = 0.80 | F(3) = 0.95 | F(4) = 1.00
P(X ≤ 2) = F(2) = 0.80 — There is an 80% chance of at most 2 defective products.
P(X < 3) = P(X ≤ 2) = F(2) = 0.80 — For discrete variables, "less than 3" is the same as "less than or equal to 2" since X only takes integer values.
P(X > 2) = 1 − F(2) = 1 − 0.80 = 0.20 — Use the complement rule.
P(1 ≤ X ≤ 3) = F(3) − F(0) = 0.95 − 0.20 = 0.75 — Subtract the CDF just below the lower bound.
✅ P(X ≤ 2) = 0.80 | P(X < 3) = 0.80 | P(X > 2) = 0.20 | P(1 ≤ X ≤ 3) = 0.75
CDF for Continuous Random Variables
For a continuous random variable, the CDF is obtained by integrating the probability density function (PDF) from negative infinity up to x. The key fact about continuous random variables: the probability of any single exact value is zero. P(X = x) = 0 for every x. Only intervals carry probability.
For a continuous random variable, asking "what's the probability of exactly 1.5?" gives zero. You can only ask about ranges. But P(X ≤ 1.5) = F(1.5) is a valid, non-zero probability.
Worked Example — Continuous CDF (Uniform Distribution)
Problem: X ~ Uniform(0, 10). The PDF is f(x) = 1/10 for 0 ≤ x ≤ 10. Find the CDF, then calculate P(X ≤ 4), P(X ≤ 7), and P(4 < X ≤ 7).
Derive the CDF by integration:
F(x) = ∫₀ˣ (1/10) dt = [t/10]₀ˣ = x/10, for 0 ≤ x ≤ 10
Piecewise definition:
F(x) = 0 (x < 0)
F(x) = x/10 (0 ≤ x ≤ 10)
F(x) = 1 (x > 10)
P(X ≤ 4) = F(4) = 4/10 = 0.40 — A 40% chance of a value at most 4.
P(X ≤ 7) = F(7) = 7/10 = 0.70 — A 70% chance of a value at most 7.
P(4 < X ≤ 7) = F(7) − F(4) = 0.70 − 0.40 = 0.30 — A 30% chance of falling in this interval.
✅ P(X ≤ 4) = 0.40 | P(X ≤ 7) = 0.70 | P(4 < X ≤ 7) = 0.30
Key Properties of a CDF
Every valid cumulative distribution function satisfies five mathematical properties. These aren't optional — they define what a CDF is.
Nondecreasing
If x₁ < x₂, then F(x₁) ≤ F(x₂)
As x grows, the event X ≤ x can only include additional outcomes. Probability never shrinks.
Bounded between 0 and 1
0 ≤ F(x) ≤ 1 for all x
F(x) is a probability, so it can never be negative or exceed 1.
Approaches 0 at −∞
lim x→−∞ F(x) = 0
There is zero probability of being below any conceivable lower bound.
Approaches 1 at +∞
lim x→+∞ F(x) = 1
All probability must be accounted for somewhere on the real line.
Right-continuous
lim t↓x F(t) = F(x)
The CDF approaches its value from the right. This matters at jump points in discrete distributions.
How to Calculate Probabilities Using a CDF
The CDF is the workhorse of probability calculations. Here are the four standard formulas you'll use constantly.
| Goal | Formula | Notes |
|---|---|---|
| P(X ≤ x) | F(x) | Direct CDF lookup |
| P(X > x) | 1 − F(x) | Complement rule |
| P(a < X ≤ b) | F(b) − F(a) | Interval probability |
| P(X = x) — continuous | 0 | Always zero for continuous X |
| P(X = x) — discrete | F(x) − F(x⁻) | Jump size at x |
| P(X < x) — continuous | F(x) | Same as P(X ≤ x) |
| P(X < x) — discrete | F(x) − P(X=x) | Differs from P(X ≤ x) |
Strict vs Non-Strict Inequalities
This distinction trips up many students. For a continuous random variable, P(X = x) = 0 for every single point, so the inequality sign doesn't matter:
For a discrete random variable, they can differ. If P(X = 3) = 0.15, then P(X ≤ 3) = F(3) but P(X < 3) = F(2), which is smaller by 0.15.
Interactive CDF Visualizer
Select a distribution and drag the x-value slider to see the CDF in action. The shaded region shows P(X ≤ x).
CDF vs PDF
The CDF and PDF both describe a probability distribution, but from different angles. The CDF gives cumulative probability; the PDF gives probability density.
| Feature | CDF | |
|---|---|---|
| Full name | Cumulative Distribution Function | Probability Density Function |
| Meaning | P(X ≤ x) | Density at point x |
| Output range | Always 0 to 1 | 0 to ∞ (can exceed 1) |
| Output is a probability? | Yes | No — it's a density |
| Monotonic? | Yes — always nondecreasing | Not necessarily |
| Applies to | Discrete and continuous | Continuous only |
| Relationship | Integral of PDF | Derivative of CDF (where it exists) |
The key mathematical relationship between the two:
A PDF value can be greater than 1. For example, Uniform(0, 0.5) has PDF f(x) = 2. That's fine — it's a density, not a probability. Only the area under the PDF (i.e., the integral) gives probability.
CDF vs PMF
| Feature | CDF | PMF |
|---|---|---|
| Full name | Cumulative Distribution Function | Probability Mass Function |
| Formula | P(X ≤ x) | P(X = x) |
| Applies to | Discrete and continuous | Discrete only |
| Output range | 0 to 1 | 0 to 1 |
| Monotonic? | Yes | Not necessarily |
| Shape | Step function (discrete) | Bar chart of exact probabilities |
PMF vs PDF vs CDF — Full Comparison
| Function | PMF | CDF | |
|---|---|---|---|
| For discrete? | Yes | No | Yes |
| For continuous? | No | Yes | Yes |
| What it gives | P(X=x) | Density at x | P(X≤x) |
| Values can exceed 1? | No | Yes | No |
| Cumulative? | No | No | Yes |
CDF of Common Probability Distributions
Normal Distribution
X ~ Normal(μ, σ²)
F(x) = Φ( (x − μ) / σ )Here Φ is the standard normal CDF. To find P(X ≤ x), standardize x to a z-score and look up Φ. The z-table gives Φ(z) values.
Problem: X ~ Normal(μ=100, σ=15). Find P(X ≤ 130).
Standardize: z = (130 − 100) / 15 = 30/15 = 2.00
Look up Φ(2.00): From the z-table or software, Φ(2.00) ≈ 0.9772
✅ P(X ≤ 130) = Φ(2.00) ≈ 0.9772. About 97.7% of the distribution lies below 130.
Uniform Distribution
X ~ Uniform(a, b)
F(x) = (x − a) / (b − a) for a ≤ x ≤ bF(x) = 0 for x < a, and F(x) = 1 for x > b. Probability accumulates linearly, so the CDF is a straight line between the bounds. See the basic probability guide.
Exponential Distribution
X ~ Exponential(λ)
F(x) = 1 − e^(−λx) for x ≥ 0The exponential CDF rises from 0 and approaches 1 asymptotically. It models time-to-event: the probability of a failure or event occurring within x units of time. Common in survival analysis.
Binomial Distribution
X ~ Binomial(n, p)
F(k) = Σ_{x=0}^{k} C(n,x) · p^x · (1−p)^(n−x)The binomial CDF sums the PMF from 0 up to k. Use software or the binomial calculator for large n. The binomial distribution table provides precomputed values.
Poisson Distribution
X ~ Poisson(λ)
F(k) = Σ_{x=0}^{k} (e^(−λ) · λ^x) / x!Useful for modeling event counts per interval. Sum the PMF from 0 to k. Use the Poisson distribution table for quick lookups.
| Distribution | CDF Formula | Parameters |
|---|---|---|
| Normal | Φ((x−μ)/σ) | μ = mean, σ = SD |
| Uniform(a,b) | (x−a)/(b−a) | a = lower, b = upper |
| Exponential(λ) | 1 − e^(−λx) | λ = rate |
| Binomial(n,p) | Σ PMF from 0 to k | n = trials, p = success prob |
| Poisson(λ) | Σ PMF from 0 to k | λ = average rate |
Empirical CDF (ECDF)
When you have real data, you can estimate the population CDF directly from your observations. This is the empirical CDF, or ECDF.
For a sample of n observations x₁, x₂, ..., xₙ, the ECDF at any point x is the fraction of observations that fall at or below x:
The ECDF is a step function — it jumps at every data point. It's completely nonparametric: no distribution assumption needed.
| x | Observations ≤ x | ECDF Fₙ(x) |
|---|---|---|
| 2 | 1 | 0.20 |
| 4 | 3 (two observations of 4) | 0.60 |
| 7 | 4 | 0.80 |
| 9 | 5 | 1.00 |
| Feature | ECDF | Theoretical CDF |
|---|---|---|
| Based on | Observed sample data | Probability model |
| Shape | Step function | Depends on distribution |
| Assumption | None (nonparametric) | Requires specified distribution |
| Use case | Exploratory analysis, goodness-of-fit | Probability calculations |
CDF, Quantiles, and Percentiles
The CDF and quantiles are two sides of the same coin. The CDF maps a value to a probability; a quantile maps a probability back to a value.
To find the 90th percentile: solve F(x) = 0.90 for x. For the median: solve F(m) = 0.50. This is exactly what software functions like qnorm() in R or norm.ppf() in Python compute. Learn more about z-scores and percentiles.
Survival Function
The survival function S(x) is the complement of the CDF:
If X represents the lifetime of a machine component, S(t) gives the probability that the component is still working at time t. Survival functions appear throughout reliability engineering, insurance, and clinical trials.
CDF Calculator
CDF Calculator — Find P(X ≤ x)
CDF in Real-World Applications
Finance & Risk
Value at Risk (VaR) uses the inverse CDF to find the loss threshold exceeded with a specified probability.
Reliability Engineering
F(t) gives the probability of failure by time t; the survival function S(t) = 1−F(t) gives the reliability.
Clinical Trials
CDFs describe time-to-event outcomes. The Kaplan–Meier estimator is a nonparametric analog of the survival function.
Data Analysis
The ECDF lets you visualize any dataset's full distribution without binning — no histogram subjectivity.
Machine Learning
CDF-based transformations (probability integral transform) convert any continuous variable to Uniform(0,1).
Quality Control
Acceptance sampling uses CDFs to compute the probability of accepting a lot with a given defect rate.
CDF in Statistical Software
CDF in R
In R, the p prefix gives the CDF for any distribution family.
# Normal CDF: P(X ≤ 1.5) where X ~ N(0,1) pnorm(1.5, mean = 0, sd = 1) # → 0.9332 # Uniform CDF: P(X ≤ 3) where X ~ Uniform(0,10) punif(3, min = 0, max = 10) # → 0.3000 # Exponential CDF: P(X ≤ 2) where X ~ Exp(rate=1) pexp(2, rate = 1) # → 0.8647 # Binomial CDF: P(X ≤ 4) where X ~ Binom(10, 0.5) pbinom(4, size = 10, prob = 0.5) # → 0.3770 # Poisson CDF: P(X ≤ 3) where X ~ Poisson(lambda=2) ppois(3, lambda = 2) # → 0.8571
CDF in Python
from scipy import stats # Normal CDF: P(X ≤ 1.5) where X ~ N(0,1) stats.norm.cdf(1.5, loc=0, scale=1) # → 0.9332 # Exponential CDF: P(X ≤ 2) where X ~ Exp(rate=1) stats.expon.cdf(2, scale=1) # → 0.8647 # Binomial CDF: P(X ≤ 4) where X ~ Binom(10, 0.5) stats.binom.cdf(4, n=10, p=0.5) # → 0.3770 # Poisson CDF: P(X ≤ 3) where X ~ Poisson(lambda=2) stats.poisson.cdf(3, mu=2) # → 0.8571
CDF in Excel
| Distribution | Excel Formula | Key argument |
|---|---|---|
| Normal | =NORM.DIST(x, mean, std_dev, TRUE) | TRUE = cumulative |
| Standard Normal | =NORM.S.DIST(z, TRUE) | z = standardized value |
| Binomial | =BINOM.DIST(k, n, p, TRUE) | TRUE = cumulative |
| Poisson | =POISSON.DIST(k, lambda, TRUE) | TRUE = cumulative |
| Exponential | =EXPON.DIST(x, lambda, TRUE) | TRUE = cumulative |
Common Mistakes with CDFs
| Mistake | Wrong thinking | Correct understanding |
|---|---|---|
| Treating CDF as PDF | F(x) gives the probability density at x | F(x) = P(X ≤ x) — a cumulative probability, not a density |
| PDF values as probabilities | If f(2) = 0.4, there's a 40% chance of X = 2 | f(2) is a density. For continuous X, P(X=2) = 0 |
| CDF can decrease | F(5) could be less than F(3) | CDFs are always nondecreasing. F(5) ≥ F(3) |
| CDF can exceed 1 | F(x) = 1.2 is possible | F(x) is always between 0 and 1 |
| Ignoring endpoint difference | P(X ≤ 3) = P(X < 3) always | For discrete X: P(X < 3) = F(2), not F(3) |
| Forgetting the complement | P(X > 5) requires a new calculation | P(X > 5) = 1 − F(5) |
| Interval probability error | P(2 < X ≤ 5) = F(5) only | P(2 < X ≤ 5) = F(5) − F(2) |
| ECDF = population CDF | My sample's ECDF is the true CDF | The ECDF estimates the population CDF with sampling error |
Frequently Asked Questions
CDF stands for Cumulative Distribution Function. It tells you the probability that a random variable X takes a value at or below x. The formula is F(x) = P(X ≤ x). If F(50) = 0.75, you know 75% of the distribution falls at or below 50.
No. CDFs are always nondecreasing. As x increases, the event X ≤ x either includes the same outcomes or more. It can never shrink. So F(x₂) ≥ F(x₁) whenever x₂ > x₁.
The CDF gives cumulative probability: F(x) = P(X ≤ x), always between 0 and 1. The PDF describes probability density for a continuous variable. It is the derivative of the CDF where the derivative exists, and its values can exceed 1. To get probability from a PDF, you integrate it over an interval. The CDF is the result of that integration.
Use the complement rule: P(X > x) = 1 − F(x). If F(10) = 0.80, then P(X > 10) = 1 − 0.80 = 0.20.
For a continuous random variable: P(a < X ≤ b) = F(b) − F(a). For a discrete variable, the formula is the same, but you need to be careful about whether the endpoints are included. P(a ≤ X ≤ b) = F(b) − F(a−1) for integer-valued discrete variables.
An empirical CDF (ECDF) is built directly from observed data. For each value x, it gives the proportion of sample observations that are ≤ x. The result is a step function that estimates the true population CDF. No distributional assumption is required.
The inverse CDF (quantile function) reverses the CDF: given a probability p, it returns the value x such that F(x) = p. In R this is qnorm(); in Python/SciPy, norm.ppf(). It's used to find percentiles and to generate random samples from any distribution.
For continuous random variables: yes, because P(X = x) = 0. For discrete random variables: no. P(X ≤ 3) includes X = 3, but P(X < 3) does not. If P(X=3) > 0, the two probabilities differ by that amount.
R uses the p prefix for all CDF functions: pnorm() for normal, punif() for uniform, pexp() for exponential, pbinom() for binomial, and ppois() for Poisson. Each returns P(X ≤ x) by default.
The pth percentile is the value x where F(x) = p/100. The 75th percentile, for instance, is x where F(x) = 0.75. The median corresponds to F(x) = 0.50. See also the guide to percentiles.