MathemagiciansLibraryExplorationsDeep Dives
← Mathematics · Upper Secondary
MathematicsUpper Secondary

Reading cumulative frequency — median and quartiles

U4 — Statistics Advancing › U4.1 — Cumulative Frequency and Box PlotsLecture 2 of 4~2640 words

The middle student, without the list

Go back to the 80 students whose heights were grouped into classes from 150 cm to 180 cm. Here is a natural question: what is a typical height in this group?

One good answer is the median, the height of the middle student. With a list, you know how to find it. Line the students up from shortest to tallest and look at the one in the middle.

But we do not have a list. The table has thrown away the 80 individual heights. All we know is how many students are in each class. The middle student is somewhere inside the class 160 ≤ h < 165, and the table cannot say where.

There is a second problem. For a list, you may have learned that the median is the th value. For 80 students that is the 40.5th student, which is not a person at all. So which number do we use, and why?

The cumulative frequency curve answers both questions. The last lecture promised that reading the curve backwards would find the middle value and the quarter points of a data set. Here is how, and here is the reason behind each step.

Reading across, then down

Every point on the curve says one thing: "this many students are shorter than this height". To find the median, we want the height that has half the students below it. Half of 80 is 40.

So start on the cumulative frequency axis, at 40. Go across until you meet the curve. Then go straight down to the height axis. The reading is about 164.8 cm.

This means that about 40 students are shorter than 164.8 cm, and about 40 are taller. That is exactly what a median is: the value that splits the group into two equal halves.

Notice the direction. Last lecture, most questions gave you a height and asked for a count, so you started on the height axis. Now you know the count, 40, and you want the height. So you must start on the count axis. The rule is simple: start on the axis you know.

Cutting the group into four

Halves are useful. Quarters tell you more. Cut the 80 students into four groups of 20, from the shortest to the tallest. The heights where the cuts fall have names.

Read each one the same way: across from the count, down to the height.

150 155 160 165 170 175 180 0 20 40 60 80 Height (cm) Cumulative frequency Q₁ Q₂ Q₃
The heights curve read backwards. Across from 20, 40 and 60 students, then down: Q₁ ≈ 160.8 cm, the median (Q₂) ≈ 164.8 cm, Q₃ ≈ 169.4 cm.
Median and quartiles from a cumulative frequency curve

For a total frequency of , go across from these counts to the curve, then down:

lower quartile Q₁ at

median at

upper quartile Q₃ at

Now look at the four groups on the height axis. Each group has exactly 20 students. But the groups are not the same width.

Group of 20 studentsFrom (cm)To (cm)Width (cm)
Shortest quarter150≈ 160.8≈ 10.8
Second quarter≈ 160.8≈ 164.8≈ 4.0
Third quarter≈ 164.8≈ 169.4≈ 4.6
Tallest quarter≈ 169.4180≈ 10.6

The two middle quarters are squeezed into less than 9 cm. The two outer quarters each need more than 10 cm. This is because the curve is steep in the middle. A steep curve climbs 20 students in a short distance, so the students there are crowded together.

That is it. That is the whole idea. Equal counts go up the side of the graph in equal steps. On the measurement axis, those equal counts take up unequal widths. Narrow means crowded and wide means spread out. The quartiles turn the shape of the curve into numbers.

Stop and think

The shortest quarter covers about 10.8 cm, while the second quarter covers only about 4.0 cm. Does that mean the shortest quarter contains more students?

Show the answer

No. Each quarter contains exactly 20 students. That is how the quartiles were chosen. A wider quarter means the same 20 students are spread over more centimetres, so they are less crowded. On the curve, that part is flatter.

This is the opposite of a bar chart, where a wider or taller bar means more values. Here the count is fixed at 20, and the width tells you how thinly those 20 are spread.

Why n/2 and not (n + 1)/2

Now return to the second problem from the start. Why read at 40, and not at 40.5?

For a list, the rule gives a position in the line. With 7 values in order, the middle one is the 4th, and . With 80 values, the middle is halfway between the 40th and the 41st. That is what "the 40.5th value" means.

A cumulative frequency curve does not show positions. It shows counts, "how many are below this value", and it treats the values as spread smoothly along the axis. On the curve, half the students lie below the height where the count is half the total. Half of 80 is 40. So the curve's median is read at .

Does the choice matter? Try both. At 40 the curve gives about 164.78 cm. At 40.5 it gives about 164.89 cm. The difference is about 0.1 cm. The curve itself is only an estimate inside each class, and its error is larger than that. So for a curve, the course uses , and . Keep the rule for small lists, where you can see every value.

