Cumulative frequency and the median · Mathematics Class… | StemPy Lab
Course 16.2·Lesson 2 of 3
Cumulative frequency and the median
The median splits the data into two halves. For grouped data we add up the frequencies class by class to get the cumulative frequency, find the median class, and then use the median formula to place the median inside it.
about 30 min1 simulation2 practice questions
Lesson 2 of 3Show all lessonsHide
Try the code and the simulations beside the lesson.
What you will be able to do
build a cumulative frequency table;
find the median class and use the median formula;
find the median when the classes are inclusive.
The middle value
Seven students are lined up in order of height. The middle one is the fourth. The median is the value in the middle of the ordered data. Half of the values are below it and half are above. With grouped data the values are not listed, so we use the cumulative frequency to find where the middle falls.
Cumulative frequency
The cumulative frequency of a class is the number of values that are in that class or in the classes before it. It is a running total. Fifty patients waited these times at a clinic.
Waiting time (minutes)
Patients f
Cumulative frequency
0-10
4
4
10-20
9
13
20-30
17
30
30-40
12
42
40-50
8
50
The last cumulative frequency is always N, the total. Here it says that 13 patients waited less than 20 minutes and 30 waited less than 30 minutes. This is the less than type of cumulative frequency. The next course draws it as a graph.
The median class
Half of the patients is 2N=25. Which class holds the 25th patient? Only 13 patients waited less than 20 minutes, and 30 waited less than 30 minutes. So the 25th patient is in the class 20 to 30. This is the median class. It is the first class whose cumulative frequency is at least 2N.
The median formula
We know that 13 patients are below 20 minutes. We need 25−13=12 more to reach the middle. The median class holds 17 patients, spread evenly over 10 minutes. So we go 1712 of the way through the class:
median=l+f2N−cf×h.
l is the lower limit of the median class.
cf is the cumulative frequency of the class before the median class.
f is the frequency of the median class.
h is the class width.
For the clinic, l=20, cf=13, f=17 and h=10:
median=20+1725−13×10=20+7.06=27.06minutes.
A histogram of the waiting times of 50 patients in classes of width 10 minutes from 0 to 50, with frequencies 4, 9, 17, 12 and 8. A vertical dashed line at 27.06 minutes divides the picture into two shaded parts. The part on the left, with 25 patients, is shaded blue. The part on the right, with 25 patients, is shaded orange. Each bar carries its frequency, and the line cuts the class 20 to 30.
The formula assumes that the patients are spread evenly through each class. A-Level books call this idea linear interpolation, and the answer the interpolated median.
Inclusive classes
Classes such as 1 to 10 and 11 to 20 must be turned into continuous classes first. Move each lower limit down by 0.5 and each upper limit up by 0.5. Here are the marks of 50 students.
Marks
Students f
Cumulative frequency
1-10
5
5
11-20
9
14
21-30
16
30
31-40
12
42
41-50
8
50
2N=25, so the median class is 21 to 30. Its boundaries are 20.5 and 30.5, so l=20.5. Then cf=14, f=16 and h=10:
median=20.5+1625−14×10=20.5+6.875=27.38marks.
If we had used l=21, the answer would be 0.5 too large.
When N is odd. Still use 2N as it stands, for example 245=22.5. For grouped data this is the rule in the Indian syllabus.
Practise with new numbers
Try it in Python
The program builds the cumulative frequencies with a running total. Then it finds the median class and the median of the clinic table.
Common mistakes
Using the cumulative frequency of the median class in place of the class before it. The cf in the formula is the one just before the median class.
Comparing 2N with the frequencies rather than with the cumulative frequencies.
Forgetting to subtract cf. The top of the fraction is 2N−cf.
Keeping inclusive limits. Use 20.5, not 21, as the lower limit of 21 to 30.
Remember these
The cumulative frequency is the running total of the frequencies. The last one is N.
The median class is the first class whose cumulative frequency is at least 2N.
median=l+f2N−cf×h, with cf the cumulative frequency before the median class.
For inclusive classes, move the limits by 0.5 first.
Check yourself
Try each one on your own first. If you are stuck, open a hint. Then check with Show the answer.
The frequencies of a table are 5,8,12,9,6. Write the cumulative frequencies.
In the table of question 1, which class is the median class?
A median class is 30 to 40 with f=10, cf=17 and 2N=21. Find the median.
What is the lower limit l of the median class 41 to 50 when the classes are inclusive?
Why does the median formula subtract cf?
References
NCERT, Mathematics for Class 10, the chapter Statistics: the median of grouped data.
OpenStax, Introductory Statistics, Chapter 2 Descriptive Statistics: the median.
Enroll free in Mode and Median of Grouped Data
Every lesson is open to read. Enrolling also lets you:
Mark lessons done and carry on where you stopped.
Take the tests of this lesson and its course.
Count the course towards the certificate for its chapter.