Sub topic 2
The Median as the Middle Value
This chapter assumes you can order numbers from least to greatest and find the mean of two numbers. The median is a measure of center. It tells you where the middle of an ordered data set lies.
Start by Ordering the Data
Always arrange the values from least to greatest before finding the median:
\[ 3,\ 5,\ 7,\ 8,\ 12,\ 13,\ 14 \]
The order matters. The median depends on position, not on the original order or on the size of the gaps between values.
Odd Number of Values
When a data set has an odd number of values, exactly one value is in the middle.
For \(7\) values, the middle position is
\[ \frac{7+1}{2}=4. \]
In the ordered list above, the fourth value is \(8\). Therefore, the median is \(8\).
A useful position formula for an odd-sized list is
\[ \text{middle position}=\frac{n+1}{2}, \]
where \(n\) is the number of values. This formula gives a position, not necessarily a value. You must still look at the ordered list.
Even Number of Values
When a data set has an even number of values, there is no single middle value. The two central values divide the list into equal halves. Find their mean.
Consider
\[ 4,\ 6,\ 9,\ 15,\ 20,\ 23. \]
There are \(6\) values. The central positions are \(3\) and \(4\), containing \(9\) and \(15\). Thus,
\[ \text{median}=\frac{9+15}{2}=12. \]
The median does not have to be one of the original values. Here, \(12\) was not in the data set.
| Number of values | Middle positions | Median |
|---|---|---|
| Odd, \(n=7\) | 4 | The value in position 4 |
| Even, \(n=6\) | 3 and 4 | The mean of the values in positions 3 and 4 |
Why the Median Matters
The median divides an ordered data set into two groups with the same number of values, or as nearly the same number as possible. At least half of the values are less than or equal to the median, and at least half are greater than or equal to it.
The median is often useful when a data set contains an extreme value. For example:
\[ 8,\ 9,\ 10,\ 11,\ 12 \]
has median \(10\). If \(12\) changes to \(100\), the ordered list becomes
\[ 8,\ 9,\ 10,\ 11,\ 100, \]
but the median remains \(10\). The mean would increase substantially. This makes the median less sensitive to unusually large or small values.
On the GRE, a question may give the median and several values, then ask for an unknown value. First determine the required middle position. Then use the fact that the unknown value must preserve the ordering and the specified middle value.
def median(values):
ordered = sorted(values)
n = len(ordered)
middle = n // 2
if n % 2 == 1:
return ordered[middle]
return (ordered[middle - 1] + ordered[middle]) / 2
print(median([12, 4, 9, 6, 15])) # 9
print(median([20, 4, 9, 15])) # 12.0Common Errors
- Finding the median before sorting the data.
- Choosing the lower or upper middle value when the count is even.
- Confusing the median with the mean.
- Forgetting that repeated values each occupy a separate position.
- Using the formula \((n+1)/2\) as though it were the median itself.
Exercise
What is the median of 6, 2, 14, 9, 5, and 11?
Show answer
Order the values as 2, 5, 6, 9, 11, 14. The two middle values are 6 and 9, so the median is (6 + 9) / 2 = 7.5.