The interquartile range: the spread of the middle half

The median tells you where the middle of the group is. You also want to know how spread out the group is. One measure is the range: the largest value minus the smallest.

The range has two weaknesses. It depends on only the two most extreme values, so one unusual student changes it completely. And from a grouped table we do not even know the smallest and largest heights.

The quartiles give a better measure. Between Q₁ and Q₃ lie the middle half of the students. The distance between them is the interquartile range, or IQR.

Interquartile range

IQR = Q₃ − Q₁

It is the width of the middle half of the data, measured in the units of the data.

For the heights, IQR ≈ 169.4 − 160.8 = 8.6 cm. So the middle half of the students are within about 8.6 cm of each other. The shortest and tallest quarters do not affect this number at all. That is why the IQR is called resistant: an extreme value cannot pull it.

The median is resistant in the same way, and the mean is not. Here is an invented example. Five people earn $300, $320, $350, $400 and $5000 a week. The mean is $6370 ÷ 5 = $1274, which is more than four of the five people earn. The median is $350, the middle person, and it describes the group much better.

Before you practise, test yourself on the most common slip in IQR questions.

Spot the error — the IQR of 80 test scores

Ana finds the median and the IQR of 80 test scores from a cumulative frequency curve. One line is wrong. Tap it.

Ana's working, with the wrong line marked:

  • Line 1: n = 80, so the median is read at a cumulative frequency of 80 ÷ 2 = 40.
  • Line 2: Q₁ is read at 80 ÷ 4 = 20 and Q₃ at 3 × 80 ÷ 4 = 60.
  • Line 3: From 40, across to the curve and down: median ≈ 53.8.
  • Line 4: From 20: Q₁ ≈ 44.5. From 60: Q₃ ≈ 62.5.
  • Line 5: Wrong: IQR = 60 − 20 = 40. These are counts, not scores. The IQR is Q₃ − Q₁ ≈ 62.5 − 44.5 = 18.
  • Line 6: Between Q₁ and Q₃ there are 40 students, half of the 80.

Ana's slip is easy to make, because both pairs of numbers sit on the same graph. Ask yourself which axis a number lives on. Counts live on the vertical axis. The median, the quartiles and the IQR all live on the measurement axis.

Any fraction you like: percentiles

Nothing forces us to stop at halves and quarters. To find the height with 10% of the students below it, read across from 10% of 80, which is 8. This value is called the 10th percentile. In general, the pth percentile is read at a cumulative frequency of p% of n.

The quartiles are simply three of the percentiles. Q₁ is the 25th percentile, the median is the 50th and Q₃ is the 75th. Use the curve below to read any percentile of the heights.

Explore — reading percentiles of the heights

Choose a percentage. The dashed path starts on the count axis, goes across to the curve and down to the height. Move in steps of 5% and watch how far the height moves each time, in the middle and near the ends.

Presets:

The table shows percentiles read from the heights curve, by the smooth curve and by straight lines.

PercentileCount belowSmooth curve (cm)Straight lines (cm)
10th8≈ 156.7≈ 156.3
25th (Q₁)20≈ 160.8≈ 160.6
50th (median)40≈ 164.8≈ 164.8
75th (Q₃)60≈ 169.4≈ 169.5
90th72≈ 173.4≈ 173.8

Near the median, a step of 5%, which is 4 students, moves the height by less than 1 cm. Near 5% or 95%, the same 4 students take up more than 2 cm. Equal counts take up small widths where the data are crowded and large widths where they are thin.

Worked examples

Worked Example 1 — Waiting times at a coffee shop

This is the coffee shop from the last lecture: 60 customers, with running totals 8, 23, 42, 54 and 60 at the upper boundaries 2, 4, 6, 8 and 10 minutes. The points are (0, 0), (2, 8), (4, 23), (6, 42), (8, 54) and (10, 60).

Positions. n = 60. Q₁ at 60 ÷ 4 = 15. Median at 60 ÷ 2 = 30. Q₃ at 3 × 60 ÷ 4 = 45.

Read. Across from each count to the curve, then down (see the figure):

  • Q₁ ≈ 3.0 minutes
  • Median ≈ 4.7 minutes
  • Q₃ ≈ 6.4 minutes

IQR. 6.4 − 3.0 = 3.4 minutes.

Meaning. A typical customer waited about 4.7 minutes. The middle half of the customers waited between about 3.0 and 6.4 minutes, a spread of about 3.4 minutes.

