Maths · Ch 13 · Topic 5 of 6Median
Topic 5 of 6

Median of grouped data

About 60 minutes · 3 things to learn
By the end you can…
  • Make cumulative frequency tables of the less-than and more-than type, and change a cumulative table back into frequencies.
  • Find the median class and the median of grouped data by the formula, including inclusive classes and tables given as less-than or more-than type.
  • Find missing frequencies when the median and the total frequency are given.

A mobile company says that half its customers use less than about 14 GB of data a month. That "half below, half above" number is the median. In a list you find it by counting to the middle. In a grouped table you count to the middle class with running totals — and then a formula tells you how far into that class to go.

  1. Cumulative frequency

The cumulative frequency (cf) of a class is the number of observations up to the end of that class — the running total of the frequencies.

Type Each row says How to make it
less-than "less than 10: 5", "less than 15: 13" … (upper limits) add the frequencies from the top
more-than "10 or more: 45", "15 or more: 37" … (lower limits) start from the total and take away the frequencies from the top

Going back to frequencies: in a less-than table, frequency of a class = its cf − the cf of the class before. In a more-than table, frequency of a class = the "or more" number at its lower limit − the "or more" number at its upper limit. The last class of a more-than table keeps its own number.

  1. The median class

Let n=Σfin = \Sigma f_i. Work out n2\dfrac{n}{2}. The median class is the first class whose cumulative frequency is greater than n2\dfrac{n}{2} (NCERT: "greater than and nearest to"). Compare n2\dfrac{n}{2} with the cf column — never with the f column.

  1. The formula

Median=l+(n2−cff)×h\text{Median} = l + \left(\frac{\frac{n}{2} - cf}{f}\right) \times h
Letter Meaning
l lower limit of the median class
n number of observations, Σfi\Sigma f_i
cf cumulative frequency of the class before the median class
f frequency of the median class (not its cf)
h class size (classes of equal size, and touching)

What it says. Before the median class there are cf observations. We need n2−cf\dfrac{n}{2} - cf more of them. The median class holds f observations spread evenly across its width h, so we walk n2−cff\dfrac{\frac{n}{2} - cf}{f} of the way across it.

For grouped data we use n2\dfrac{n}{2} — not n+12\dfrac{n + 1}{2} — whether n is odd or even.

  1. A check from the other end

Count down from the top instead: if m observations lie above the median class, then

Median=(l+h)−(n2−mf)×h.\text{Median} = (l + h) - \left(\frac{\frac{n}{2} - m}{f}\right) \times h.

Both ways must give the same number. This uses different numbers (m and the upper limit), so it catches a slip in the first route.

  1. Inclusive classes

As for the mode, first make the classes continuous: for 11 – 15, l=10.5l = 10.5 and h=5h = 5.

Visuals

Cumulative frequency columns A table of the classes 0 – 5 to 25 – 30 with frequencies 5, 8, 16, 11, 4, 6. The less-than column is a running total that grows down the page: 5, 13, 29, 40, 44, 50, each step adding the next frequency. The or-more column shrinks: 50, 45, 37, 21, 10, 6, each step taking away a frequency; less than and or more at the same value add to 50 (at 15: 29 + 21). A dashed line n ÷ 2 = 25 crosses between 13 and 29, so the row 10 – 15 is the median class: the first cf greater than n ÷ 2. n ÷ 2 = 50 ÷ 2 = 25. Cumulative frequency columns running total Class f less than or more 0 – 5 5 5 50 5 – 10 8 13 45 10 – 15 16 29 37 15 – 20 11 40 21 20 – 25 4 44 10 25 – 30 6 50 6 +8 −5 +16 −8 +11 −16 +4 −11 +6 −4 n ÷ 2 = 25 median class first c f greater than n ÷ 2 at 15:  29 + 21 = 50 n 2 = 50 2 = 25
Cumulative frequency columnsBuild both cumulative columns from one table and find the median class.Draw in exam
Walking into the median class A strip for the median class 10 – 15, cut into f = 16 equal steps (one step for each observation in the class); 13 observations come before the class (cf = 13). An arrow walks n ÷ 2 − cf = 25 − 13 = 12 steps and stops at the 25th observation. Under the strip, an axis from l = 10 to l + h = 15 with the median 13.75 marked where 12 of the 16 steps end; a bracket from 10 to the median is 12/16 × 5 = 3.75. Median = l + (n/2 − cf)/f × h = 10 + 12/16 × 5 = 13.75. Walking into the median class c f = 13 before the class f = 16 equal steps walk n ÷ 2 − c f = 12 steps the 25th observation l = 10 l + h = 15 median = 13.75 12 16 × 5 = 3.75 Median = l + n 2 − c f f × h 10 + 12 16 × 5 = 13.75
Walking into the median classSee why the median formula works: walk the missing number of observations into the median class.Draw in exam

