Math Lab
Home/Class X/Ch 13/Median of grouped data

Median of grouped data

The median is the middle value of a data set , the value that splits the data into two halves of equal size. For an ungrouped data of nn values arranged in increasing order, the median is the ((n+1)/2)((n+1)/2)th value (if nn is odd) or the average of the (n/2)(n/2)th and (n/2+1)(n/2 + 1)th values (if nn is even).

For grouped data, the calculation is more involved. We can't pinpoint a single middle value because each class contains many observations. Instead, we find the median class , the class that contains the (n/2)(n/2)th observation , and use a formula to estimate where within that class the median lies.

Step 1: Cumulative frequency

Compute the cumulative frequency table. This tells you how many observations fall up to and including each class.

For example:

Classffcfcf
0100-104444
102010-20661010
203020-3010102020
304030-40552525
405040-50332828

Here n=28n = 28 and n/2=14n/2 = 14.

Step 2: Find the median class

The median class is the class whose cumulative frequency is the first to be n/2\geq n/2.

For the example, n/2=14n/2 = 14. The cumulative frequencies are 4,10,20,4, 10, 20, \ldots , the first to reach or exceed 1414 is 2020, which is in the class 203020-30. So the median class is 203020-30.

Step 3: Apply the formula

Median=L+(n/2)Ff×h,\text{Median} = L + \frac{(n/2) - F}{f} \times h,

where:

  • LL = lower limit of the median class.
  • nn = total frequency.
  • FF = cumulative frequency before the median class.
  • ff = frequency of the median class.
  • hh = class size.

For the example: L=20,n/2=14,F=10L = 20, n/2 = 14, F = 10 (cf of class 102010-20), f=10,h=10f = 10, h = 10.

Median=20+141010×10=20+4=24\text{Median} = 20 + \frac{14 - 10}{10} \times 10 = 20 + 4 = 24.

Intuition behind the formula

The median is the value at which exactly n/2n/2 observations lie below. The cumulative frequency before the median class accounts for FF observations; we need n/2Fn/2 - F more to reach the median position. Within the median class, these n/2Fn/2 - F observations are spread across the class of size hh, evenly. So we move ((n/2F)/f)((n/2 - F)/f) of the way through the class, starting from its lower limit.

Worked examples

Example 1. Find the median: classes 010,1020,2030,3040,40500-10, 10-20, 20-30, 30-40, 40-50 with frequencies 7,10,16,8,97, 10, 16, 8, 9.

cfcf: 7,17,33,41,507, 17, 33, 41, 50. n=50,n/2=25n = 50, n/2 = 25. First cf25cf \geq 25 is 3333, in class 203020-30.

L=20,F=17,f=16,h=10L = 20, F = 17, f = 16, h = 10.

Median=20+251716×10=20+5=25\text{Median} = 20 + \frac{25 - 17}{16} \times 10 = 20 + 5 = 25.

Example 2. Marks of 4040 students:

Marks0100-10102010-20203020-30304030-40405040-50
ff558814147766

Find the median.

cfcf: 5,13,27,34,405, 13, 27, 34, 40. n/2=20n/2 = 20. First cf20cf \geq 20 is 2727, in class 203020-30. L=20,F=13,f=14,h=10L = 20, F = 13, f = 14, h = 10.

Median=20+201314×10=20+5=25\text{Median} = 20 + \frac{20 - 13}{14} \times 10 = 20 + 5 = 25.

Example 3. Class size 55, classes start at 00. Frequencies: 3,6,9,7,53, 6, 9, 7, 5. Find the median.

Classes: 05,510,1015,1520,20250-5, 5-10, 10-15, 15-20, 20-25. cfcf: 3,9,18,25,303, 9, 18, 25, 30. n/2=15n/2 = 15. First cf15cf \geq 15: 1818. Median class: 101510-15. L=10,F=9,f=9,h=5L = 10, F = 9, f = 9, h = 5.

Median=10+1599×5=10+10/313.33\text{Median} = 10 + \frac{15 - 9}{9} \times 5 = 10 + 10/3 \approx 13.33.

Example 4. The median of a data with classes 010,1020,2030,30400-10, 10-20, 20-30, 30-40 and frequencies f1,15,25,10f_1, 15, 25, 10 is 2424. Find f1f_1 given n=60n = 60.

cfcf: f1,f1+15,f1+40,f1+50=60f1=10f_1, f_1 + 15, f_1 + 40, f_1 + 50 = 60 \Rightarrow f_1 = 10.

n/2=30n/2 = 30. cfcf: 10,25,50,6010, 25, 50, 60. First 30\geq 30: 5050 (in class 203020-30). L=20,F=25,f=25,h=10L = 20, F = 25, f = 25, h = 10. Median =20+(3025)/25×10=20+2=22= 20 + (30-25)/25 \times 10 = 20 + 2 = 22.

