This is a deep-dive companion to Mean, median, mode — calculation for raw and grouped data . The parent note built the formulas. Here we do the harder job: we throw every kind of dataset at those formulas and watch what happens — including the awkward cases most notes skip (all-equal data, outliers, no mode, open classes, even n , ties for the modal class).
Read every example twice. First guess the answer (that's what Forecast is for), then check yourself.
Definition Two counting symbols:
n vs N , and three uses of x
Before we start, pin down the letters so they never confuse you:
==n == (lowercase) = the number of individual raw observations (Examples 1–4, 8, 9).
==N == (uppercase) = ∑ f = the total frequency in a grouped table (Examples 5–7, 10, 11). It counts the same people, but reached by adding up the class frequencies.
The letter ==x == wears three hats: in raw data x i is an actual observation ; in grouped data x is a class mark (midpoint) , a stand-in value, not a real reading; in the word problem (Ex 8) x is the unknown we solve for . We will always say which hat is on.
A "measures of centre" problem is really a small number of case classes . If you have seen one worked example from each row below, nothing on an exam can surprise you.
Cell
Case class
What is tricky about it
Example
A
Raw mean, plain
nothing — the warm-up
Ex 1
B
Raw median, even n
no single middle → average two
Ex 2
C
Raw data with an outlier
mean lies, median resists
Ex 3
D
Degenerate raw data (all equal / all unique)
mode misbehaves
Ex 4
E
Grouped mean
the "assume everyone sits at the midpoint" trick
Ex 5
F
Grouped median, first class
interpolation with C F = 0
Ex 6
G
Grouped mode, edge class
modal class at the boundary
Ex 7
H
Real-world word problem (missing value from a known mean)
run the mean formula backwards
Ex 8
I
Exam-style twist : change one value, watch all three move
robustness comparison
Ex 9
J
Grouped mode tie (two classes share highest f )
two modal classes → two modes
Ex 10
K
Open-ended class (no lower/upper bound)
must impute a boundary
Ex 11
Each example below is tagged with its cell letter. Together they hit every cell.
Two words we will lean on:
Definition Outlier and robust
An outlier is a value that sits far away from the crowd (a bump on the number line, standing alone). A statistic is robust if outliers barely move it. The spread and shape of the data decide how far apart the three averages drift.
The picture above is the whole page in one image: mean is the balance point (where the seesaw of values tips level), median splits the count in half , mode is the tallest stack . Keep glancing back at it.
Worked example Example 1 (Cell A): five reaction times
A student measures reaction time (milliseconds) five times: { 210 , 250 , 230 , 240 , 220 } . Find the mean.
Forecast: the values sit between 210 and 250, so guess the answer lands somewhere near the middle, roughly 230.
Step 1. Add every value: 210 + 250 + 230 + 240 + 220 = 1150 .
Why this step? The mean x ˉ shares the total equally, so we first need the total.
Step 2. Count the observations: n = 5 (lowercase n — these are raw readings).
Why this step? We share the total among exactly this many measurements.
Step 3. Divide: x ˉ = 5 1150 = 230 ms.
Why this step? x ˉ = n ∑ x i — the total spread evenly. Here each x i is a real reading .
Verify: if all five values were 230, the total would be 5 × 230 = 1150 — exactly our sum. The mean is the value that would give the same total if everyone were identical. ✓ Units: milliseconds, as required.
Worked example Example 2 (Cell B): six house prices
Prices (in lakhs): { 45 , 52 , 60 , 48 , 70 , 55 } . Find the median.
Forecast: six numbers means no single middle — we will have to average the two central ones.
Step 1. Sort ascending: 45 , 48 , 52 , 55 , 60 , 70 .
Why this step? The median is defined by position after sorting ; an unsorted list has no meaningful "middle".
Step 2. n = 6 is even, so the two middle positions are 2 n = 3 and 2 n + 1 = 4 .
Why this step? With six items, three sit below the gap and three above it — the middle falls between positions 3 and 4.
Step 3. Values at positions 3 and 4 are 52 and 55 . Average them: 2 52 + 55 = 53.5 .
Why this step? There is no actual data point in the gap, so we take the midpoint of the two flanking values.
Verify: count how many values lie below 53.5 (three: 45, 48, 52) and above (three: 55, 60, 70). Equal split by count — the defining property of the median. ✓
Worked example Example 3 (Cell C): salaries with one boss
Monthly salaries (thousands): { 20 , 22 , 21 , 23 , 200 } . Compare mean and median.
Forecast: four workers earn about 20–23, one earns 200. Guess the mean gets dragged way up , but the median stays near 21.
Step 1. Mean: 5 20 + 22 + 21 + 23 + 200 = 5 286 = 57.2 .
Why this step? The mean uses every value's size , so the lone 200 pulls the balance point far right.
Step 2. Median: sort → 20 , 21 , 22 , 23 , 200 ; n = 5 odd, middle position 2 5 + 1 = 3 → value 22 .
Why this step? The median only cares about position , not how extreme the top value is.
Step 3. Compare: mean = 57.2 but median = 22 . The mean describes nobody in this dataset.
Why this step? This is exactly why we keep the median — it is robust to that outlier.
Verify: replace the 200 with an even bigger 2000. Median is still 22 (position unchanged), but mean explodes to 5 2086 = 417.2 . The median refused to move — proof of robustness. ✓
Worked example Example 4 (Cell D): three degenerate lists
Find the mode of each: (a) { 5 , 5 , 5 , 5 } , (b) { 3 , 4 , 5 , 6 } , (c) { 2 , 2 , 4 , 4 , 7 } .
Forecast: guess (a) has one obvious mode, (b) has no mode, and (c) is a tie.
Step 1 — list (a). Every value is 5, appearing 4 times. Mode = 5 .
Why this step? The mode is the most frequent value; here only one value exists, so it wins by default.
Step 2 — list (b). Each of 3,4,5,6 appears exactly once. No mode.
Why this step? When no value repeats, no value is "most frequent" — the mode is undefined, not zero.
Step 3 — list (c). 2 appears twice, 4 appears twice, 7 once. Modes = 2 and 4 (bimodal).
Why this step? Two values tie for the top count, so both are modes — this is a legitimate case, not an error.
Verify: frequency counts must sum to n . (c): 2 + 2 + 1 = 5 = n . ✓ The tie is real.
Common mistake "No mode" is not "mode = 0"
If nothing repeats, write no mode . Zero is a value ; "no mode" is the absence of one. Never report 0 unless 0 is actually the most frequent number.
Worked example Example 5 (Cell E): commuting times
Time (min)
Frequency f
0–10
4
10–20
9
20–30
12
30–40
6
40–50
3
Find the mean.
Forecast: most people cluster in 20–30, so guess the mean lands around the low-to-mid 20s.
Step 1. Compute each class mark x = 2 lower + upper : gives 5 , 15 , 25 , 35 , 45 .
Why this step? We lost the individual values when the data was grouped, so we pretend everyone in a class sits at its midpoint — the least-biased single guess. (Here x is a stand-in , not a real reading.)
Step 2. Multiply f ⋅ x per row: 4 ( 5 ) = 20 , 9 ( 15 ) = 135 , 12 ( 25 ) = 300 , 6 ( 35 ) = 210 , 3 ( 45 ) = 135 .
Why this step? f people at value x contribute f ⋅ x to the total, just like Example 1's sum.
Step 3. Totals: N = ∑ f = 4 + 9 + 12 + 6 + 3 = 34 (uppercase N = total frequency); ∑ f x = 20 + 135 + 300 + 210 + 135 = 800 .
Why this step? The mean is a single division — total contribution over total headcount — so before we can divide we must first collapse the whole table into exactly two numbers: the grand total ∑ f x and the grand headcount N . Computing them now means Step 4 is one clean division.
Step 4. Mean = N ∑ f x = 34 800 ≈ 23.53 min.
Why this step? Same formula as raw mean — total divided by count — just with the midpoint stand-ins and with N playing the role n played for raw data.
Verify: the mean must lie inside the data range [ 0 , 50 ] and near the heaviest class (20–30). 23.53 sits right there. ✓ See Frequency Distributions for where these tables come from.
Worked example Example 6 (Cell F): the tricky
C F = 0 case
Use the commuting table from Example 5. Find the median.
Forecast: N = 34 , so the median is around the 17th person — that's inside a class, so expect a non-round decimal.
Step 1. Build cumulative frequency (==C F ==, running total):
Class
f
C F
0–10
4
4
10–20
9
13
20–30
12
25 ←
30–40
6
31
40–50
3
34
Why this step? The cumulative frequency tells us how many people we have passed by the top of each class.
Step 2. 2 N = 2 34 = 17 . Find the first class whose C F ≥ 17 : that is 20–30 (C F jumps from 13 to 25). This is the median class.
Why this step? The 17th person lives wherever the running count first reaches 17.
Step 3. Read off the four ingredients the interpolation formula needs: L = 20 (lower boundary of the median class), C F = 13 (cumulative frequency of the class before it), f = 12 (frequency of the median class), and h = 10 — the class width (upper limit minus lower limit, 30 − 20 = 10 ).
Why this step? The median formula L + ( f N /2 − C F ) h has exactly four dials. We must lift each one off the table before interpolating, because getting any one wrong (especially C F , the before -class total) silently corrupts the answer. Naming them separately forces us to check each.
Step 4. Interpolate:
Median = L + ( f 2 N − C F ) h = 20 + ( 12 17 − 13 ) 10 = 20 + 12 4 × 10 ≈ 23.33 min .
Why this step? We must travel 17 − 13 = 4 more people into a class that holds 12 people over a width h = 10 , so we walk 12 4 of the way across.
Verify: the answer must lie inside the median class [ 20 , 30 ] — and 23.33 does. It also sits just below the grouped mean 23.53 , which fits a gently right-leaning shape (see Skewness ). ✓
The figure shows the interpolation as a straight-line ramp climbing across the median class. We enter at C F = 13 , we need to reach 17 , and the crossing point projects down to ≈ 23.33 on the time axis.
Worked example Example 7 (Cell G): heaviest class touches the boundary
Score
f
0–10
15
10–20
9
20–30
4
Find the mode.
Forecast: the tallest bar is the first one, so there is no class before it — guess we must set the "before" frequency to 0.
Step 1. Modal class = 0–10 (highest f = 15 ).
Why this step? The mode lives inside the tallest stack.
Step 2. Identify: L = 0 , f 1 = 15 , f 0 = 0 (no class exists before 0–10), f 2 = 9 , and the class width h = 10 .
Why this step? When the modal class is the first one, treat the absent neighbour's frequency as 0 — there simply is no data to the left.
Step 3. Apply the formula:
Mode = L + ( 2 f 1 − f 0 − f 2 f 1 − f 0 ) h = 0 + ( 30 − 0 − 9 15 − 0 ) 10 = 21 15 × 10 ≈ 7.14.
Why this step? The peak leans toward whichever neighbour is taller; with nothing on the left, it leans into the class from the right neighbour's pull.
Verify: the mode must fall inside the modal class [ 0 , 10 ] — 7.14 does. Since f 0 = 0 < f 2 = 9 , the peak should sit past the midpoint 5, and 7.14 > 5 . ✓
Common mistake Don't skip a "missing" neighbour
A common slip on edge classes is to leave f 0 or f 2 blank and divide by the wrong number. The missing neighbour is 0 , not "ignore that term". Plug the 0 in explicitly.
Worked example Example 8 (Cell H): find the missing mark
Six students scored { 72 , 85 , 90 , 68 , 77 , x } . Their mean is exactly 80 . Find x .
Forecast: the known five average a bit below 80, so guess the missing sixth must be above 80 to pull the mean up.
Step 1. Write the mean equation: 6 72 + 85 + 90 + 68 + 77 + x = 80 . (Here x is the unknown score we solve for — not a class mark.)
Why this step? We know the answer to x ˉ ; we treat the formula as an equation to solve for the unknown , not to compute.
Step 2. The five known values sum to 72 + 85 + 90 + 68 + 77 = 392 . So 6 392 + x = 80 .
Why this step? Collapsing the knowns leaves a single unknown.
Step 3. Multiply both sides by 6: 392 + x = 480 . Then x = 480 − 392 = 88 .
Why this step? Undoing the division and subtraction isolates x — this is the mean formula solved in reverse.
Verify: put x = 88 back: 6 392 + 88 = 6 480 = 80 . ✓ And 88 > 80 , matching our forecast. See Weighted Mean for the version where counts differ per group.
Worked example Example 9 (Cell I): robustness face-off
Start with { 4 , 6 , 6 , 8 , 10 } . Compute mean, median, mode. Then change the last value from 10 to 100 and recompute all three. Which one barely moves?
Forecast: guess the mean jumps a lot, the median barely nudges, and the mode doesn't move at all.
Step 1 — original. Mean = 5 4 + 6 + 6 + 8 + 10 = 5 34 = 6.8 . Sorted middle (position 3) = 6 → median = 6 . Value 6 appears twice → mode = 6 .
Why this step? We need a baseline to measure the change against.
Step 2 — change 10 → 100 . New set { 4 , 6 , 6 , 8 , 100 } . Mean = 5 124 = 24.8 . Sorted: 4 , 6 , 6 , 8 , 100 ; position 3 = 6 → median = 6 . Mode still = 6 .
Why this step? Only the largest value changed, so only statistics that depend on size should react.
Step 3 — compare shifts. Mean moved 6.8 → 24.8 (a jump of 18). Median 6 → 6 (no move). Mode 6 → 6 (no move).
Why this step? This isolates exactly which measure is robust : the median and mode ignored the outlier entirely.
Verify: recount for the new set. Frequencies: 4→1, 6→2, 8→1, 100→1, mode still the value with count 2 (which is 6). ✓ The mean's leap of 18 while median stayed put is the whole point of keeping all three. Compare with the tail-length ideas in Box Plots .
Worked example Example 10 (Cell J): two peaks of equal height
Class
f
0–10
6
10–20
11
20–30
7
30–40
11
40–50
5
Find the mode.
Forecast: two classes both reach f = 11 — the tallest height. Guess the data is bimodal , so we must compute a mode for each peak.
Step 1. Scan the frequencies for the maximum: it is 11 , achieved by 10–20 and 30–40 .
Why this step? The mode lives in the tallest stack; when two stacks tie for tallest, there are two modal classes — exactly the grouped version of the bimodal case from Example 4.
Step 2 — first peak (10–20). Neighbours are f 0 = 6 (0–10) and f 2 = 7 (20–30), with L = 10 , f 1 = 11 , class width h = 10 :
Mode 1 = 10 + ( 2 ( 11 ) − 6 − 7 11 − 6 ) 10 = 10 + 9 5 × 10 ≈ 15.56.
Why this step? Each peak is interpolated independently using its own two neighbours — the formula has no idea another peak exists.
Step 3 — second peak (30–40). Neighbours are f 0 = 7 (20–30) and f 2 = 5 (40–50), with L = 30 , f 1 = 11 , class width h = 10 :
Mode 2 = 30 + ( 2 ( 11 ) − 7 − 5 11 − 7 ) 10 = 30 + 10 4 × 10 = 34.
Why this step? Same formula, second peak's own neighbours — giving the second mode.
Modes ≈ 15.56 and 34 (bimodal).
Verify: each mode must sit inside its own modal class : 15.56 ∈ [ 10 , 20 ] ✓ and 34 ∈ [ 30 , 40 ] ✓. Peak 1 leans right of its centre 15 (since right neighbour 7 > left 6), and 15.56 > 15 ✓. Peak 2 leans left of its centre 35 (since left neighbour 7 > right 5), and 34 < 35 ✓.
Worked example Example 11 (Cell K): a class with no upper limit
Charity donations (in ₹) recorded as:
Donation
f
0–100
8
100–200
14
200–300
10
300 and above
4
Find the grouped mean .
Forecast: the last class "300 and above" has no upper bound , so we cannot read off its midpoint directly — guess we must first invent a sensible upper limit.
Step 1. Give the open class a boundary using the common class width . Every closed class here spans 100 (that shared span is the class width h = 100 ), so we take the open class to be 300 –400 .
Why this step? An open-ended class has no midpoint until it has two ends; the least-biased fix is to assume it keeps the same class width h = 100 as its neighbours.
Step 2. Now every class is closed, so compute class marks x : 50 , 150 , 250 , 350 .
Why this step? With the imputed upper limit 400 , the last midpoint is 2 300 + 400 = 350 , and the earlier midpoint logic from Example 5 applies unchanged.
Step 3. Multiply f ⋅ x : 8 ( 50 ) = 400 , 14 ( 150 ) = 2100 , 10 ( 250 ) = 2500 , 4 ( 350 ) = 1400 .
Why this step? Same "everyone sits at the midpoint" contribution rule.
Step 4. Totals: N = 8 + 14 + 10 + 4 = 36 ; ∑ f x = 400 + 2100 + 2500 + 1400 = 6400 . Mean = 36 6400 ≈ 177.78 ₹.
Why this step? Total contribution over total headcount — the standard grouped mean, exactly as in Example 5.
Verify: the mean must lie inside the (imputed) range [ 0 , 400 ] and near the heaviest class 100 –200 ; 177.78 sits right there. ✓
Caution: the answer depends on the guessed boundary — if we had assumed 300 –500 instead, the last midpoint becomes 400 and the mean rises. Always state your imputation.
Common mistake Never leave an open class as "midpoint = 300"
"300 and above" is not a value; its midpoint is undefined. Assign it the class width of its neighbours first, then find the midpoint. State the assumption you made.
Recall Even
n raw median — what do you do?
Sort, then average the two middle values at positions 2 n and 2 n + 1 .
Recall What is the difference between
n and N ?
n counts individual raw observations; N = ∑ f is the total frequency of a grouped table. They count the same people by different routes.
Recall Which average is most robust to an outlier?
The median (and often the mode); the mean is pulled toward the outlier.
Recall In the grouped-median formula, what is
C F ?
The cumulative frequency of the class before the median class.
Recall What does
h mean in the grouped formulas?
The class width = upper limit minus lower limit of a class.
Recall Modal class is the first class — what is
f 0 ?
Zero, because there is no class before it.
Recall All values distinct — what is the mode?
No mode (not zero).
Recall Two grouped classes tie for the highest frequency — how many modes?
Two: apply the mode formula separately to each modal class (the data is bimodal).
Recall A class reads "300 and above" — what must you do first?
Impute an upper limit (usually keep the common class width), then take the midpoint.
Mnemonic Which centre to trust
M ean is M oved by monsters (outliers); Median is the middle that minds only counts; Mode is the most repeated. When the data is skewed, quote the median.