Try it yourself — the grouped-data explorer. Watch the median class move when you make one frequency larger.

Grouped-data explorer Grouped-data explorer (static view): a frequency table with the columns Class, f, x, f × x and cf and a Total row; the modal class and the median class are tinted and named; below it the mean (Σfx ÷ Σf), the median class and median, and the modal class and mode. With JavaScript the table can be edited: the first lower limit, the class size, the number of classes and each frequency. Grouped-data explorer Topic 2, Worked example 1 Class f x f × x c f 0 – 20 4 10 40 4 20 – 40 9 30 270 13 40 – 60 15 50 750 28 60 – 80 8 70 560 36 80 – 100 4 90 360 40 Total 40 1980 modal median Mean Σ f x ÷ Σ f = 1980 ÷ 40 = 49.5 Median class 40 – 60, median ≈ 49.33 Mode class 40 – 60, mode ≈ 49.23 Grouped-data explorer Topic 3, Worked example 1 Class f x f × x c f 3000 – 3500 6 3250 19500 6 3500 – 4000 11 3750 41250 17 4000 – 4500 17 4250 72250 34 4500 – 5000 10 4750 47500 44 5000 – 5500 6 5250 31500 50 Total 50 212000 modal median Mean Σ f x ÷ Σ f = 212000 ÷ 50 = 4240 Median class 4000 – 4500, median ≈ 4235.29 Mode class 4000 – 4500, mode ≈ 4230.77 Grouped-data explorer Topic 4, Worked example 1 Class f x f × x c f 0 – 5 6 2.5 15 6 5 – 10 11 7.5 82.5 17 10 – 15 18 12.5 225 35 15 – 20 13 17.5 227.5 48 20 – 25 7 22.5 157.5 55 25 – 30 5 27.5 137.5 60 Total 60 845 modal median Mean Σ f x ÷ Σ f = 845 ÷ 60 ≈ 14.08 Median class 10 – 15, median ≈ 13.61 Mode class 10 – 15, mode ≈ 12.92 Grouped-data explorer Topic 5, Worked example 1 Class f x f × x c f 0 – 5 5 2.5 12.5 5 5 – 10 8 7.5 60 13 10 – 15 16 12.5 200 29 15 – 20 11 17.5 192.5 40 20 – 25 4 22.5 90 44 25 – 30 6 27.5 165 50 Total 50 720 modal median Mean Σ f x ÷ Σ f = 720 ÷ 50 = 14.4 Median class 10 – 15, median = 13.75 Mode class 10 – 15, mode ≈ 13.08
Grouped-data explorerSee how each column comes from the one before, and that every method gives the same mean.

Worked examples

Worked example 1

Cumulative frequencies and the median

Question. The mobile data used in a month by 50 customers is (in GB): 0 – 5: 5; 5 – 10: 8; 10 – 15: 16; 15 – 20: 11; 20 – 25: 4; 25 – 30: 6. (a) Make the less-than cumulative frequency table. (b) Find the median class. (c) Find the median.

Given: six classes of size 5; n=50n = 50. Asked: the cf table, the median class and the median.

Concept used: cf = running total; median class = first cf greater than n2\dfrac{n}{2}; Median=l+(n2−cff)×h\text{Median} = l + \left(\dfrac{\frac{n}{2} - cf}{f}\right) \times h. Why it applies: the classes are equal and touching.

  1. 1

    (a) Running totals: 5, 13, 29, 40, 44, 50.

    Data (GB) fif_i cfcf
    0 – 5 5 5
    5 – 10 8 13
    10 – 15 16 29 ← median
    15 – 20 11 40
    20 – 25 4 44
    25 – 30 6 50
  2. 2

    (b) n2=25\dfrac{n}{2} = 25. The first cf greater than 25 is 29, so the median class is 10 – 15.

  3. 3

    (c) l=10l = 10, n2=25\dfrac{n}{2} = 25, cf=13cf = 13 (the class before), f=16f = 16, h=5h = 5.

  4. 4

    Median=10+(25−1316)×5=10+1216×5=10+3.75=13.75\text{Median} = 10 + \left(\dfrac{25 - 13}{16}\right) \times 5 = 10 + \dfrac{12}{16} \times 5 = 10 + 3.75 = 13.75 GB.

  5. Check: from the top, m=11+4+6=21m = 11 + 4 + 6 = 21 customers lie above 15 GB: 15−(25−2116)×5=15−1.25=13.7515 - \left(\dfrac{25 - 21}{16}\right) \times 5 = 15 - 1.25 = 13.75 ✔.

  6. Answer (a) cf: 5, 13, 29, 40, 44, 50 (b) 10 – 15 (c) Median = 13.75 GB — about half the customers use less than 13.75 GB.

    Common trap: Using cf=29cf = 29 (the cf of the median class itself): 10+25−2916×5=8.7510 + \dfrac{25 - 29}{16} \times 5 = 8.75 — below the median class, which cannot be right.

