The cumulative distribution function

In the last lesson, we learned that the PMF gives P(X=k)P(X = k), the probability of exactly kk. But sometimes we want to know: "What's the probability of getting at most kk?"

Defining the CDF

Cumulative Distribution Function

The CDF of a random variable XX is: FX(x)=P(Xx)F_X(x) = P(X \leq x)

It accumulates probability from left to right.

Building a CDF Step by Step

Step through each value to see how the CDF accumulates probability from left to right.

Distribution
PMF — P(X = k)
0.125
0
0.375
1
0.375
2
0.125
3
CDF — F(x) = P(X ≤ x)
0.250.500.751.000123

Press Next to add the first probability bar.

0 / 4

The CDF tells you: "What fraction of outcomes are at or below this value?"

If F(3) = 0.7, what's P(X ≤ 3)? (decimal, e.g. 0.42)
If F(3) = 0.7, what's P(X > 3)? (decimal, e.g. 0.42)

Properties of the CDF

The CDF always:

  • Starts at 0: No probability to the left of the smallest value
  • Ends at 1: All probability is accounted for as xx \to \infty
  • Never decreases: Probability only accumulates

For discrete variables, the CDF looks like a staircase, jumping up at each possible value.

The skyscraper plot

The PMF bars stack up to form the CDF staircase.

The Skyscraper Plot
PMF
0.10
0
0.15
1
0.25
2
0.25
3
0.15
4
0.07
5
0.03
6
CDF
0123456
Mean
2.53
Median
2
Mode
2
Var
2.23

Each step in the CDF equals the height of the corresponding PMF bar.

Build a PMF
PMF
1
2
3
4
5
CDF
Sum: 1.00Each step = bar height

Draw any PMF (the bars), and the CDF (the staircase) automatically follows. The height of each step equals the probability mass at that point.

Converting between PMF and CDF

You can go either direction:

From PMF to CDF: Sum up the probabilities FX(k)=jkpX(j)F_X(k) = \Large\sum_{j \leq k} p_X(j)

From CDF to PMF: Take the difference pX(k)=FX(k)FX(k1)p_X(k) = F_X(k) - F_X(k-1)

If p(1)=0.2, p(2)=0.3, p(3)=0.5, what is F(2)? (decimal, e.g. 0.42)
If F(4)=0.8 and F(5)=0.95, what is p(5)? (decimal, e.g. 0.42)

Probability of an interval

The CDF makes interval calculations easy:

Probability of an Interval

P(a<Xb)=FX(b)FX(a)P(a < X \leq b) = F_X(b) - F_X(a)

If F(5)=0.8 and F(2)=0.3, what is P(2 < X ≤ 5)? (decimal, e.g. 0.42)

The median and quantiles

The CDF helps us find important summary statistics.

Median

The median is the smallest value mm such that FX(m)0.5F_X(m) \geq 0.5. Half the probability is at or below the median.

More generally, the pp-th quantile (or percentile) is the smallest xx where FX(x)pF_X(x) \geq p.

Quantile Finder
123456
10%99%
Quantile at p = 0.50
2
Smallest x where F(x) ≥ p
What percentile is the median? (whole number)
If F(5)=0.45 and F(6)=0.52, what is the median? (whole number)

Summary

ConceptSymbolWhat it tells you
PMFpX(k)p_X(k)Probability of exactly kk
CDFFX(x)F_X(x)Probability of at most xx
Medianmm50th percentile

When you see a probability question, ask: "Do I need an exact value (use PMF) or a cumulative probability (use CDF)?" This guides your approach.

What's next

Now that we can describe random variables with PMFs and CDFs, let's meet some famous distributions. Next up: the Bernoulli and Binomial distributions.