Mean, median and mode · Mathematics Class 11–12 | StemPy Lab
Course 17.1·Lesson 1 of 3
Mean, median and mode
One number that stands for a whole list is an average. The mean adds and shares, the median is the middle value, and the mode is the most common value. This lesson finds all three for a short list, a frequency table and grouped data, and shows when each one is the right choice.
about 35 min1 simulation1 practice question2 Python programs5 questions to check yourself
This lesson is free to read. Enroll free to keep your place and take the tests.
Lesson 1 of 3Show all lessonsHide
Try the code and the simulations beside the lesson.
What you will be able to do
find the mean, median and mode of a list, a frequency table and grouped data;
use an assumed mean and a step deviation to shorten the work;
choose the average that suits the data, and explain why an extreme value moves the mean but not the median.
One number for the whole list
A school wants to tell new students how long they usually wait for the school bus. Eight students write down their waiting time in minutes: 14,9,12,17,9,11,9,13. Eight numbers are too many to remember. One number that stands for the list is easier. Such a number is called an average, or a measure of central tendency, because it shows where the data centres.
There are three common averages. Each answers a slightly different question.
The mean
Add all the values, then divide by how many there are. The mean of x1,x2,…,xn is
xˉ=nx1+x2+⋯+xn=n∑x.
The symbol xˉ is read "x bar". The symbol ∑ is the Greek capital sigma and means "add up". For the waiting times, the total is 94 minutes and n=8, so xˉ=894=11.75 minutes.
When a value repeats, a frequency table saves writing. If the value xi occurs fi times, and N=∑f is the total number of values, then
xˉ=N∑fx.
The median
Put the values in order. The median is the middle one. With an odd number of values it is the value in position 2n+1. With an even number it is the mean of the two middle values.
The ordered waiting times are 9,9,9,11,12,13,14,17. There are eight values, so the median is the mean of the fourth and fifth: 211+12=11.5 minutes. Half of the students waited no more than 11.5 minutes.
The mode
The mode is the value that occurs most often. Here 9 occurs three times, so the mode is 9 minutes. A data set can have two modes (bimodal), or none, when every value occurs equally often.
Which average to use
The mean uses every value, so one very large or very small value pulls it. The median depends only on the order, so it stays steady. The mode is the only average that works for data that are not numbers, such as the most common shirt size.
For incomes, house prices and waiting times, a few very large values pull the mean up. A report that says "typical" then often uses the median.
Grouped data
When a table groups the data into classes, we no longer know the exact values. We take every value in a class to be the class mark, which is the middle of the class, also called the mid-point or the mid-interval value. Suppose 50 students scored these marks.
Marks
Students
0-10
4
10-20
8
20-30
15
30-40
10
40-50
7
50-60
6
The mean. The class marks are 5,15,25,35,45,55. Then ∑fx=1510 and N=50, so xˉ=30.2.
The median. Find the class where the running total of frequencies first reaches 2N=25. The running totals are 4,12,27,…, so the median class is 20 to 30. Then
median=l+f2N−C×h.
Here l is the lower boundary of the median class, C is the running total before it, f is its frequency and h is its width. This gives 20+1525−12×10=28.67. The formula assumes that the values spread evenly through the class. A-Level and IB texts call this linear interpolation.
The mode. The modal class is the class with the largest frequency, here 20 to 30. Then
mode=l+2f1−f0−f2f1−f0×h,
where f1 is the frequency of the modal class, f0 the frequency of the class before it and f2 the frequency of the class after it. This gives 20+30−8−1015−8×10=25.83.
A histogram of the marks of 50 students in six classes of width 10, from 0 to 60. The bars have heights 4, 8, 15, 10, 7 and 6. Three vertical lines cross the bars: the mode at 25.83, the median at 28.67 and the mean at 30.2. They are close together, with the mode on the left and the mean on the right of the tallest bar.
For data that is a little skewed, the three averages are linked by the rule of thumb mode≈3median−2mean. Here it gives 3×28.67−2×30.2=25.6, close to 25.83.
A shorter way to the mean
With big numbers, take an assumed meanA, usually a class mark near the middle, and write u=hx−A, where h is the class width. Then
xˉ=A+huˉ,uˉ=N∑fu.
For the marks above, take A=25 and h=10. The values of u are −2,−1,0,1,2,3, and ∑fu=26. So xˉ=25+10×5026=30.2, the same as before, with smaller numbers.
A frequency table that is not grouped
Thirty learners took a quiz and scored 10,20,30,40 or 50 marks. The frequencies are 5,8,12,4 and 1, so N=30.
Marks
10
20
30
40
50
Students
5
8
12
4
1
Running total
5
13
25
29
30
The mean is 30780=26. The 14th to the 25th values are all 30, so the 15th and 16th values, the two middle ones, are both 30. The median is 30. The mode is also 30, the value with the largest frequency.
Practise with new numbers
Try it in Python
The first program finds the three averages of the waiting times with plain Python. The second finds all three for the grouped marks, and also finds the mean by the step-deviation method.
Common mistakes
Dividing by the number of classes. For grouped data divide by N, the total of the frequencies, not by the number of classes.
Taking the median before ordering. Sort the values first.
Using the wrong class for the median. The median class is where the running total first reaches 2N, not the class with the largest frequency.
Mixing up the three classes of the mode formula.f0 is the frequency before the modal class and f2 the frequency after it.
Forgetting the width. Both the median and the mode formulas end with the class width h.
Remember these
Mean: xˉ=N∑fx. Median: the middle value. Mode: the most common value.
For grouped data use class marks for the mean, and the interpolation formulas for the median and the mode.
An extreme value pulls the mean. The median is steady.
With an assumed mean A and step u=hx−A: xˉ=A+huˉ.
Check yourself
Try each one on your own first. If you are stuck, open a hint. Then check with Show the answer.
Find the mean and the median of 7,11,4,15,8.
A frequency table gives the value 1 six times, 2 nine times, 3 three times and 4 two times. Find the mean and the mode.
The numbers 3,7,8,x,12,15 are in order, and the median is 9.5. Find x.
A village has ten families. Nine earn about the same, and one earns a hundred times as much. Which average describes a typical family better, and why?
Find the mode of this grouped data: classes 0 to 20, 20 to 40, 40 to 60 and 60 to 80, with frequencies 4,10,14,2.
References
OpenStax, Introductory Statistics, Chapter 2, section on measures of the centre of the data.
NCERT, Mathematics for Class XI, Chapter 13 (Statistics), introduction on measures of central tendency. The mean, median and mode of grouped data are taught in the Class 10 book, Chapter 14.
Enroll free in Centre and Spread of 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.