Chapter 13 ยท Statistics

13.3 Median of Grouped Data

The median is the middle value: half the observations lie below it and half above. For grouped data, build a running total of the frequencies, find the class where the halfway point falls, and then place the median inside that class with a formula. A short relation then ties the mean, median and mode together.

Suppose five friends earn โ‚น 20,000, โ‚น 22,000, โ‚น 25,000, โ‚น 27,000 and โ‚น 5,00,000 a month. The mean income is โ‚น 1,18,800, a number that describes nobody in the group, because one very large value drags the mean upward. The median income, โ‚น 25,000, is the middle one when the incomes are arranged in order, and it describes a typical person much better. This is why reports on income, house prices and marks often quote the median.

For a list the median is easy. For grouped data we cannot see the individual values, but we can still find the class that contains the middle observation, using a cumulative frequency column, and then estimate the median inside the class. At the end of the section you will meet a surprising relation among the three averages, mean, median and mode, which gives a quick check on your calculations.

The median of a list, and cumulative frequency

๐Ÿ“˜ Definition 13.5 โ€” Median
Arrange $n$ observations in increasing order. The median is the middle value: if $n$ is odd it is the $\dfrac{n+1}{2}$th value; if $n$ is even it is the mean of the $\dfrac n2$th and the $\left(\dfrac n2+1\right)$th values. Half of the observations are at most the median, and half are at least the median.
โœ๏ธ Example 1 โ€” Median of a list
(a) Find the median of $12,\ 5,\ 9,\ 20,\ 7$. (b) Find the median after the value $22$ is added.
(a) Order $5,\ 7,\ 9,\ 12,\ 20$. There are $n=5$ values, so the median is the $\dfrac{5+1}{2}=3$rd value: 9.
(b) Order $5,\ 7,\ 9,\ 12,\ 20,\ 22$. Now $n=6$, so the median is the mean of the $3$rd and $4$th values: $\dfrac{9+12}{2}=$ 10.5.
๐Ÿ“˜ Definition 13.6 โ€” Cumulative frequency
The cumulative frequency of a class is the sum of the frequencies of that class and of all the classes before it. It tells you how many observations are at most the upper limit of the class. The cumulative frequency of the last class is the total $n=\sum f_i$.
๐Ÿ“˜ Definition 13.7 โ€” Median class
For grouped data with $n$ observations, the median class is the first class whose cumulative frequency is at least $\dfrac n2$. The median of the grouped data lies in this class.

For example, the commuter data of Section 13.2 have frequencies $4,12,20,14,6$ in the classes $0$โ€“$10,\dots,40$โ€“$50$. The cumulative frequencies are $4,\ 16,\ 36,\ 50,\ 56$. Here $n=56$ and $\dfrac n2=28$. The first class with cumulative frequency at least $28$ is $20$โ€“$30$ (its cumulative frequency is $36$), so $20$โ€“$30$ is the median class.

The median formula

Once we know the median class, we need to find how far into it the median lies. The class $20$โ€“$30$ above contains $20$ observations, and $16$ observations lie before it. We need $28-16=12$ more to reach the middle. If the $20$ observations of the class are spread evenly across its width $10$, then $12$ of them take up $\dfrac{12}{20}$ of the width, and the median is $20+\dfrac{12}{20}\times10=26$. This is the idea of the formula.

๐Ÿ“ Theorem 13.5 โ€” Median of grouped data
Let the classes be continuous with equal class size $h$, and $n=\sum f_i$. If the median class has lower limit $l$ and frequency $f$, and $cf$ is the cumulative frequency of the class just before the median class, then $$\text{Median}=l+\left(\frac{\frac n2-cf}{f}\right)h.$$

Why it works. There are $cf$ observations below $l$. To reach the middle observation we must go through $\frac n2-cf$ more observations inside the median class. The class holds $f$ observations in a width $h$; if they are evenly spread, each takes $\dfrac hf$ of the width, so the distance we move from $l$ is $\left(\frac n2-cf\right)\dfrac hf$. $\blacksquare$