Worked example 2

From a less-than table

Question. The heights of 60 plants in a nursery are given as: less than 10 cm: 3; less than 20 cm: 10; less than 30 cm: 24; less than 40 cm: 41; less than 50 cm: 52; less than 60 cm: 60. Find the median height.

Given: a less-than cumulative table; n=60n = 60. Asked: the median.

Concept used: frequency = cf − cf of the class before; then the median formula. Why it applies: the formula needs the frequency f of the median class.

  1. 1

    The upper limits are 10, 20, …, 60, so the classes are 0 – 10, 10 – 20, …, 50 – 60.

  2. 2

    Frequencies: 3; 10−3=710 - 3 = 7; 24−10=1424 - 10 = 14; 41−24=1741 - 24 = 17; 52−41=1152 - 41 = 11; 60−52=860 - 52 = 8.

    Height (cm) fif_i cfcf
    0 – 10 3 3
    10 – 20 7 10
    20 – 30 14 24
    30 – 40 17 41 ← median
    40 – 50 11 52
    50 – 60 8 60
  3. 3

    n2=30\dfrac{n}{2} = 30; the first cf greater than 30 is 41 → median class 30 – 40.

  4. 4

    l=30l = 30, cf=24cf = 24, f=17f = 17, h=10h = 10: Median=30+(30−2417)×10=30+6017≈33.53\text{Median} = 30 + \left(\dfrac{30 - 24}{17}\right) \times 10 = 30 + \dfrac{60}{17} \approx 33.53 cm.

  5. Check: from the top, m=11+8=19m = 11 + 8 = 19 plants are 40 cm or taller: 40−(30−1917)×10=40−11017≈33.5340 - \left(\dfrac{30 - 19}{17}\right) \times 10 = 40 - \dfrac{110}{17} \approx 33.53 ✔.

  6. Answer The median height is about 33.53 cm (exactly 30+601730 + \dfrac{60}{17} cm).

    Common trap: Using 41 (a cumulative frequency) as f: 30+641×10≈31.4630 + \dfrac{6}{41} \times 10 \approx 31.46 cm.

Worked example 3

From a more-than table

Question. The marks of 80 students are given as: 0 or more: 80; 10 or more: 74; 20 or more: 62; 30 or more: 45; 40 or more: 22; 50 or more: 9 (the highest mark is below 60). Find the median mark.

Given: a more-than table; n=80n = 80. Asked: the median.

Concept used: frequency of a class = (number at its lower limit) − (number at its upper limit); then the median formula. Why it applies: "10 or more: 74" and "20 or more: 62" mean that 74−62=1274 - 62 = 12 students scored from 10 up to (not including) 20.

  1. 1

    Frequencies: 0 – 10: 80−74=680 - 74 = 6; 10 – 20: 74−62=1274 - 62 = 12; 20 – 30: 62−45=1762 - 45 = 17; 30 – 40: 45−22=2345 - 22 = 23; 40 – 50: 22−9=1322 - 9 = 13; 50 – 60: 9.

    Marks fif_i cfcf
    0 – 10 6 6
    10 – 20 12 18
    20 – 30 17 35
    30 – 40 23 58 ← median
    40 – 50 13 71
    50 – 60 9 80
  2. 2

    n2=40\dfrac{n}{2} = 40; the first cf greater than 40 is 58 → median class 30 – 40.

  3. 3

    l=30l = 30, cf=35cf = 35, f=23f = 23, h=10h = 10: Median=30+(40−3523)×10=30+5023≈32.17\text{Median} = 30 + \left(\dfrac{40 - 35}{23}\right) \times 10 = 30 + \dfrac{50}{23} \approx 32.17.

  4. Check: the more-than table itself gives the count from the top: 22 students scored 40 or more, so m=22m = 22 and 40−(40−2223)×10=40−18023≈32.1740 - \left(\dfrac{40 - 22}{23}\right) \times 10 = 40 - \dfrac{180}{23} \approx 32.17 ✔.

  5. Answer The median mark is about 32.17 (exactly 30+502330 + \dfrac{50}{23}).

    Common trap: Treating the more-than numbers as frequencies (80, 74, 62, …) — they are running totals counted from the top.

Worked example 4

Inclusive classes

Question. The weights of 50 parcels at a post office were (in kg): 1 – 5: 6; 6 – 10: 13; 11 – 15: 18; 16 – 20: 9; 21 – 25: 4. Find the median weight.