But the given median is 2424, not 2222. So f1=10f_1 = 10 doesn't match. Let me re-verify (the question's setup may be designed to yield f1f_1 matching 2424): 24=20+(30(f1+15))/25×104=(15f1)/2.515f1=10f1=524 = 20 + (30 - (f_1 + 15))/25 \times 10 \Rightarrow 4 = (15 - f_1)/2.5 \Rightarrow 15 - f_1 = 10 \Rightarrow f_1 = 5.

So f1=5f_1 = 5, with total =5+15+25+10=5560= 5 + 15 + 25 + 10 = 55 \neq 60. The problem is over-constrained. (This is the kind of detail to be careful with on board exams.)

Example 5. A more-than table gives cumulative frequency: more than 00: 5050; more than 1010: 4646; more than 2020: 3535; more than 3030: 2020; more than 4040: 55; more than 5050: 00. Find the median.

Class frequencies: 5046=450 - 46 = 4 (class 0100-10), 4635=1146 - 35 = 11 (102010-20), 3520=1535 - 20 = 15 (203020-30), 205=1520 - 5 = 15 (304030-40), 55 (405040-50). Total 5050.

cfcf (less-than form): 4,15,30,45,504, 15, 30, 45, 50. n/2=25n/2 = 25. First 25\geq 25: 3030, in class 203020-30. L=20,F=15,f=15,h=10L = 20, F = 15, f = 15, h = 10.

Median=20+251515×10=20+20/3=26.67\text{Median} = 20 + \frac{25 - 15}{15} \times 10 = 20 + 20/3 = 26.67.

Try it yourself

  1. Find the median: classes 010,1020,2030,30400-10, 10-20, 20-30, 30-40 with frequencies 4,9,7,54, 9, 7, 5.
  2. Find the median: classes 515,1525,2535,3545,45555-15, 15-25, 25-35, 35-45, 45-55 with frequencies 5,7,11,6,45, 7, 11, 6, 4.
  3. Find the median height (cm): classes 140150,150160,160170,170180140-150, 150-160, 160-170, 170-180 and frequencies 10,25,15,510, 25, 15, 5.
  4. The mean of a data is 2525 and the mode is 2020. Find the median (use empirical relation).
  5. A data set has total frequency 4040 and the median falls in the class 203020-30 with L=20,F=15,f=12,h=10L = 20, F = 15, f = 12, h = 10. Find the median.
  6. A frequency table has class size 55 starting at 55. Frequencies 3,6,8,7,4,23, 6, 8, 7, 4, 2. Find the median.
  7. A less-than table: <10:5,<20:15,<30:30,<40:45,<50:50<10: 5, <20: 15, <30: 30, <40: 45, <50: 50. Find the median.
  8. The median of a data set with classes 010,1020,2030,30400-10, 10-20, 20-30, 30-40 is 2525. Total frequency is 5050 and the median class has frequency 2020. The cf before the median class is f0f_0. Find f0f_0.
  9. Find the median: data given as cumulative frequencies <5:2,<10:6,<15:12,<20:18,<25:22<5: 2, <10: 6, <15: 12, <20: 18, <25: 22.
  10. Compare mean, median, and mode for the data: 10,12,15,17,20,22,25,28,30,3210, 12, 15, 17, 20, 22, 25, 28, 30, 32.
  11. The mean is 5050 and median is 4848. Find the mode (empirical).
  12. A frequency distribution has classes 010,1020,2030,30400-10, 10-20, 20-30, 30-40 with cumulative frequencies 5,15,30,405, 15, 30, 40. Find the median.

Pitfalls / Insight

(1) Always use the less-than cumulative frequency. If the problem gives a more-than table, first convert it.

(2) The median class is the first class whose cumulative frequency n/2\geq n/2. Not the last class with cfn/2cf \leq n/2 , that would be the previous class.

(3) The class size hh must be uniform for the formula to be straightforward. If not, you need to convert to uniform classes.

(4) The median is robust to outliers; the mean is not. If the data has a long tail (skew), the median is often the more "typical" value.

(5) For perfectly symmetric data, mean = median = mode. For right-skewed, mean > median > mode. For left-skewed, mean < median < mode.

Practice quiz

Quick check on this topic.

Quiz
Quick check : Median
6 questions · pick the best answer
Q1

n=40n = 40. n/2=n/2 = :

Q2

First cfn/2cf \geq n/2 identifies the:

Q3

L=20,F=12,f=8,h=10,n/2=20L = 20, F = 12, f = 8, h = 10, n/2 = 20. Median:

Q4

If mean = 3030, mode = 2424, median (empirical):

Q5

Median is robust to:

Q6

Median class with cf-before FF and frequency ff. Within the class, median is at fraction: