Foundations of Data Science slides 📂 Introduction · 1 of 10 38 min read

Mean, Median & Mode: The Three Faces of "Typical"

Three ways to answer one question — "what's the typical value?" The mean uses every number but bends toward outliers, the median holds the true middle, and the mode names the most frequent. This tutorial covers all three with formulas and worked examples, the outlier effect, how skewness reorders them, when to use each, ML imputation, and code — with animated diagrams.

📊

Mean, Median & Mode

Three ways to answer one question — "what's the typical value?" Each tells a different story, and picking the wrong one is how honest numbers turn misleading.
Mean Median Mode Skewness

Press Next → or use ← → arrow keys

Section 01

One Number To Stand For Many

"What's a typical salary here?"
A team of ten earns between ₹32,000 and ₹54,000 a month — a typical salary of about ₹42,000. Then the CEO, on ₹5,00,000, is added to the list. Suddenly the average leaps to ₹83,636 — a figure nobody on the team actually earns. The middle value, though, barely moves.

That's the whole point of central tendency: summarizing a pile of numbers with one representative value. But which value? Mean, median, and mode each answer differently — and the CEO shows why the choice matters.
💡
Measures Of Central Tendency

Mean, median, and mode are the three measures of central tendency — the foundation of descriptive statistics. Get comfortable with when each one lies and when it tells the truth, and you can read almost any dataset at a glance.

Section 01 · Overview

The Three Measures At A Glance

Mean
the balance point
Add everything up, divide by the count. Uses every value — but a single outlier can drag it far from typical.
↔️
Median
the middle value
Sort the data, take the middle one. Ignores how extreme the extremes are — rock-solid against outliers.
👑
Mode
the most frequent
The value that appears most often. The only one that works on categories — colours, sizes, brands.
🎯
Three Questions, Three Answers

Mean asks "where's the balance point?" Median asks "what's the middle?" Mode asks "what's most common?" They only agree when the data is perfectly symmetric — the moment it isn't, they diverge, and that divergence is itself information.

Section 02 · Mean

The Mean — Every Value Gets A Vote

Population mean
μ = (Σ xᵢ) / N
Sum of all values divided by the population size N.
Sample mean
x̄ = (Σ xᵢ) / n
Same idea over a sample of n observations — the everyday "average."
⚠️
One Outlier Can Break It

Because the mean sums every value, one extreme number moves it a lot. Adding a single ₹5,00,000 CEO to ten ordinary salaries lifted the mean from ₹42,000 to ₹83,636 — a ~99% jump driven by one row. That's why salary and income surveys almost always report the median instead.

When The Mean Shines

On symmetric, outlier-free data the mean is ideal — it uses all the information and feeds directly into later maths like variance and standard deviation. Think average temperature, or mean product weight on a production line.

Section 02 · Median

The Median — The True Middle

Odd count (n=7) → the single middle value 3 7 8 12 15 18 21 median = 12 Even count (n=6) → average the two middles 4 9 11 15 18 22 (11+15)/2 = 13
🏠
Why Property Prices Use It

Six homes sell for ₹45–55 lakh and one luxury villa for ₹420 lakh. The mean price is ₹109.6L — higher than every ordinary home. The median is ₹50L, exactly what a typical buyer sees. Sort, take the middle (or average the two middles for an even count), and outliers simply can't distort it.

Section 02 · Mode

The Mode — What Shows Up Most

shoe size purchased → 👑45 7 7.5 8 8.5 9 9.5 10
👟
The Only Measure For Categories

Across 238 customers, size 8.5 sold most (45 times) — so 8.5 is the mode, and the only statistic that tells the shop what to reorder. Mode also handles pure categories: in a colour survey where Blue wins 72 of 200 votes, you can't average colours — but the mode names the favourite. Data can be unimodal, bimodal, multimodal, or have no mode at all.

Section 03 · Robustness

Outliers — The Mean Moves, The Median Holds

median stays put ✓ outlier mean the mean is pulled toward the extreme value
⚖️
A Simple Rule Of Thumb

The mean is pulled toward extremes, the median resists them, and the mode ignores them entirely. A large gap between mean and median is a red flag — it almost always means outliers or skew, so investigate before you trust the average.

Section 04 · Skewness

How Skew Reorders The Three

Symmetric Mean = Median = Mode Right-skewed (+) Mode < Median < Mean Left-skewed (−) Mean < Median < Mode Mean Median Mode
🧭
The Mean Chases The Tail

The mode always sits at the peak, the mean is dragged toward the long tail, and the median lands between them. So the order of the three tells you the shape: mean to the right of the median means a right skew; to the left means a left skew.

Section 04 · Relationship

The Mean–Median Gap Measures Skew

Pearson's approximation
Mean − Mode ≈ 3 × (Mean − Median)
Holds for moderately skewed distributions — links all three measures.
The quick skew test
sign(Mean − Median)
Positive → right skew · ≈ 0 → symmetric · negative → left skew.
DistributionOrderingTailReport
SymmetricMean = Median = ModeNoneMean is fine
Right-skewed (+)Mode < Median < MeanLong right tailPrefer median
Left-skewed (−)Mean < Median < ModeLong left tailPrefer median
🔎
Report Both, Read The Gap

When unsure, report the mean and the median. The distance between them is a free skewness detector — income data (a few very high earners) is the classic right-skew, which is exactly why "median income" is the honest number.

Section 05 · Choosing

Which Measure, When?

MeasureData typeUse when…Everyday example
MeanContinuous numericSymmetric, no outliersAverage temperature; product weight
MedianContinuous numericSkewed or has outliersHousehold income; home prices
ModeAny (incl. categorical)Most popular / typical categoryFavourite colour; best-selling size
🤖
Filling Missing Values In ML

The same logic drives imputation: fill a roughly-normal numeric column with its mean, a skewed one with its median, and a categorical column with its mode. The mean also feeds variance and standard deviation — the median doesn't — so it stays essential for downstream statistics.

Section 06 · Worked Example

All Three On 20 Exam Scores

Twenty students score between 45 and 92. Their scores add up to 1,369, and 65 shows up three times. Compute all three measures:

Mean
1369 / 20 = 68.45
Sum ÷ count — the balance point of all 20 scores.
Median (even n=20)
(65 + 65) / 2 = 65.0
Average of the 10th and 11th sorted scores.
Mode
65 (appears 3×)
The single most frequent score in the class.
📈
Read The Story In The Numbers

Mean 68.45 sits above median 65 — the tell-tale sign of a mild right skew: a few high scorers are nudging the average up. The typical student is better described by the median (65), which also happens to be the mode. Three numbers, one coherent picture.

Section 07 · Code

Computing All Three In Python

import numpy as np
from scipy import stats

scores = [45, 65, 65, 65, 72, 88, 92, ...]

print(np.mean(scores))     # 68.45 — the average
print(np.median(scores))   # 65.0  — the middle value
print(stats.mode(scores))   # 65    — the most frequent

# the mean-median gap = a free skewness check
gap = np.mean(scores) - np.median(scores)
print("right-skew" if gap > 0 else "left-skew")  # right-skew
🐼
In pandas It's One Call Each

On a DataFrame column: df['score'].mean(), .median(), and .mode(). Even simpler, df.describe() hands you the mean, median (as the 50% quartile), min, max and spread in a single line — the fastest first look at any dataset.

Section 08 · Applications

Central Tendency In The Wild

💹
Finance
Mean daily return for expected performance; median to shrug off crash-day outliers.
🏭
Manufacturing
Mean product weight for quality control; mode for the most common defect type.
🏥
Healthcare
Median recovery time — a few very slow recoveries would skew the mean.
🎓
Education
Mean and median test scores together reveal whether a class is balanced or skewed.
🛒
E-commerce
Median order value for a typical basket; mode for the most-ordered product.
🏛️
Economics
Median income beats GDP-per-capita: a few billionaires pull the mean far above typical earnings.
Section 09 · Golden Rules

Six Rules That Keep You Honest

🏅 Mean, Median & Mode, Distilled
1Always visualize first. A quick histogram tells you if the data is symmetric or skewed before you pick a measure.
2Report mean AND median when unsure. The gap between them instantly reveals skew.
3Never take the mean of categories. "Average colour" is mathematically meaningless — use the mode.
4Prefer the median for money. Income, prices, and wealth are almost always right-skewed.
5Treat a big mean–median gap as a red flag. Investigate for outliers or data-entry errors.
6Match the imputation to the column — mean for normal, median for skewed, mode for categorical.
Wrap-Up

Three Measures, One Clear Picture

Σx/nMean · balance point
middleMedian · robust
max fMode · most frequent
gap= skewness signal
skewreorders all three
plotbefore you pick
🎯
The Through-Line

Mean, median, and mode each summarize "typical" differently — the mean uses every value but bends toward outliers, the median holds the true middle, and the mode names the most common. Their disagreement reveals the data's shape, so plot first, then choose the measure that tells the honest story.

📚
Where To Go Next

Central tendency is only half the story — pair it with spread (range, variance, standard deviation) and shape (skewness, kurtosis) for a full picture. Those measures of dispersion are the natural next step.

📊 End of tutorial · Press to review, or click Restart