Median of data
Ask a class of 25 students for their test marks and one careless answer — a stray 2 or a genius 98 — can drag the average mark far from what "most" students actually scored. The median dodges this problem entirely: line every value up in order and simply point to the one sitting in the middle. It ignores how big or small the extreme values are and cares only about their position, which is exactly why it survives outliers that would distort the mean. This chapter, "Tales by Dots and Lines," treats the median as a recap-and-extend of the middle-value idea students already met, now paired deliberately with the mean so the two can be computed side by side and compared. The real skill being tested is not just finding the median but knowing when it, rather than the mean, is the more honest way to describe a data set.
The median is the middle value of data arranged in order — the value at position for odd , or the mean of the two middle values for even — and because it depends only on position, not magnitude, it stays close to "typical" even when a few values are extreme outliers.
The core idea
Step 0 — sort first, always. The median only makes sense once the data is arranged in ascending (or descending) order. Picking the value in the middle position of an unsorted list is meaningless — sorting is not optional, it is the first and unavoidable step.
Odd number of observations. If there are observations and is odd, there is a single value exactly in the middle of the ordered list, at position counting from either end.
where: is the total number of observations after sorting, and the position is counted starting from 1 at either end of the ordered list.
Even number of observations. If is even, there is no single middle value — there are two values tied for the centre, at positions and . The median is defined as their average.
where: the two "middle positions" are always and the very next one, ; the median itself need not be a value that actually occurs in the data.
Why outliers barely move it. The median formula only ever looks at where a value sits after sorting, never at how big it is. Stretch the largest value in a data set from 21 to 2100 — the median does not budge, because that value is still simply "the last one" in the order. The mean, by contrast, is a sum divided by count, so every unit added to any single value shifts the mean directly. This single structural difference is why the median is called a resistant (or robust) measure of central tendency, while the mean is not.
Median vs mean, side by side. When data is fairly evenly spread with no extreme values, the mean and median usually land close together — one is not obviously "better" than the other. Once a data set has one or two values much larger or smaller than the rest, the mean is pulled toward those extremes while the median stays near where most of the data actually sits, making it the more representative "typical" value. This is the comparison the chapter wants you to make explicitly for every data set, not just calculate both numbers mechanically.
Where this shows up outside the textbook. Reports on "typical" income, house prices or city rents almost always quote the median rather than the mean, precisely because a handful of very high earners or very expensive properties would otherwise inflate the mean far above what most people actually experience. Recognising this pattern — a data set with a long tail of unusually large values, and a headline number that quotes the median — is a direct real-world echo of the salary example worked through below.
The goal, spelled out precisely, is this: given only the count of observations in a sorted data set (never mind what the actual values are), determine the exact rule that tells you which position, or which pair of positions, holds the median, and why the odd and even cases genuinely need different rules rather than one formula covering both.
Step 1. Picture the ordered list as dots in a row, numbered by position from left to right. "The middle" means the position with an equal number of dots on either side of it.
Step 2. Suppose is odd. Then is even, so it splits perfectly into two equal halves of dots each, with exactly one dot left over sitting between them. That leftover dot is at position , which is why the odd-case formula is , not .
Step 3. Now suppose is even. Splitting dots into two equal halves gives dots on each side, with no single dot left over — the split falls exactly between two dots, at positions and . Neither position alone is "more middle" than the other, so the median is defined as their average, giving equal weight to both.
Step 4. Check the boundary cases. For (odd), : two values below position 3, two above — correct. For (even), the middle positions are and : two values below position 3, two above position 4, and the two middle ones shared equally — correct. The rule is fully verified for both parities by this counting argument, with no need to test every possible separately.
Worked example
Six employees at a small company earn these monthly salaries, in rupees thousand: 25, 28, 30, 32, 35, 200 — the last figure being the owner's much larger salary. Find the median and compare it with the mean.
Step 1. Arrange in ascending order. The list is already sorted: 25, 28, 30, 32, 35, 200.
Step 2. Count the observations. , which is even, so there are two middle positions: and .
Step 3. Identify the two middle values. The 3rd value in the ordered list is 30; the 4th is 32.
Step 4. Average the two middle values.
Step 5. Compute the mean for comparison.
Step 6. Interpret both numbers together. The median is ₹31,000, which sits comfortably among the five ordinary salaries (25 to 35). The mean, ₹58,300, is dragged far above what almost every employee actually earns, purely because the owner's salary of 200 is so much larger than the rest. Here the median is clearly the more honest description of a "typical" employee's pay — exactly the situation the chapter wants you to recognise and explain, not just compute.
Common traps
- Forgetting to sort first. The position rules only apply to data already arranged in order; picking "the middle number" from an unsorted list gives a meaningless answer.
- Mixing up the odd and even rules. Always check whether is odd or even before applying a formula — using the odd-case single position when is even (or vice versa) is the single most common slip.
- Miscounting the middle position. For odd , the position is , not ; for , that is position 3, not 2 or 2.5.
- Treating mean and median as interchangeable. They usually differ once a data set has outliers — a complete answer says which one better represents "typical" data for that specific situation, not just states both numbers.
Ask the tutor: want a few more median problems, especially ones mixing even and odd counts or hidden outliers?
Why can the median be a number that never actually appears in the data
This happens whenever is even, because the median is defined as the average of the two middle values, not either value itself. In the salary example, the sorted list has 30 and 32 as its two middle values, and their average, 31, is the median even though no employee earns exactly ₹31,000. This is completely normal and expected for even-sized data sets — the median is a calculated "midpoint," not necessarily a value drawn from the list.
If the mean and median of a data set are very close to each other, what does that tell me
It's a strong hint that the data is fairly evenly spread, without any values that are dramatically larger or smaller than the rest. When there are no strong outliers pulling the mean away from the bulk of the data, the two measures naturally land near each other, as in the marks example where both worked out to 15. A big gap between mean and median, on the other hand, is a signal to look for outliers.
Is the median always "better" than the mean for describing data
Not always — each has its place. The median is preferred when a data set has outliers or is skewed, because it isn't distorted by extreme values, as with the salary example. But the mean uses every value in the data set and is often more useful when you need a number that reflects the total (for example, total marks divided among students), or when the data has no significant outliers. The chapter's point is to compute both and choose whichever one honestly represents the situation, rather than always defaulting to one.