Check. The median count, 30, lies between the points (4, 23) and (6, 42), so the median must be between 4 and 6 minutes. ✓ Straight lines give Q₁ ≈ 2.9, median ≈ 4.7 and Q₃ = 6.5, so IQR ≈ 3.6. The two methods agree to within a few tenths of a minute. ✓

0 2 4 6 8 10 0 15 30 45 60 Waiting time (minutes) Cumulative frequency Q₁ Q₂ Q₃
Waiting times of 60 customers. Across from 15, 30 and 45: Q₁ ≈ 3.0, median (Q₂) ≈ 4.7, Q₃ ≈ 6.4 minutes.
Worked Example 2 — Test scores of 80 students

The scores of 80 students are grouped in classes of width 10, from 20 to 80.

Score, sFrequencyCumulative frequency
20 ≤ s < 3044
30 ≤ s < 40913
40 ≤ s < 501831
50 ≤ s < 602455
60 ≤ s < 701772
70 ≤ s < 80880

Points. (20, 0), (30, 4), (40, 13), (50, 31), (60, 55), (70, 72), (80, 80). The last total is 80. ✓

Read. At 20, 40 and 60: Q₁ ≈ 44.5, median ≈ 53.8, Q₃ ≈ 62.5. So IQR ≈ 62.5 − 44.5 = 18 marks.

Think about the answer. The median is above 50, the middle of the score axis, because the busiest classes are in the upper half.

Check. The median count, 40, is between 31 (at 50) and 55 (at 60). So the median is between 50 and 60, a little below 55. ✓

20 30 40 50 60 70 80 0 20 40 60 80 Score Cumulative frequency Q₁ Q₂ Q₃
Scores of 80 students. Across from 20, 40 and 60: Q₁ ≈ 44.5, median (Q₂) ≈ 53.8, Q₃ ≈ 62.5.
Worked Example 3 — A quartile that needs no curve

Forty students take a test marked out of 50, with whole-number marks. From the last lecture, the points are (0.5, 0), (10.5, 3), (20.5, 10), (30.5, 22), (40.5, 33) and (50.5, 40).

Question. Find Q₁. The top quarter of the class will receive a merit certificate. Estimate the lowest mark that earns one.

Q₁. Q₁ is read at 40 ÷ 4 = 10. But 10 is a plotted point: exactly 10 students scored below 20.5. So Q₁ = 20.5 exactly, with no reading needed. The lowest quarter scored 20 marks or less.

The merit mark. The top quarter starts at Q₃, read at 3 × 40 ÷ 4 = 30. The count 30 lies between (30.5, 22) and (40.5, 33). The curve gives Q₃ ≈ 37.4, and straight lines give 30.5 + × 10 ≈ 37.8.

Answer. Marks are whole numbers, so the cut falls between 37 and 38. A mark of 38 or more earns a merit, which is about 10 students.

Check. A quarter of 40 is 10 students. The curve says about 40 − 30 = 10 students are above 37.5. ✓

Worked Example 4 — The middle 80%

Question. A clothing company makes school uniforms in sizes for heights. It wants to cover the middle 80% of the 80 students with its standard sizes, and make special sizes for the rest. Between which heights should the standard sizes run?

Think first. The middle 80% leaves out the shortest 10% and the tallest 10%. So we need the 10th and the 90th percentiles.

Positions. 10% of 80 = 8. 90% of 80 = 72.

Read. At 8, the curve gives about 156.7 cm. At 72, it gives about 173.4 cm.

Answer. Standard sizes from about 157 cm to about 173 cm cover about 64 of the 80 students.

Check. 72 − 8 = 64, and 64 ÷ 80 = 80%. ✓ The interval is wider than the IQR (8.6 cm), as it must be.

Trap 1 — Starting on the wrong axis

For the median, quartiles and percentiles, you know a count and want a value. So start on the cumulative frequency axis, go across to the curve, then down. Starting at "40" on the measurement axis answers a different question.

Trap 2 — Taking the middle of the axis, or of the middle class

The median is not halfway along the measurement axis, and it is not the midpoint of the class it falls in. For the test scores, the axis middle is 50 and the class midpoint is 55, but the median is about 53.8. Only the curve knows where the middle student is.

Trap 3 — Rounding the count before you read

For 50 values, Q₁ is read at 12.5, not at 12 or 13. A count on the curve does not have to be a whole number. Rounding it first moves the answer for no reason.

Try it yourself

