Median in a line-up
About this app
People line up by height; the middle one draws a chalk line on the wall: the median. Odd n (position (n + 1)/2) and even n (mean of the two middle values), position versus value, and why the line stays put when the tallest grows while the mean moves.
With explain mode: an AI tutor walks you through the app, points out what matters in the scene and answers your questions.
The idea
The median is the value in the middle of the sorted raw data. For odd n it sits at position (n + 1)/2, so with 19 values at position 10: nine values below, nine above. For even n there are two middle values at positions n/2 and n/2 + 1, and the median is their mean. Keep position and value apart: the median is not the number 10 but the value found at position 10. Unlike the mean, the median is robust against outliers.
What the app shows
In front of a concrete wall with a centimetre scale, 19 people first stand in random order, with position numbers under their feet. After sorting they stand from short to tall like the Daltons. The middle person draws a chalk line at their height, and the line runs across the wall to the scale: 175 cm. With 20 people both members of the middle pair draw their line (175 cm and 183 cm), and the median lies dashed between them at 179 cm. A second line shows the mean.
What you can try
Choose n between 5 and 25, add or remove people and switch between shuffled and sorted. Drag individual heads up or down to change heights. Above all, let the tallest person grow, up to 320 cm: with 19 people the mean rises from 177.4 cm to 182.7 cm (at 300 cm), while the chalk line stays at 175 cm. The values panel shows position, median, mean and the calculation with numbers.
Frequently asked questions
- How do you find the median for an even number of values?
- Sort the values and take the mean of the two middle values at positions n/2 and n/2 + 1. With 20 values these are the 10th and 11th; for 175 cm and 183 cm the median is 179 cm.
- Is the median the middle position?
- No. The position (n + 1)/2 only tells you where to look. The median is the value found there in the sorted list, for example 175 cm, not 10.
- Why is the median robust against outliers?
- It only depends on which value stands in the middle of the sorted list. If the largest value grows even larger, the order in the middle does not change. The mean includes every value and shifts.
- What can I change in the app?
- The number of people (5 to 25), whether the line is sorted, each person’s height by dragging the head, and the height of the tallest person up to 320 cm. Chalk line, mean line and the two halves can be shown separately.
Subject: Statistics
More from Statistics
- Anscombe's quartet
- Bias-variance / overfitting
- Law of large numbers
- Histogram workshop
- Hypothesis test & p-value
- Confidence interval
- Measures of location & spread
- Measures of location & spread 2.0
A VisuApp by heyprof: interactive, free in your browser, no sign-up. What is a VisuApp? · All apps