Given: inclusive classes with a gap of 1. Asked: the median.

Concept used: make the classes continuous, then use the median formula. Why it applies: l and h must come from touching classes.

  1. 1

    Continuous classes: 0.5 – 5.5, 5.5 – 10.5, 10.5 – 15.5, 15.5 – 20.5, 20.5 – 25.5; h=5h = 5.

  2. 2

    cf: 6, 19, 37, 46, 50. n2=25\dfrac{n}{2} = 25; the first cf greater than 25 is 37 → median class 11 – 15, that is, 10.5 – 15.5.

  3. 3

    l=10.5l = 10.5, cf=19cf = 19, f=18f = 18, h=5h = 5: Median=10.5+(25−1918)×5=10.5+53≈12.17\text{Median} = 10.5 + \left(\dfrac{25 - 19}{18}\right) \times 5 = 10.5 + \dfrac{5}{3} \approx 12.17 kg.

  4. Check: from the top, m=9+4=13m = 9 + 4 = 13: 15.5−(25−1318)×5=15.5−103≈12.1715.5 - \left(\dfrac{25 - 13}{18}\right) \times 5 = 15.5 - \dfrac{10}{3} \approx 12.17 ✔.

  5. Answer The median weight is about 12.17 kg (exactly 10.5+5310.5 + \dfrac{5}{3} kg).

    Common trap: Using l=11l = 11: 11+53≈12.6711 + \dfrac{5}{3} \approx 12.67 kg — half a kilogram too much.

Worked example 5

Missing frequencies from the median

Question. The median of the distribution 0 – 10: 4; 10 – 20: a; 20 – 30: 15; 30 – 40: b; 40 – 50: 7; 50 – 60: 2 is 28, and the total frequency is 50. Find a and b.

Given: n=50n = 50; median 28; unknowns a and b. Asked: a and b.

Concept used: the total gives a+ba + b; the median formula gives a. Why it applies: 28 lies in 20 – 30, so that is the median class, and its cf before is 4+a4 + a.

  1. 1

    Total: 4+a+15+b+7+2=504 + a + 15 + b + 7 + 2 = 50, so a+b=22a + b = 22.

  2. 2

    Median class 20 – 30: l=20l = 20, n2=25\dfrac{n}{2} = 25, cf=4+acf = 4 + a, f=15f = 15, h=10h = 10.

  3. 3

    28=20+(25−4−a15)×1028 = 20 + \left(\dfrac{25 - 4 - a}{15}\right) \times 10, so 8=2(21−a)38 = \dfrac{2(21 - a)}{3}.

  4. 4

    21−a=1221 - a = 12, so a=9a = 9; then b=22−9=13b = 22 - 9 = 13.

  5. Check: with a=9a = 9, b=13b = 13: cf = 4, 13, 28, 41, 48, 50; the first cf greater than 25 is 28, so 20 – 30 is indeed the median class ✔; median =20+25−1315×10=28= 20 + \dfrac{25 - 13}{15} \times 10 = 28 ✔.

  6. Answer a=9a = 9, b=13b = 13

    Common trap: Taking cf=4cf = 4 (forgetting a) — the class 10 – 20 also lies before the median class.

5 examples · they get harder as you go

Quick check

Answer without scrolling up
Quick check · 1 of 4MCQ1 mark

For the distribution 0 – 10: 8; 10 – 20: 10; 20 – 30: 10; 30 – 40: 16; 40 – 50: 6, the median class is:

Quick check · 2 of 4Short answer2 marks

Find the median of the distribution in Quick check 1.

Quick check · 3 of 4MCQ1 mark

A table gives: less than 10: 4; less than 20: 11; less than 30: 25; less than 40: 33; less than 50: 40. The frequency of the class 20 – 30 is:

Quick check · 4 of 4Short answer2 marks

A more-than table gives: 0 or more: 50; 5 or more: 46; 10 or more: 35; 15 or more: 19; 20 or more: 6 (all values are below 25). Find the frequency of each class and the median class.

Key points

  • cf = running total; less-than tables use upper limits, more-than tables use lower limits; subtract neighbouring numbers to get back the frequencies.
  • Median class = the first class whose cf is greater than n2\dfrac{n}{2}.
  • Median=l+(n2−cff)×h\text{Median} = l + \left(\dfrac{\frac{n}{2} - cf}{f}\right) \times h, with cf of the class before and f of the median class.
  • Check by counting down from the top: (l+h)−(n2−mf)×h(l + h) - \left(\dfrac{\frac{n}{2} - m}{f}\right) \times h.
  • Inclusive classes: continuous limits first. Missing frequencies: the total gives one equation, the median gives the other.
My notesComing soon