Work each one on paper first. Open a hint only when you are stuck.

  1. The masses of 50 apples give the points (100, 0), (120, 4), (140, 13), (160, 30), (180, 43) and (200, 50), with masses in grams. Estimate the median, the quartiles and the IQR. Straight lines between the points are fine.

    Hint 1

    The counts to read at are 50 ÷ 4, 50 ÷ 2 and 3 × 50 ÷ 4.

    Hint 2

    The median count, 25, lies between (140, 13) and (160, 30). It is 12 of the way through a rise of 17.

    Full answer

    Counts: 12.5, 25 and 37.5.

    Q₁: 12.5 is between (120, 4) and (140, 13). Straight lines: g.

    Median: g.

    Q₃: 37.5 is between (160, 30) and (180, 43): g.

    IQR ≈ 171.5 − 138.9 = 32.6 g. A smooth curve gives about 139.1, 154.1 and 170.4 g, so IQR ≈ 31.3 g. Either is a fair estimate.

    Check: each answer lies between the two plotted points around it. ✓

  2. For the coffee shop in Worked Example 1, the manager wants a sign: "90% of customers are served within ___ minutes." Fill in the number. Then estimate the time within which 60% of customers are served.

    Hint 1

    "90% are served within t minutes" means t is the 90th percentile. Find 90% of 60.

    Hint 2

    90% of 60 is 54. Is 54 one of the plotted counts?

    Full answer

    90% of 60 is 54, and the point (8, 54) is a plotted point. So exactly 54 customers waited less than 8 minutes. The sign says 8 minutes, and it is exact, not an estimate.

    60% of 60 is 36. It lies between (4, 23) and (6, 42). Straight lines give minutes, and the curve gives about 5.3 minutes. So about 60% are served within about 5.3 minutes.

    Check: 5.3 is between the median (4.7) and Q₃ (6.4), as 60% is between 50% and 75%. ✓

  3. A cumulative frequency curve for the finishing times of 200 runners gives Q₁ = 52 minutes, median = 58 minutes and Q₃ = 75 minutes. (a) How many runners finished between 52 and 75 minutes? (b) Which is more crowded, the second quarter of runners or the third quarter? (c) Where is the curve steeper?

    Hint 1

    Each quarter of 200 runners has 50 runners in it.

    Hint 2

    Compare the widths: the second quarter runs from 52 to 58, and the third quarter from 58 to 75.

    Full answer

    (a) Between Q₁ and Q₃ lies the middle half: 100 runners. The IQR is 75 − 52 = 23 minutes.

    (b) The second quarter fits 50 runners into 6 minutes. The third quarter spreads 50 runners over 17 minutes. So the second quarter is far more crowded.

    (c) The curve is steeper between 52 and 58 minutes, because it climbs 50 runners over a shorter distance.

    Check: this shape is common in races. Many runners finish close together just after the fastest group, and the slower runners spread out behind them.

  4. Some textbooks give a formula for the median of grouped data: median = . Here is the lower boundary of the class containing the median. is the cumulative frequency up to . is that class's frequency, and is its width. Explain where this formula comes from, using the straight-line join. Then use the same idea to find Q₃ for the coffee shop.

    Hint 1

    Over the median class, the straight line climbs from to while the value goes from to .

    Hint 2

    How far up that climb is ? As a fraction, it is . Go the same fraction of the way across the class.

    Full answer

    Across the median class, the straight line rises by students over a width . The count is students above the start of the class. That is the fraction of the class's climb. On a straight line, the same fraction of the climb happens over the same fraction of the width. So the median is that fraction of past . This is exactly the formula. It is the straight-line join, written as a calculation, so it assumes the values in the class are spread evenly.

    Coffee shop median: minutes, matching the straight-line reading.

    Q₃: replace by . The class 6–8 contains it, with and . So Q₃ = minutes.

    Check: the smooth curve gave about 6.4 minutes. The formula gives the straight-line value, 6.5. ✓

The bigger idea

The last lecture said that Francis Galton drew his curve in order to read it backwards. In his 1883 book Inquiries into Human Faculty, he recommended exactly the readings of this lecture: the middle, giving the median; the outside quarters, giving the quartiles; and the tenths, giving the deciles. He liked them because they are quick to find and are not pulled by a few extreme values. Galton was not the first to use the middle value. The French mathematician Laplace had used it earlier for errors in measurements.

Today, percentiles are everywhere that a group must be described fairly. Children's growth charts are drawn as percentile curves. Reports on wages and house prices give the median, not the mean, because a few very large values would pull the mean up. In the next lecture, five of these numbers, the smallest value, Q₁, the median, Q₃ and the largest value, become one simple picture: the box plot.

Key concepts in this lesson