๐Ÿงญ Problem-solving strategy โ€” median of grouped data
  1. Make the classes continuous if there are gaps (add and subtract $0.5$ as in Section 13.2).
  2. Add a cumulative frequency column and find $n$, the last entry. Compute $\dfrac n2$.
  3. Pick the median class: the first class whose cumulative frequency reaches $\dfrac n2$ or more. Read $l$, $h$, $f$.
  4. Take $cf$ from the row above the median class (the class before it). For the first class, $cf=0$.
  5. Substitute and check that the answer lies between $l$ and $l+h$.
โš ๏ธ Common mistakes

1. Using the wrong $cf$. $cf$ belongs to the class before the median class, not to the median class itself. If you use the median class's own cumulative frequency, $\frac n2-cf$ becomes negative and the answer falls outside the class.

2. Using $f$ from the wrong row. $f$ is the ordinary frequency of the median class, not a cumulative one.

3. Forgetting to halve $n$, or searching for the class whose frequency (not cumulative frequency) reaches $\frac n2$.

4. Forgetting that the classes must be continuous and that the data must be in increasing order.

โœ๏ธ Example 2 โ€” Median from a table
Find the median of the travel times of $56$ commuters: $0$โ€“$10$: $4$; $10$โ€“$20$: $12$; $20$โ€“$30$: $20$; $30$โ€“$40$: $14$; $40$โ€“$50$: $6$.
Cumulative $4,\ 16,\ 36,\ 50,\ 56$. So $n=56$ and $\dfrac n2=28$.
Median class The first cumulative frequency $\ge28$ is $36$, in the class $20$โ€“$30$. Hence $l=20$, $h=10$, $f=20$, $cf=16$.
Substitute $\text{Median}=20+\dfrac{28-16}{20}\times10=20+6=26$ minutes.
Check $26$ lies between $20$ and $30$ โœ“.
โœ๏ธ Example 3 โ€” Test marks
Marks of $50$ students: $0$โ€“$10$: $2$; $10$โ€“$20$: $6$; $20$โ€“$30$: $12$; $30$โ€“$40$: $16$; $40$โ€“$50$: $10$; $50$โ€“$60$: $4$. Find the median mark.
Cumulative $2,\ 8,\ 20,\ 36,\ 46,\ 50$; $n=50$, $\dfrac n2=25$.
Median class The first cumulative frequency $\ge25$ is $36$: class $30$โ€“$40$, with $l=30$, $h=10$, $f=16$ and $cf=20$ (the entry above).
Substitute $\text{Median}=30+\dfrac{25-20}{16}\times10=30+3.125=33.13$ (to $2$ d.p.).
Interactive 1 โ€” Where Does the Halfway Point Fall?

The long bar is divided into classes, each as wide as its frequency, so the whole bar stands for the $n$ observations. The green marker is at $\frac n2$, the halfway point. The class under it is the median class. Below, that class is enlarged: the median sits where the remaining $\frac n2-cf$ observations end. Change the sliders (or press Play) and watch the marker, the median class and the median move.

$n$ and $\frac n2$โ€”
median classโ€”
$cf$ and $f$โ€”
medianโ€”
โœ๏ธ Example 4 โ€” Classes that do not touch
The ages of $40$ members of a club are: $20$โ€“$29$: $3$; $30$โ€“$39$: $8$; $40$โ€“$49$: $14$; $50$โ€“$59$: $10$; $60$โ€“$69$: $5$. Find the median age.
Continuous Adjust by $0.5$: the classes become $19.5$โ€“$29.5$, $29.5$โ€“$39.5$, $39.5$โ€“$49.5$, $49.5$โ€“$59.5$, $59.5$โ€“$69.5$, with $h=10$.
Cumulative $3,\ 11,\ 25,\ 35,\ 40$; $n=40$, $\dfrac n2=20$. Median class: $39.5$โ€“$49.5$ ($25\ge20$), with $l=39.5$, $f=14$, $cf=11$.
Substitute $\text{Median}=39.5+\dfrac{20-11}{14}\times10=39.5+6.43=45.93$ years.
โœ๏ธ Example 5 โ€” Two missing frequencies
The median of $50$ observations is $26$: $0$โ€“$10$: $4$; $10$โ€“$20$: $6$; $20$โ€“$30$: $x$; $30$โ€“$40$: $12$; $40$โ€“$50$: $y$. Find $x$ and $y$.
Total $4+6+x+12+y=50$, so $x+y=28$.
Median class The median $26$ lies in $20$โ€“$30$: $l=20$, $h=10$, $f=x$, $cf=4+6=10$, and $\dfrac n2=25$.
Equation $26=20+\dfrac{25-10}{x}\times10$, so $\dfrac{150}{x}=6$ and $x=25$. Then $y=28-25=3$.
Check Cumulative frequencies $4,10,35,47,50$; the median class is $20$โ€“$30$ โœ“ and $20+\frac{15}{25}\times10=26$ โœ“.

