# Cumulative distributions and percentiles

> IB Mathematics AA SL · IB AA SL
> Source: https://www.owlsprep.com/study/ib-math-aa-sl-u4-cumulative-distributions-and-percentiles/

This sub-topic covers cumulative distribution functions (CDFs) for discrete and continuous random variables, and how to use CDFs to calculate percentiles, quartiles, median and interquartile range, all core skills for IB AA SL statistics exams.

**Prerequisites:** [Probability distributions](https://www.owlsprep.com/study/ib-math-aa-sl-u4-probability-distributions/); [Descriptive statistics](https://www.owlsprep.com/study/ib-math-aa-sl-u3-descriptive-statistics/)

## Learning objectives

- Define cumulative distribution functions for discrete and continuous random variables
- Calculate percentiles, quartiles and median from cumulative distributions
- Calculate interquartile range from cumulative distributions
- Interpret percentiles in statistical contexts

## 1. Cumulative Distribution Function (CDF) Basics

**Cumulative Distribution Function (CDF)** — For any random variable $X$, the CDF gives the total probability that $X$ takes a value less than or equal to a given input $x$, and it ranges from 0 to 1.

*Notation:* $F(x) = P(X \leq x)$

*Example:* For a fair 6-sided die, $F(3) = P(X \leq 3) = 0.5$

For discrete random variables, the CDF is a step function built by summing individual probabilities up to each value of $x$. For continuous random variables, the CDF is a continuous increasing function found by integrating the probability density function (PDF) from negative infinity up to $x$.

**Worked example:** A discrete random variable $X$ has probability distribution: $P(X=1)=0.2$, $P(X=2)=0.3$, $P(X=3)=0.4$, $P(X=4)=0.1$. Calculate the full CDF $F(x)$.

1. For $x$ less than the smallest outcome 1: no probability is accumulated:
2. $$F(x) = 0 \quad \text{for } x < 1$$
3. For $1 \leq x < 2$, sum probabilities up to 1:
4. $$F(x) = 0.2$$
5. For $2 \leq x < 3$, add the probability of $X=2$:
6. $$F(x) = 0.2 + 0.3 = 0.5$$
7. For $3 \leq x < 4$, add the probability of $X=3$:
8. $$F(x) = 0.5 + 0.4 = 0.9$$
9. For $x \geq 4$, all probabilities are accumulated:
10. $$F(x) = 0.9 + 0.1 = 1 \quad \text{for } x \geq 4$$

> **info**
>
> All valid CDFs start at 0 for the minimum value of $X$ and end at 1 for the maximum value of $X$. You can use this to check your work.

## 2. Calculating Percentiles and Median

**k-th Percentile** — The $k$-th percentile $p_k$ is the value of $X$ that satisfies $F(p_k) = \frac{k}{100}$. The median is the 50th percentile.

For discrete random variables, if $F(x)$ never exactly equals $\frac{k}{100}$, the percentile is the smallest value of $x$ where $F(x) \geq \frac{k}{100}$. For continuous random variables, you solve the equation $F(x) = \frac{k}{100}$ directly to get an exact value.

**Worked example:** Find the 50th percentile (median) for the CDF calculated in the previous section.

1. Write the condition for the 50th percentile:
2. $$F(p_{50}) = \frac{50}{100} = 0.5$$
3. Check the CDF values: $F(2) = 0.5$, which matches the condition exactly.
4. Therefore, the 50th percentile (median) is 2.

**Worked example:** A continuous random variable $X$ has CDF $F(x) = 0.2x$ for $0 \leq x \leq 5$. Find the 25th percentile.

1. Set up the percentile condition:
2. $$F(p_{25}) = 0.25$$
3. Substitute the CDF expression and solve:
4. $$0.2 p_{25} = 0.25 \implies p_{25} = \frac{0.25}{0.2} = 1.25$$

## 3. Interquartile Range (IQR) from CDF

The interquartile range is a common measure of spread that ignores outliers. It is calculated as $IQR = Q_3 - Q_1$, where $Q_1$ (first quartile) is the 25th percentile and $Q_3$ (third quartile) is the 75th percentile. To find IQR from a CDF, you just calculate both quartiles then subtract.

**Worked example:** A continuous random variable $X$ has CDF $F(x) = \frac{x^2}{16}$ for $0 \leq x \leq 4$. Calculate the interquartile range.

1. Find $Q_1$ (25th percentile): set $F(Q_1) = 0.25$:
2. $$\frac{Q_1^2}{16} = 0.25 \implies Q_1^2 = 4 \implies Q_1 = 2$$
3. Find $Q_3$ (75th percentile): set $F(Q_3) = 0.75$:
4. $$\frac{Q_3^2}{16} = 0.75 \implies Q_3^2 = 12 \implies Q_3 = 2\sqrt{3} \approx 3.464$$
5. Calculate IQR:
6. $$IQR = Q_3 - Q_1 = 2\sqrt{3} - 2 \approx 1.46$$

> **tip**
>
> IB exams accept both exact simplified form and 3 significant figure rounded values for IQR, unless the question specifies otherwise.

## Common pitfalls

- **Wrong:** Using $P(X < x)$ instead of $P(X \leq x)$ for discrete CDFs
  - Why it fails: This changes cumulative probability values for discrete distributions, leading to incorrect percentiles
  - Correct: Always include the current value of $x$ when calculating cumulative probability for discrete CDFs
- **Wrong:** Using PDF directly to find percentiles
  - Why it fails: PDF values do not represent cumulative probability, so solving $f(x) = 0.5$ will not give the median
  - Correct: Always integrate the PDF to get the CDF first, then use the CDF to find percentiles
- **Wrong:** Picking the wrong x for discrete percentiles when F(x) ≠ k/100
  - Why it fails: Many students pick the last x with F(x) < k/100, which contradicts the definition
  - Correct: Always pick the smallest x where F(x) ≥ k/100 for discrete distributions
- **Wrong:** Forgetting to check that CDF ends at 1
  - Why it fails: A summation or integration error that leaves F(x) not equal to 1 will throw off all percentile calculations
  - Correct: Always verify that F(max(X)) = 1 before calculating any percentiles or quartiles

## Cheatsheet

| Concept | Discrete Random Variable | Continuous Random Variable |
| --- | --- | --- |
| CDF | $F(x) = \sum_{t \leq x} P(X=t)$ | $F(x) = \int_{-\infty}^x f(t) dt$ |
| k-th Percentile Rule | Smallest $x$ with $F(x) \geq \frac{k}{100}$ | Solve $F(x) = \frac{k}{100}$ for $x$ |
| Quartiles | $Q_1 = 25^{th}, Q_3 = 75^{th}$ percentile | $Q_1 = 25^{th}, Q_3 = 75^{th}$ percentile |
| IQR Formula | $IQR = Q_3 - Q_1$ | $IQR = Q_3 - Q_1$ |

## What's next

Understanding cumulative distributions and percentiles is foundational for more advanced statistical concepts you will encounter in IB AA SL, including normal distribution probability calculations and descriptive data analysis. Note that confidence intervals — often grouped with this material elsewhere — belong to Math AI, not AA, and are not required for AA SL. These skills are regularly tested in both paper 1 and paper 2 of the IB exam, often combined with other topics like discrete probability distributions and box plots. Mastery of CDFs and percentiles will also help you when interpreting and summarizing statistical results for your internal assessment project.

- [Probability, conditional probability and independent events](https://www.owlsprep.com/study/ib-math-aa-sl-u4-probability-conditional-probability-and-independent/)
- [Discrete probability distributions, expectation and variance](https://www.owlsprep.com/study/ib-math-aa-sl-u4-discrete-probability-distributions-expectation-and/)
- [Binomial probability distribution](https://www.owlsprep.com/study/ib-math-aa-sl-u4-binomial-probability-distribution/)

---

From [OwlsPrep](https://www.owlsprep.com) — free study guides for A-Level, IB, AP and IGCSE, written against the official syllabus. Canonical page: https://www.owlsprep.com/study/ib-math-aa-sl-u4-cumulative-distributions-and-percentiles/
