ARITHMETIC WORKSHEETS

Checking a median that is absent from the original list

With an even number of observations, the median is the average of the two middle values after sorting, so it can be a number nobody recorded. This guide works the list 1, 4, 8, 20.

What the median reports

The median is the middle of a sorted list: half the observations lie at or below it and half at or above it. For a list with an odd number of entries, one entry sits exactly in the middle, and the median is that entry. An even-length list has no single middle entry. It has a middle pair, and the usual convention takes their average. This guide uses the average calculator, which sorts the values numerically before choosing the middle, so the input order does not matter. The result is a summary of location, and a summary does not have to be one of the measurements that went into it.

Sorting and picking the middle pair

Enter 20, 1, 8, 4 in that order. Sorted numerically, the list becomes 1, 4, 8, 20. There are four values, so the middle pair is the second and third: 4 and 8. Their average is 12 divided by 2, or 6. The calculator reports a median of 6 and a count of 4, as the first case records. No observation equals 6, which is the point of the example. A reader who expects the median to be an actual data point will be surprised, and the surprise is worth settling here, before it affects a report that quotes the median of a small sample.

The odd-length control

Add a fifth value, 6, to get 20, 1, 8, 4, 6. Sorted, the list is 1, 4, 6, 8, 20, and the middle entry is the third one, 6. The median is again 6, but this time it is a real observation, and the count is 5. The two lists share the median value for different reasons: one by averaging, one by position. This pair of cases shows that median alone does not tell you whether it was observed. If the distinction matters for the use of the result, report the count along with the median so readers know which rule applied.

Median compared with mean

The mean of 1, 4, 8, 20 is 33 divided by 4, which is 8.25. The median of 6 sits below it because the large value of 20 pulls the mean upward while the median ignores how large the extreme values are. If 20 were replaced with 200, the median would stay at 6 and the mean would jump to 53.25. That resistance to extreme values is why median incomes, house prices and waiting times are widely quoted instead of means. Neither number is better in general. They answer different questions, and for skewed data the two can differ by a large factor.

A larger even list

Try the six values 40, 3, 22, 9, 15, 7. Sorted, they read 3, 7, 9, 15, 22, 40. The middle pair is the third and fourth values, 9 and 15, and their average is 12. The sum of all six is 96, so the mean is 16, and the count is 6. Again the median of 12 is not in the list. For an even count of n values, the middle pair is at positions n/2 and n/2 plus 1. Locating those positions before averaging avoids the common error of taking the third and fifth values or of averaging the wrong neighbors.

Duplicates and ties near the middle

When the middle pair has equal values, the median is that value and it is observed. In 2, 5, 5, 9 the middle pair is 5 and 5, and the median is 5. Duplicates do not need special handling, because sorting places them next to each other. Ties at the edges of the list change nothing either. What does change the median is adding or removing a value near the middle. Adding one observation to an even list makes it odd and moves the median to a single entry, which can shift the summary noticeably for a small sample.

Other quantile conventions

Statisticians define quantiles in several ways, and software packages do not all agree on how to interpolate. For the median of an even list, nearly all methods agree on the average of the two middle values, but quartiles and percentiles can differ between conventions. This tool computes the median only, using that averaging rule. If a task needs an actual observed value, for example choosing a representative item from a list, the lower middle or upper middle value would be stated as a separate requirement. Naming the rule used keeps the number reproducible. Software defaults are worth checking too, since a function may return the lower middle value for even counts instead of the average, which would give 4 for the main list instead of 6.

Effect of one extreme value on each summary

To see how the two summaries react, replace 20 in the list 1, 4, 8, 20 with larger and larger numbers. At 20 the median is 6 and the mean is 8.25. At 100 the median is still 6 and the mean rises to 28.25. At 1,000 the median remains 6 while the mean is 253.25. The median depends only on the two middle values, so changing the largest entry cannot move it unless the entry drops below the middle pair. Changing a middle value, for example raising 8 to 10, moves the median to 7. That sensitivity to the middle and insensitivity to the ends is the defining behavior of the statistic, and it explains why the median suits data with occasional outliers.

Practical uses for knowing the rule

In quality control, a median of an even number of repeated measurements is a common robust summary, and the averaged value will not match any single reading. In education, a median score for a class of 30 is the average of the 15th and 16th ordered scores. In sports timing, the median of four split times will usually be a value no one clocked. Reporting that the median is an average of two middle values helps readers who might otherwise search the data for a record that matches it. When the data are integers, such as counts of items, an averaged median can end in a half, as in a median of 6.5 from the middle pair 6 and 7. A footnote that explains the half prevents someone from correcting a correct value to a whole number.

Reproduce the checks

Even-length list

Open the Average calculator and enter:

Values
20,1,8,4

Expected output:

Median

6

Number of values

4

Sorting produces the middle pair four and eight.

Odd-length list

Open the Average calculator and enter:

Values
20,1,8,4,6

Expected output:

Median

6

Number of values

5

Here six is the actual middle observation.

References and implementation scope

The examples describe the behavior of the linked Computandum tools. A successful local check does not establish that another application accepts the same format or applies the same limits.

Sources

Related tasks