# Data representation: histograms, box plots, cumulative frequency

> IB Mathematics: Applications and Interpretation SL · IB AI SL
> Source: https://www.owlsprep.com/study/ib-math-ai-sl-u4-data-representation-histograms-box-plots/

This module covers core visual data representations for IB AI SL. You will learn to construct, read, and draw conclusions from histograms, box plots, and cumulative frequency diagrams, all regular exam question topics.

**Prerequisites:** [Measures of central tendency and spread](https://www.owlsprep.com/study/ib-math-ai-sl-u4-measures-central-tendency-spread/)

## Learning objectives

- Construct histograms for grouped continuous data, including for unequal class intervals
- Derive five-number summaries and interpret/construct box plots for comparing distributions
- Plot cumulative frequency diagrams and estimate percentiles, quartiles and medians
- Identify key distribution features (skewness, outliers) from all three representations

## Histograms for Grouped Continuous Data

**Histogram** — A graphical representation of grouped continuous data, where the area of each bar is proportional to the frequency of the class interval.

*Notation:* Vertical axis = frequency density, Horizontal axis = class boundaries

*Example:* For a class 10-20 with frequency 15, frequency density = $15/(20-10) = 1.5$

Unlike bar charts for categorical data, histograms have no gaps between bars because the underlying data is continuous. When class widths are unequal, the height of each bar (frequency density) is not equal to frequency: only the area of the bar represents total frequency.

**Worked example:** Calculate frequency density for the grouped mass data of 50 apples, and describe how to draw the histogram. Classes: 50-60 (f=8), 60-80 (f=22), 80-100 (f=20)

1. Calculate class width for each interval:
2. $$50\text{-}60: 60 - 50 = 10; \quad 60\text{-}80: 80 - 60 = 20; \quad 80\text{-}100: 100 - 80 = 20$$
3. Calculate frequency density = frequency / class width for each interval:
4. $$50\text{-}60: 8/10 = 0.8; \quad 60\text{-}80: 22/20 = 1.1; \quad 80\text{-}100: 20/20 = 1.0$$
5. Draw axes: mass on the horizontal axis, frequency density on the vertical axis. Draw each bar from the lower to upper class boundary, with height equal to the calculated frequency density.

> **Exam tip:** IB exam questions almost always use unequal class widths to test your understanding that area equals frequency, not height. Always calculate frequency density first for unequal classes.

## Box Plots and Five-Number Summaries

**Box Plot (Box-and-Whisker Plot)** — A visual display of numerical data based on the five-number summary, used to compare distributions and identify skewness and outliers.

*Notation:* Box spans Q1 to Q3, line at median, whiskers extend to min/max

*Example:* A symmetric distribution will have the median line in the centre of the box, and equal-length whiskers.

Box plots are the most common tool in IB exams for comparing two or more distributions. To get full marks, you must comment on both the centre (measured by the median) and the spread (measured by the interquartile range or range) of the distributions.

**Worked example:** Find the five-number summary for the raw data set: $[2, 3, 5, 7, 8, 10, 14, 15, 18, 20, 22]$

1. Confirm the data is sorted in ascending order (it is already sorted here, with $n=11$ values)
2. Find the median (Q2): position = $\frac{n+1}{2} = 6^{\text{th}}$ term, so median = $10$
3. Find Q1: median of the lower half of data (first 5 terms): $3^{\text{rd}}$ term = $5$
4. Find Q3: median of the upper half of data (last 5 terms): $9^{\text{th}}$ term = $18$
5. Five-number summary: minimum = $2$, Q1 = $5$, median = $10$, Q3 = $18$, maximum = $22$

> **Exam tip:** When comparing two box plots, always make two separate comments: one about average/centre (median) and one about variation/spread (IQR) to earn full marks.

## Cumulative Frequency Diagrams

**Cumulative Frequency Diagram** — A plot of the running total of frequencies against upper class boundaries, used to estimate percentiles, quartiles and medians for grouped data.

*Notation:* Vertical axis = cumulative frequency, Horizontal axis = upper class boundary

To find any percentile, draw a horizontal line from the required cumulative frequency to the curve, then drop a vertical line down to the horizontal axis to read the estimated value. For $n$ total data points, median is at $\frac{n}{2}$, Q1 at $\frac{n}{4}$, Q3 at $\frac{3n}{4}$.

**Worked example:** Estimate the median height for 100 students from the cumulative frequency data: Upper bound (cm): 150 (cf=12), 160 (cf=35), 170 (cf=68), 180 (cf=92), 190 (cf=100)

1. Median for 100 students is the 50th value, so we need the height at cumulative frequency = 50
2. Plot all (upper bound, cumulative frequency) points and join with a smooth curve
3. 50 falls between cf=35 (160 cm) and cf=68 (170 cm). Interpolate to estimate:
4. $$\text{Estimated median} = 160 + (170-160) \times \frac{50-35}{68-35} \approx 164.5 \text{ cm}$$

> **info**
>
> Cumulative frequency diagrams are often used in exams to get the quartiles needed to construct a box plot from grouped data.

## Common pitfalls

- **Wrong:** Treating histogram bar height as frequency for unequal class widths
  - Why it fails: Confusion between histograms and bar charts leads to incorrect frequency calculations
  - Correct: Always calculate frequency density = frequency / class width for unequal classes, remember area = frequency
- **Wrong:** Calculating quartiles for raw data without sorting first
  - Why it fails: Rushing through the question leads to incorrect positions and values for quartiles
  - Correct: Always sort raw data in ascending order before finding any percentiles or the five-number summary
- **Wrong:** Plotting cumulative frequency against class midpoints
  - Why it fails: Confusion with histogram plotting conventions leads to incorrect percentile estimates
  - Correct: Always plot cumulative frequency against upper class boundaries, as it counts all values up to that boundary
- **Wrong:** Only commenting on average when comparing box plots
  - Why it fails: Forgetting that comparison questions require comment on both centre and spread for full marks
  - Correct: Always make one comment about centre (median) and one comment about spread (IQR/range)

## Cheatsheet

| Graph Type | Key Features | Common Exam Uses | Quick Tip |
| --- | --- | --- | --- |
| Histogram | Area = frequency, frequency density (y-axis), no gaps | Display grouped continuous data | Check for unequal class widths |
| Box Plot | 5-number summary, shows outliers | Compare distributions, identify skewness | Compare median AND IQR |
| Cumulative Frequency | Plot against upper class boundaries | Estimate quartiles/percentiles | Median = n/2, Q1 = n/4, Q3 = 3n/4 |

## What's next

This sub-topic is the foundation of all descriptive statistics in IB AI SL, assessed in both Paper 1 and Paper 2. Mastering these data representations is essential for progressing to bivariate data analysis, correlation, and probability distributions. These skills also frequently appear in extended response questions that combine multiple statistics topics, so building a strong understanding early will help you with more complex topics later.

- [Measures of central tendency](https://www.owlsprep.com/study/ib-math-ai-sl-u4-measures-of-central-tendency/)
- [Measures of spread: variance, standard deviation](https://www.owlsprep.com/study/ib-math-ai-sl-u4-measures-of-spread-variance-standard/)
- [Correlation and linear regression](https://www.owlsprep.com/study/ib-math-ai-sl-u4-correlation-and-linear-regression/)

---

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-ai-sl-u4-data-representation-histograms-box-plots/