Mean, median and mode together

You now have three "averages" for the same data. For a symmetric histogram they coincide. If the histogram has a long tail to the right (a few very large values), the mean is dragged to the right, the mode stays at the peak, and the median lies in between. For distributions that are only moderately skewed, the three are tied by a relation found by observation.

๐Ÿ“ Theorem 13.6 โ€” Empirical relation
For a moderately skewed distribution (one that is not far from symmetric), approximately $$3\times\text{Median}=\text{Mode}+2\times\text{Mean}.$$

This is an empirical (observed) relation, not an exact theorem: it comes from experience with many data sets, and it can be off by a few per cent. Its use is as a check, or to estimate the third average when two are known: $$\text{Mode}=3\,\text{Median}-2\,\text{Mean}.$$

โœ๏ธ Example 6 โ€” Checking the relation
For the commuter data (Sections 13.2 and this section), use the mean, mode and median to test $3\,\text{Median}=\text{Mode}+2\,\text{Mean}$.
Mean $x_i=5,15,25,35,45$, $\sum f_ix_i=20+180+500+490+270=1460$, $\sum f_i=56$, so $\bar x=\dfrac{1460}{56}=26.07$.
Mode and median Mode $=25.71$ (Example 2 of Section 13.2) and median $=26$ (Example 2 above).
Compare $3\times\text{Median}=78$ and $\text{Mode}+2\times\text{Mean}=25.71+52.14=77.85$. The two sides differ by only $0.15$ โœ“.
Use If only the mean $26.07$ and median $26$ had been known, the mode could be estimated as $3(26)-2(26.07)=25.86$, close to the true $25.71$.
Interactive 2 โ€” Mean, Median and Mode on a Skewed Histogram

Drag the slider to change the shape of the distribution (or press Play): from a long tail on the right, through a symmetric histogram, to a long tail on the left. The mode stays at the peak, the mean is pulled towards the tail, and the median lies between them. Compare $3\times$ median with mode $+\,2\times$ mean in the readouts.

mild right tail
meanโ€”
medianโ€”
modeโ€”
3 ร— median vs mode + 2 ร— meanโ€”

Exercises

I
Median basics.
  • 1 Find the median of $7,3,9,5,11$.
  • 2 Find the median of $12,15,11,18,20,14$.
  • 3 Frequencies $3,5,8,4$ in four consecutive classes: write the cumulative frequencies.
  • 4 For $n=60$ the cumulative frequencies of the classes $0$โ€“$10,10$โ€“$20,20$โ€“$30,30$โ€“$40$ are $8,22,41,60$. Find the median class.
  • 5 A median class is $20$โ€“$30$ with $\frac n2=25$, $cf=16$, $f=12$. Find the median.
  • 6 A mean is $54$ and the mode is $60$ for a moderately skewed distribution. Estimate the median.
