Finding the median
Line the values up from smallest to largest. Which number sits in the middle, and what if two of them share the middle?
Where you are 2 in Median and mode
When you reach for it
Abril has nine podcast episodes saved, of lengths 42, 35, 51, 38, 47, 60, 33, 45 and 40 minutes. She wants one number that says how long a typical episode is. One good answer is the episode in the middle: put the lengths in order from shortest to longest and take the one with as many episodes before it as after it. That number is the median.
The median is one of the measures of center in Median and mode. The mean balances the distances on either side; the median simply stands in the middle of the sorted list. You reach for it whenever the data are numbers and the question is “what value splits the data into a lower half and an upper half?” It works on a plain list, and it works just as well on a dot plot or a frequency table, where the values are already in order and only need counting.
The median of a numerical data set is the middle value once the values are sorted from smallest to largest. When the number of values is even, there are two middle values, and the median is the number halfway between them. Either way, as many values sit before the median in the sorted list as sit after it.
The procedure
Sort first. A list is usually written in the order the values were collected: first day, second day, and so on. That order says nothing about size, so the entry in the middle of the written list can be any value at all. The median is about position by size, so the values must be put in order before anything is counted. Every value is kept, repeats included: if 3 appears twice, it is written twice, because each occurrence is one piece of data.
Count the values and find the middle position. Call the number of values n. In a sorted list of n values, the middle position is
This works because the middle position must have the same number of values before it as after it. Leave out the middle value and n - 1 values remain, split evenly: \displaystyle \frac{n-1}{2} before and \displaystyle \frac{n-1}{2} after. So the middle value is in position \displaystyle \frac{n-1}{2} + 1 = \frac{n+1}{2}. With n = 9, the middle position is \displaystyle \frac{10}{2} = 5: four values before the fifth, four after.
Odd count: one middle value. When n is odd, n + 1 is even, so \displaystyle \frac{n+1}{2} is a whole number and names one position. The value there is the median.
Even count: two middle values, and the median halfway between them. When n is even, \displaystyle \frac{n+1}{2} ends in .5. With n = 8 it is 4.5, which is not a position at all: it falls between the fourth and fifth values. Those two are the middle values, one closing the lower half and one opening the upper half. Any number from the fourth value up to the fifth would split the list four and four, so a choice has to be made, and statisticians have agreed on the fairest one: the point exactly halfway between the two, which is their mean. If the two middle values are a and b,
This number need not be one of the data values. If the middle values are 4 and 7, the median is 5.5 even though no value equals 5.5. If the two middle values are equal, the median is that shared value.
Reading the median from a display. A dot plot and a frequency table have already done the sorting: the values run from smallest to largest, left to right or top to bottom. So nothing needs to be listed. Add up the counts as you go, a running total, until it reaches the middle position. The value whose stack or row brings the running total up to or past that position is the median, and for an even count the same is done for both middle positions.
What the median promises. Every value before the median in the sorted list is at most the median, and every value after it is at least the median. So at least half the values are at or below the median, and at least half are at or above it. “At least” matters when values repeat: several values can equal the median, and then each of them counts on both sides.
Worked examples
An odd number of values
Find the median of Abril’s nine episode lengths: 42, 35, 51, 38, 47, 60, 33, 45, 40 minutes.
SolutionThe lengths are in the order she saved them, so sort them first:
There are n = 9 values, an odd count, so there is one middle position, \displaystyle \frac{9 + 1}{2} = 5. Counting along the sorted list, the fifth value is 42. The median length is 42 minutes.
Check: four episodes (33, 35, 38, 40) are shorter and four (45, 47, 51, 60) are longer, so 42 does stand in the middle.
An even number of values
Aksel records how many minutes late his train is on eight days: 4, 0, 12, 7, 3, 9, 2, 15. Find the median delay.
SolutionSort the delays:
There are n = 8 values. The middle position is \displaystyle \frac{8+1}{2} = 4.5, which falls between the fourth and fifth values, so those two are the middle values: 4 and 7. The median is the number halfway between them:
The median delay is 5.5 minutes. No train was 5.5 minutes late, and that is fine: the median is a point on the scale, not a day picked from the list. Figure 1 shows it. Four delays lie below 5.5 and four above.
Two middle values that are equal
Six pickers at an orchard weigh the apples each one gathered: 4.5, 6.2, 5.0, 3.8, 5.0, 7.1 kilograms. Find the median, and count how many values are at or below it and at or above it.
SolutionSort the masses, keeping both 5.0s:
There are n = 6 values, so the middle values are the third and fourth, 5.0 and 5.0. Halfway between a number and itself is that number: \displaystyle \frac{5.0 + 5.0}{2} = 5.0. The median is 5 kilograms, and this time it is a data value.
Four masses (3.8, 4.5, 5.0, 5.0) are at or below 5, and four (5.0, 5.0, 6.2, 7.1) are at or above it. That is four out of six on each side, more than half, because the two values equal to the median count on both sides.
The median from a dot plot
Figure 2 shows how many minutes late Alois’s train was on each of 19 days. Find the median delay.
The dot plot is already sorted from left to right, so there is no list to write. With n = 19, an odd count, the median is the value in position \displaystyle \frac{19+1}{2} = 10. Count the dots stack by stack from the left, keeping a running total:
| Minutes late | Dots | Running total |
|---|---|---|
| 0 | 4 | 4 |
| 1 | 3 | 7 |
| 2 | 5 | 12 |
After the stack at 1 the running total is 7, short of 10. The stack at 2 holds positions 8 to 12, so it holds position 10. The median delay is 2 minutes.
Check from the other end: the dots to the right of 2 number 2 + 2 + 1 + 1 + 1 = 7, the same as the 7 dots to its left, so 2 is in the middle.
The median from a frequency table
At the orchard, 24 pickers each filled some baskets. The table shows how many pickers filled each number of baskets. Find the median number of baskets.
| Baskets filled | 1 | 2 | 3 | 4 | 5 | 6 |
|---|---|---|---|---|---|---|
| Pickers | 2 | 5 | 5 | 6 | 4 | 2 |
The table lists the values in order, so it is a sorted list written compactly. Check the count first: 2 + 5 + 5 + 6 + 4 + 2 = 24. With n = 24, an even count, the middle position \displaystyle \frac{24 + 1}{2} = 12.5 lies between positions 12 and 13. Keep a running total along the row: 2, then 7, then 12, then 18.
The running total reaches exactly 12 at the end of the 3 column, so the twelfth value is 3. The thirteenth value is the first in the next column, so it is 4. The median is
No picker filled three and a half baskets, but 3.5 marks the split: twelve pickers filled 3 or fewer, and twelve filled 4 or more.
A missing value
Adah’s six favorite episodes have these lengths in minutes, already sorted: 28, 31, x, 40, 44, 52. The median length is 37 minutes. Find x.
SolutionSix values is an even count, so the median is halfway between the third and fourth values, x and 40:
A number halfway between two others is half their sum, so the sum of the two middle values must be 2 \times 37 = 74. Then x + 40 = 74, and x = 74 - 40 = 34.
Check: 34 lies between 31 and 40, so the list is still sorted with x in third place, and \displaystyle \frac{34 + 40}{2} = \frac{74}{2} = 37.
Boundaries
The data must be numbers that can be put in order. A list of favorite colors has no median, because “red” is neither bigger nor smaller than “blue”.
The halfway rule is an agreement. Any number from the lower middle value to the upper one splits an even list evenly. Taking the halfway point is the convention everyone uses, so that two people working on the same data get the same median.
The median is not always a data value, and when the data are counts (people, baskets) it can be a value no single item could have, such as 3.5 baskets.
The median describes the center only. Two data sets can have the same median and very different spreads: 10, 20, 30 and 19, 20, 21 both have median 20. Spread needs its own measure. How far the median moves when an extreme value joins the data, compared with the mean, is the subject of Resistant and non resistant measures.
Where this goes next
The median cuts the sorted data into a lower half and an upper half. Taking the median of each half gives the Quartiles and the five number summary, which cut the data into quarters; together with the smallest and largest values they make the five-number summary drawn in a box plot. A stem-and-leaf plot is another display that keeps values in order, so the median is read from it by the same counting used here on a dot plot. Placing the median beside the mean and the mode lets you choose the center that best answers a question about a data set.
Exercises
An odd number of values
- Find the median of 14, 8, 21, 11, 17.
- Find the median of 52, 47, 63, 39, 58, 44, 50.
- A train was late by these numbers of minutes on nine days: 6, 0, 3, 11, 2, 3, 8, 1, 5. Find the median delay.
An even number of values
- Find the median of 12, 18, 9, 15.
- Find the median of 30, 26, 41, 35, 28, 33.
- Eight podcast episodes last 54, 61, 48, 57, 61, 50, 66, 45 minutes. Find the median length.
- Four pickers gathered 2.4, 3.1, 1.8, 2.9 kilograms of apples. Find the median mass.
- Find the median of 9, 14, 5, 9, 12, 9.
- Four podcast episodes last \displaystyle \frac{3}{4}, \frac{1}{2}, 1, \frac{1}{4} hours. Find the median length in hours.
Reading the median from a display
Exercises 10 to 12 use Figure 3, Table A and Table B, which come first.
Table A shows how many baskets each of 21 pickers filled.
| Baskets filled | 2 | 3 | 4 | 5 | 6 |
|---|---|---|---|---|---|
| Pickers | 3 | 4 | 7 | 5 | 2 |
Table B shows how many episodes of a podcast each of thirty listeners heard last week.
| Episodes heard | 0 | 1 | 2 | 3 | 4 | 5 |
|---|---|---|---|---|---|---|
| Listeners | 4 | 6 | 5 | 7 | 5 | 3 |
- Figure 3 shows how many minutes late each of 16 trains was one morning. Find the median delay.
- Use Table A to find the median number of baskets.
- Use Table B to find the median number of episodes heard.
- A sorted list has 35 values. Which position holds the median?
- A sorted list has 50 values. Which positions hold the two middle values?
Using the median
- The sorted list 20, 24, 27, x, 35, 38 has median 29. Find x.
- Seven episodes last 31, 34, 38, 40, 43, 47, 52 minutes. Find the median. Then an eighth episode of 70 minutes is added. Find the new median.
- Write four different whole numbers whose median is 10 but none of which is 10.
Explain your reasoning
- Explain why the median of an even number of values is never smaller than the lower middle value and never larger than the upper middle value, and why it may still not be one of the values.
- The list 12, 3, 20, 8, 5 has 20 in its middle entry as written. Find the median, and explain why the values must be sorted before the middle is taken.
- Every value in a list of eight values is a whole number. Can the median be 6.25? Explain.
- A dot plot shows 40 dots. Explain how to find the median without writing out all 40 values, and say which positions you need.
- For the data 2, 4, 4, 4, 9, 10, find the median. How many values are at or below it, and how many at or above? Explain why both counts are more than half.
Answers
- 14. Sorted: 8, 11, 14, 17, 21; with n = 5 the middle position is \displaystyle \frac{5+1}{2} = 3.
- 50. Sorted: 39, 44, 47, 50, 52, 58, 63; the fourth of seven values is 50.
- 3 minutes. Sorted: 0, 1, 2, 3, 3, 5, 6, 8, 11; the fifth of nine values is 3.
- 13.5. Sorted: 9, 12, 15, 18; the middle values are 12 and 15, and \displaystyle \frac{12 + 15}{2} = 13.5.
- 31.5. Sorted: 26, 28, 30, 33, 35, 41; \displaystyle \frac{30 + 33}{2} = 31.5.
- 55.5 minutes. Sorted: 45, 48, 50, 54, 57, 61, 61, 66; the fourth and fifth values are 54 and 57, and \displaystyle \frac{54 + 57}{2} = 55.5.
- 2.65 kilograms. Sorted: 1.8, 2.4, 2.9, 3.1; \displaystyle \frac{2.4 + 2.9}{2} = \frac{5.3}{2} = 2.65.
- 9. Sorted: 5, 9, 9, 9, 12, 14; the third and fourth values are both 9, so the median is 9.
- \displaystyle \frac{5}{8} hour. Sorted: \displaystyle \frac{1}{4}, \frac{1}{2}, \frac{3}{4}, 1; the middle values are \displaystyle \frac{1}{2} = \frac{4}{8} and \displaystyle \frac{3}{4} = \frac{6}{8}, and halfway between them is \displaystyle \frac{5}{8}.
- 3.5 minutes. With 16 dots the middle values are the eighth and ninth. Running totals: 2 at 0, 4 at 1, 7 at 2, 8 at 3, 11 at 4. The eighth dot is the one at 3 and the ninth is the first at 4, so the median is \displaystyle \frac{3 + 4}{2} = 3.5.
- 4 baskets. The counts add to 21, so the median is in position \displaystyle \frac{21+1}{2} = 11. Running totals: 3, 7, 14; positions 8 to 14 are 4s.
- 2.5 episodes. The counts add to 30, so the middle values are the fifteenth and sixteenth. Running totals: 4, 10, 15, 22. The fifteenth is the last 2 and the sixteenth is the first 3, so the median is \displaystyle \frac{2 + 3}{2} = 2.5.
- The eighteenth: \displaystyle \frac{35 + 1}{2} = 18, with 17 values before it and 17 after.
- The twenty-fifth and twenty-sixth: \displaystyle \frac{50 + 1}{2} = 25.5 falls between them, leaving 25 values on each side of the split.
- x = 31. The middle values are 27 and x, so 27 + x = 2 \times 29 = 58 and x = 58 - 27 = 31, which lies between 27 and 35 as the sorted list needs.
- 40 minutes, then 41.5 minutes. With seven values the fourth, 40, is the median. With 70 added there are eight values, 31, 34, 38, 40, 43, 47, 52, 70, and the middle values are 40 and 43, so the new median is \displaystyle \frac{40 + 43}{2} = 41.5.
- One answer: 7, 8, 12, 15. The two middle values must add to 2 \times 10 = 20 and must be different, for example 8 and 12 or 9 and 11; the smallest value goes below the lower one and the largest above the upper one. Here \displaystyle \frac{8 + 12}{2} = 10.
- The median is \displaystyle \frac{a + b}{2} for middle values a \le b. Half the sum of two numbers lies halfway along the gap from a to b, so it is at least a and at most b. It equals a data value only when it lands on one; if a < b and no value lies strictly between them, as with 4 and 7 in Example 2, the median is not in the data.
- 8. Sorted: 3, 5, 8, 12, 20, and the third value is 8. The written order is the order the values were collected and says nothing about size; here the middle entry 20 is in fact the largest value, with all four others below it, so it does not split the data.
- No. The median of eight values is \displaystyle \frac{a + b}{2} for two whole numbers a and b. If a + b is even the median is a whole number, and if it is odd the median ends in .5. A value ending in .25 cannot occur.
- The dot plot is already sorted, so count dots stack by stack from the left with a running total. Since \displaystyle \frac{40 + 1}{2} = 20.5, the middle values are in positions 20 and 21: find the stacks holding those two dots and take the number halfway between their values.
- The median is 4: the third and fourth values are both 4. Four values (2, 4, 4, 4) are at or below 4, and five (4, 4, 4, 9, 10) are at or above it, out of six. Both are more than three because the three values equal to 4 count on both sides.