What is the Median? Definition & Mathematical Principles
In mathematical statistics, the median is the positional value that divides an ordered numerical dataset into two equal halves. Exactly 50% of the data points lie below or equal to the median, and 50% lie above or equal to it. Unlike the arithmetic mean, which depends on every value's magnitude, the median depends strictly on relative ordinal rank.
The concept of the median was introduced into modern mathematics by Antoine Augustin Cournot in 1843 and popularized by Francis Galton in 1881 as a robust alternative to the mean. Mathematically, the sample median is the unique point that minimizes the aggregate sum of absolute deviations: minimizing the expression Σ |xᵢ − c| across all observations. This property makes the median the standard metric in robust statistics, non-parametric analysis, and econometric policy evaluation.
Interactive Standard Normal Distribution & Empirical Rule Visualizer
Dynamic bell curve showing probability density, empirical 68-95-99.7% intervals, and cumulative percentile rank.
Mathematical Derivation and Calculation Rules
To compute the median, first sort your raw dataset in non-decreasing order: x₁ ≤ x₂ ≤ x₃ ≤ ... ≤ xₙ. The calculation then branches based on sample size parity:
1. Odd Sample Size (n is Odd)
When n is odd, a single unique observation occupies the exact center of the dataset. Its index position is (n + 1) ÷ 2:
Worked Example: Consider the 7 test scores [64, 88, 72, 95, 81, 79, 90]. First sort in ascending order: [64, 72, 79, 81, 88, 90, 95]. The central index is (7 + 1) ÷ 2 = 4th element:
2. Even Sample Size (n is Even)
When n is even, the dataset splits into two equal halves without a single central integer. The median is computed as the arithmetic mean of the two central adjacent numbers:
Worked Example: Given 8 hourly wage observations [$15, $22, $18, $40, $19, $25, $17, $30], sort in order: [$15, $17, $18, $19, $22, $25, $30, $40]. The 4th element is $19 and 5th element is $22:
The Five-Number Summary and Quartile Analysis
The median serves as the cornerstone of exploratory data analysis (EDA) and John Tukey's celebrated five-number summary:
The distance between the third and first quartiles defines the Interquartile Range (IQR = Q3 − Q1). Under Tukey's statistical outlier rule, any observation falling below Q1 − 1.5 × IQR or above Q3 + 1.5 × IQR is formally flagged as a potential outlier. This robust framework ensures that extreme anomalies do not compromise the integrity of statistical modeling.
Median vs. Mean: When to Use Which Metric
The fundamental decision of whether to report the mean or median hinges on data symmetry, distribution tails, and outlier susceptibility:
Practical Real-World Applications
Because of its mathematical resistance to skewness, the median is indispensable across multiple industries:
- National Income & Wage Statistics: Census bureaus report median household income because extreme billionaire outliers render the arithmetic mean misleading.
- Real Estate Market Valuations: Housing economists benchmark median home sale prices to isolate neighborhood trends from luxury estates, often paired with our Average Calculator.
- Biomedical Survival Analysis: Clinical trials track median survival time (the duration at which exactly 50% of patients remain alive), paired with our Standard Deviation Calculator.
- Software Latency & Cloud SLA: Web services track p50 (median latency), p95, and p99 response times to evaluate server performance under heavy user loads.
- Educational Testing & Grading Curves: Grade distributions frequently benchmark median scores to establish fair academic standards across diverse student cohorts.
L¹ Norm Minimization, Robust Statistics & Order Statistics
Mathematically, the median is the value m that minimizes the sum of absolute deviations: Σ |xᵢ − m|, making it the optimal center estimator under the L¹ norm in robust statistical theory. Unlike the arithmetic mean, which shifts indefinitely when a single data point moves toward infinity, the median exhibits the maximum possible asymptotic breakdown point of 50%, requiring more than half of all data points to become corrupted before the median can be pushed arbitrarily far. In parametric order statistics, the median represents the middle order statistic x_((n+1)/2), serving as the foundational anchor for non-parametric hypothesis tests such as the Wilcoxon signed-rank test and Mann-Whitney U test across non-normal continuous data.
Frequently asked questions
What is the median in statistics?
The median is the physical middle value in a dataset when all observations are arranged in ascending numerical order. Exactly 50% of the observations fall below the median, and 50% fall above it. Unlike the arithmetic mean, the median is highly resistant to extreme outliers and skewed tails.
How do you calculate the median when sample size n is odd?
First sort the dataset in ascending order. Then identify the value occupying the exact middle index at position (n + 1) ÷ 2. For instance, in a 7-element sorted dataset, the 4th element is the median.
How do you calculate the median when sample size n is even?
Sort the data in ascending order. Since there is no single middle element, locate the two central adjacent numbers at positions n ÷ 2 and (n ÷ 2) + 1, then calculate their arithmetic mean: Median = (x_(n/2) + x_((n/2)+1)) ÷ 2.
Why is median preferred over mean for income and housing prices?
Income and real estate distributions exhibit severe positive (right) skewness due to a small number of ultra-wealthy individuals or multi-million-dollar mansions. The arithmetic mean gets pulled upward dramatically, whereas the median remains completely stable and represents typical reality.
What are quartiles and how do they relate to the median?
Quartiles divide an ordered dataset into four equal segments. The First Quartile (Q1) marks the 25th percentile, the Second Quartile (Q2) is the median itself (50th percentile), and the Third Quartile (Q3) marks the 75th percentile.
What is the Interquartile Range (IQR)?
The Interquartile Range is the difference between the third and first quartiles: IQR = Q3 − Q1. It measures the spread of the central 50% of data points and forms the mathematical basis for Tukey's outlier detection rule (values beyond 1.5 × IQR).
Can the median equal the mean?
Yes. In any perfectly symmetric distribution, such as a Gaussian normal bell curve or a uniform distribution, the median, mean, and mode coincide at the exact center of the distribution.
How is the median calculated for grouped frequency data?
For grouped continuous data, locate the median class containing the n/2 cumulative frequency, then apply linear interpolation: Median = L + [((n/2 − CF) ÷ f) × w], where L is the lower class boundary, CF is previous cumulative frequency, f is frequency, and w is class width.