1 Ordered: $3,5,7,9,11$; the middle value is $7$.
2 Ordered: $11,12,14,15,18,20$; median $=\dfrac{14+15}{2}=14.5$.
3 $3,\ 8,\ 16,\ 20$.
4 $\frac n2=30$; the first cumulative frequency $\ge30$ is $41$: class $20$โ€“$30$.
5 $20+\dfrac{25-16}{12}\times10=20+7.5=27.5$.
6 $3\,\text{Median}=60+2(54)=168$, so the median is $56$.
II
Median of grouped data. Find the median of each distribution.
  • 1 $0$โ€“$10$: $3$; $10$โ€“$20$: $7$; $20$โ€“$30$: $12$; $30$โ€“$40$: $5$; $40$โ€“$50$: $3$.
  • 2 $10$โ€“$20$: $4$; $20$โ€“$30$: $6$; $30$โ€“$40$: $10$; $40$โ€“$50$: $8$; $50$โ€“$60$: $2$.
  • 3 Heights (cm): $140$โ€“$150$: $5$; $150$โ€“$160$: $12$; $160$โ€“$170$: $10$; $170$โ€“$180$: $3$.
  • 4 Pocket money (โ‚น): $0$โ€“$50$: $8$; $50$โ€“$100$: $14$; $100$โ€“$150$: $20$; $150$โ€“$200$: $12$; $200$โ€“$250$: $6$.
  • 5 Pages read: $1$โ€“$10$: $6$; $11$โ€“$20$: $9$; $21$โ€“$30$: $10$; $31$โ€“$40$: $5$.
  • 6 Rainfall (mm): $0$โ€“$4$: $18$; $4$โ€“$8$: $10$; $8$โ€“$12$: $7$; $12$โ€“$16$: $5$.
1 $n=30$, cumulative $3,10,22,27,30$; $\frac n2=15$: class $20$โ€“$30$, $cf=10$, $f=12$. Median $=20+\dfrac{5}{12}\times10=24.17$.
2 $n=30$, cumulative $4,10,20,28,30$; $\frac n2=15$: class $30$โ€“$40$, $cf=10$, $f=10$. Median $=30+\dfrac{5}{10}\times10=35$.
3 $n=30$, cumulative $5,17,27,30$; class $150$โ€“$160$, $cf=5$, $f=12$. Median $=150+\dfrac{10}{12}\times10=158.33$ cm.
4 $n=60$, cumulative $8,22,42,54,60$; $\frac n2=30$: class $100$โ€“$150$, $cf=22$, $f=20$. Median $=100+\dfrac{8}{20}\times50=$ โ‚น 120.
5 Continuous classes $0.5$โ€“$10.5$, $10.5$โ€“$20.5$, $\dots$; $n=30$, cumulative $6,15,25,30$; $\frac n2=15$ is reached in the class $10.5$โ€“$20.5$: $l=10.5$, $cf=6$, $f=9$. Median $=10.5+\dfrac{15-6}{9}\times10=20.5$ pages.
6 $n=40$, cumulative $18,28,35,40$; $\frac n2=20$: class $4$โ€“$8$, $cf=18$, $f=10$, $h=4$. Median $=4+\dfrac{2}{10}\times4=4.8$ mm.
III
Missing frequencies and applications.
  • 1 The median of $50$ observations is $36$: $10$โ€“$20$: $5$; $20$โ€“$30$: $8$; $30$โ€“$40$: $x$; $40$โ€“$50$: $12$; $50$โ€“$60$: $y$. Find $x$ and $y$.
  • 2 Ages of $80$ patients: $5$โ€“$15$: $6$; $15$โ€“$25$: $11$; $25$โ€“$35$: $21$; $35$โ€“$45$: $23$; $45$โ€“$55$: $14$; $55$โ€“$65$: $5$. Find the median age (to $2$ d.p.).
  • 3 Speeds of $55$ vehicles (km/h): $40$โ€“$50$: $6$; $50$โ€“$60$: $14$; $60$โ€“$70$: $23$; $70$โ€“$80$: $9$; $80$โ€“$90$: $3$. Find the median speed.
  • 4 Daily wages (โ‚น): $400$โ€“$500$: $6$; $500$โ€“$600$: $10$; $600$โ€“$700$: $14$; $700$โ€“$800$: $12$; $800$โ€“$900$: $8$. Find the median wage. Using the mean โ‚น 662 (Section 13.1) and the mode โ‚น 666.67 (Section 13.2), check the relation $3\,\text{Median}=\text{Mode}+2\,\text{Mean}$.
  • 5 For a moderately skewed distribution the median is $27$ and the mean is $28$. Estimate the mode.
1 $x+y=50-25=25$. Median class $30$โ€“$40$: $cf=5+8=13$, $\frac n2=25$: $36=30+\dfrac{12}{x}\times10$, so $\dfrac{120}{x}=6$, $x=20$ and $y=5$. (Check: cumulative $5,13,33,45,50$ โœ“.)
2 Cumulative $6,17,38,61,75,80$; $\frac n2=40$: class $35$โ€“$45$, $cf=38$, $f=23$. Median $=35+\dfrac{2}{23}\times10=35.87$ years.
3 Cumulative $6,20,43,52,55$; $\frac n2=27.5$: class $60$โ€“$70$, $cf=20$, $f=23$. Median $=60+\dfrac{7.5}{23}\times10=63.26$ km/h.
4 $n=50$, cumulative $6,16,30,42,50$; $\frac n2=25$: class $600$โ€“$700$, $cf=16$, $f=14$. Median $=600+\dfrac{9}{14}\times100=664.29$. Then $3\times664.29=1992.86$ and $666.67+2\times662=1990.67$: they differ by about $2.2$, so the relation holds well.
5 Mode $=3(27)-2(28)=81-56=25$.
IV
Think harder.
  • 1 Show that if $\frac n2$ equals the cumulative frequency of some class exactly, the median is the upper limit of that class.
  • 2 Five friends earn โ‚น 20,000, โ‚น 22,000, โ‚น 25,000, โ‚น 27,000 and โ‚น 5,00,000. Find the mean and the median, and say which better describes a typical friend.
  • 3 Explain why the median formula gives a value between $l$ and $l+h$ whenever $cf\lt\frac n2\le cf+f$.
1 Let the class be the one whose cumulative frequency is $\frac n2=cf+f$, where $cf$ is the cumulative frequency of the class before it. It is the first class to reach $\frac n2$, so it is the median class and $\text{Median}=l+\dfrac{(cf+f)-cf}{f}h=l+h$, its upper limit.
2 Mean $=\dfrac{20000+22000+25000+27000+500000}{5}=\dfrac{594000}{5}=$ โ‚น 1,18,800. Median $=$ โ‚น 25,000 (third of five). The median describes a typical friend; the mean is pulled up by one large income.
3 The fraction $\dfrac{\frac n2-cf}{f}$ has a numerator that is positive (since $cf\lt\frac n2$) and at most $f$ (since $\frac n2\le cf+f$). So the fraction lies in $(0,1]$ and the median is in $(l,\ l+h]$.
๐ŸŽฏ Exam corner Board ยท 1 markBoard ยท 2 marksBoard ยท 3 marksBoard ยท Case studyJEE Main

How this is examined: the median of a table is a standard 3- or 5-mark board question (cumulative frequency column, $\frac n2$, median class, formula, answer), often combined with a missing frequency, a case study or the mode. The relation $3\,\text{Median}=\text{Mode}+2\,\text{Mean}$ appears in 1โ€“2 mark items and in JEE Main as a data-interpretation shortcut.

E1. Board ยท 1 mark In the formula $\text{Median}=l+\left(\dfrac{\frac n2-cf}{f}\right)h$, the symbol $cf$ stands for  (A) the cumulative frequency of the median class  (B) the cumulative frequency of the class preceding the median class  (C) the frequency of the class preceding the median class  (D) half of the total frequency

Meaning $cf$ counts all observations that lie below the median class, which is the cumulative frequency of the class just before it.
Answer (B). Option (A) would include the observations of the median class itself; option (C) leaves out the earlier classes.

E2. Board ยท 1 mark Assertion (A): For a distribution with $n=60$, the median class is the first class whose cumulative frequency is at least $30$. Reason (R): The median is the value below which half of the observations lie.
(A) Both A and R are true and R is the correct explanation of A.  (B) Both A and R are true but R is not the correct explanation of A.  (C) A is true but R is false.  (D) A is false but R is true.

Check R is the definition of the median. A follows from it: half of $60$ is $30$, and the first class where the running total reaches $30$ is where the middle observation sits.
Answer (A).

E3. Board ยท 3 marks The daily wages (โ‚น) of $40$ workers are: $150$โ€“$200$: $4$; $200$โ€“$250$: $6$; $250$โ€“$300$: $12$; $300$โ€“$350$: $10$; $350$โ€“$400$: $5$; $400$โ€“$450$: $3$. Find the median wage.

Cumulative (1 mark) $4,\ 10,\ 22,\ 32,\ 37,\ 40$; $n=40$, $\frac n2=20$. Median class $250$โ€“$300$.
Values (1 mark) $l=250$, $h=50$, $f=12$, $cf=10$.
Answer (1 mark) $\text{Median}=250+\dfrac{20-10}{12}\times50=250+41.67=$ โ‚น 291.67.

E4. Board ยท 2 marks The total frequency of the distribution $0$โ€“$10$: $5$; $10$โ€“$20$: $x$; $20$โ€“$30$: $18$; $30$โ€“$40$: $9$; $40$โ€“$50$: $3$ is $40$. Find $x$ and the median.

Find x (1 mark) $5+x+18+9+3=40$, so $x=5$.
Median (1 mark) Cumulative $5,10,28,37,40$; $\frac n2=20$: class $20$โ€“$30$, $cf=10$, $f=18$. $\text{Median}=20+\dfrac{20-10}{18}\times10=25.56$.

E5. Board ยท Case study In a school sports day, the times (in seconds) of $50$ students in a race were: $12$โ€“$14$: $4$; $14$โ€“$16$: $10$; $16$โ€“$18$: $18$; $18$โ€“$20$: $12$; $20$โ€“$22$: $6$. (i) Write the cumulative frequencies and the median class. (2) (ii) Find the median time. (1) (iii) How many students took less than $18$ seconds? (1)

(i) (2 marks) Cumulative frequencies $4,\ 14,\ 32,\ 44,\ 50$; $\frac n2=25$, so the median class is $16$โ€“$18$.
(ii) (1 mark) $l=16$, $h=2$, $f=18$, $cf=14$: $\text{Median}=16+\dfrac{25-14}{18}\times2=16+1.22=17.22$ seconds.
(iii) (1 mark) The cumulative frequency up to $18$ is $32$, so $32$ students took less than $18$ seconds.

E6. JEE Main For a moderately skewed distribution the median is $20$ and the mean is $21$. The mode is approximately  (A) $18$  (B) $19$  (C) $20$  (D) $23$

Relation $\text{Mode}=3\,\text{Median}-2\,\text{Mean}=3(20)-2(21)=60-42=18$.
Answer (A). Option (D) comes from mixing up the roles: $3(21)-2(20)=23$.
๐Ÿ”ฌ Researchโ€“Teaching NexusMini project ยท optional, about 40 minutes

Research question. For real data from your class, how far apart are the mean, median and mode, and does the relation $3\,\text{Median}=\text{Mode}+2\,\text{Mean}$ hold?

Why it matters. Newspapers say "the median household income" rather than the mean because a few very high values distort the mean. Knowing when the mean, median and mode differ, and by how much, tells you whether a single number is a fair summary of a group.

What to do.

  1. Measure the heights (or arm spans, in cm) of at least 30 classmates and record them.
  2. Find the exact median from the sorted list.
  3. Group the heights with class size $5$ cm and build the cumulative frequency column.
  4. Compute the mean (Section 13.1), the mode (Section 13.2) and the median (this section) from the grouped table.
  5. Test the relation: compute $3\times\text{Median}$ and $\text{Mode}+2\times\text{Mean}$ and find their difference.

Tools: A tape measure, a calculator or a spreadsheet

Hand in: The raw heights, the grouped table with cumulative frequencies, the three averages, the test of the relation, and a short comment on whether your class data are symmetric or skewed.

Going further. Add one tall outlier (for example $210$ cm) to the data. Which of the three averages moves the most, and which barely moves?

Teacher/parent note: class heights are usually close to symmetric, so the three averages come out close together and the relation holds well. Adding an outlier shows why the median is called a "resistant" measure: it hardly moves while the mean shifts.

๐Ÿงช Self-check quiz

0/5 correct

Q1. The median of $3,\ 8,\ 5,\ 9$ is

Q2. For a distribution with $n=80$, the median class is the first class whose cumulative frequency is at least

Q3. A median class has $l=30$, $h=10$, $f=10$, $cf=20$ and $\frac n2=25$. The median is

Q4. A moderately skewed distribution has mean $30$ and mode $24$. Its median is about

Q5. The cumulative frequency of the last class of a table is always