1.3.4 · D2Basic Data & Probability

Visual walkthrough — Mean, median, mode — calculation for raw and grouped data

2,022 words9 min readBack to topic

The parent note handed you this formula and told you it works:

But where does it come from? Why that fraction? Why multiply by the class width? This page builds the whole thing from a single picture — a staircase of counts — with nothing assumed. By the end, every symbol will be a spot you can point to on that staircase.

We stay with the parent's table (Example 5) the whole way so you can check every number against something you already trust. See the parent note for that table.


Step 1 — What "grouped data" even hides

WHAT: Lay out the five class intervals as boxes on a number line, with heights equal to their frequencies.

WHY: Before we can find a "middle", we must see the shape we are searching through.

PICTURE: Look at the bars below. Each bar sits over its interval (width ) and its height is the frequency — how many students landed in that interval.

Figure — Mean, median, mode — calculation for raw and grouped data

Step 2 — Stack the counts into a staircase (cumulative frequency)

WHAT: Instead of asking "how many are in this box?", ask "how many are at or below this boundary?" Walking left to right, we add each box's height to a running total. That running total is the cumulative frequency, written .

WHY: The median is defined by a position in the sorted order — "the middle one". Cumulative frequency is exactly a machine that converts a boundary into a position: it says "by the time you reach here, you have counted this many students." That is the tool that turns a shape into a rank, which is why we reach for it and not, say, the plain heights.

PICTURE: The bars from Step 1 now stack into a rising staircase. Each step's height is the total counted so far. It only ever goes up — it can never fall, because you cannot un-count students.

Figure — Mean, median, mode — calculation for raw and grouped data

Notice the staircase reaches its top, , at the far right. Good — that is a full count check.


Step 3 — Mark the halfway height

WHAT: Draw a horizontal line across the staircase at height . Here .

WHY: The median splits the counted students into two equal halves — half below, half above. On the staircase, "count so far " is precisely the height where the lower half ends. Where that horizontal line crosses the staircase is where the median student lives.

PICTURE: The amber line at height 20 slices horizontally. Follow it rightward until it hits a riser (a vertical jump) of the staircase.

Figure — Mean, median, mode — calculation for raw and grouped data

The line hits the riser that climbs from up to . That riser belongs to the box 40–60. This is the median class — the box that swallows the halfway point.


Step 4 — Zoom into the median class and name its parts

WHAT: Blow up just the one riser that the amber line crossed. Give its pieces names.

WHY: Everything left of this box is settled — those students are all safely below the median. The only unknown is how far into this one box we must walk to gather the remaining students up to 20. So we isolate it.

PICTURE: The single median box, magnified. Its lower boundary is labelled , its height (the jump) is labelled , and its width along the number line is .

Figure — Mean, median, mode — calculation for raw and grouped data

We already stood at height when we entered this box at . We want to reach height . So we still need to climb:

Each of these 7 lives somewhere between score 40 and score 60 — but the grouping hid exactly where.


Step 5 — The fair guess: spread the box evenly (linear interpolation)

WHAT: Assume the students inside the box are spread evenly from 40 to 60. Under that assumption, climbing the count is the same as walking the width in the same proportion.

WHY this tool — proportion, not something fancier: We have no information favouring any spot inside the box over another. The most honest, unbiased assumption is uniform spacing. Uniform spacing means "fraction of the students" equals "fraction of the width" — a straight-line (linear) relationship. That is why the riser, when we look closely, is treated as a straight ramp rather than a vertical wall.

PICTURE: Replace the vertical riser with a slanted straight ramp from the box's bottom-left corner to its top-right corner . The amber line at height 20 now crosses the ramp at one clean point. Drop straight down from that crossing to read the median off the number line.

Figure — Mean, median, mode — calculation for raw and grouped data

Set up the proportion. We climbed students out of the box's total :

By the even-spread assumption, that is the same fraction of the width we must walk:

Start at the box's left edge and walk that distance in:

There it is — the parent's formula, every piece now a spot on the picture.


Step 6 — Edge and degenerate cases (never get stranded)


The one-picture summary

Everything above collapses into a single diagram: the staircase, the amber half-line, the ramp inside the median class, and the drop-down to the answer.

Figure — Mean, median, mode — calculation for raw and grouped data
Recall Feynman retelling — say it back in plain words

We were handed boxes of students, not their scores. First we stacked the box counts into a rising staircase, where each step's height says "this many students counted so far." We drew a line across at the halfway height , and the box whose riser that line crossed is the median class — that box hides the middle student. Since we could not know exactly where inside the box each student sat, we made the fairest possible guess: spread them evenly, turning the vertical riser into a slanted ramp. Then it is just a proportion — we needed to climb students out of the in the box, so we walk that same fraction of the box's width , starting from its left edge . Add them up and you land on the median. Every symbol in is a spot you can point to on that one picture.

Recall Quick self-test

On the staircase, what does the height of the amber line represent? ::: The halfway count — where the lower half of the data ends. Why do we turn the riser into a slanted ramp? ::: Because we assume the students in the class are spread evenly, so count grows linearly with position — that even-spread assumption is the straight line. If , what is the median? ::: Exactly , the lower boundary of the median class.


Related vault pages: Cumulative Frequency Graphs (the staircase, formalised) · Frequency Distributions (where the boxes come from) · Measures of Dispersion and Box Plots (what to do once you have the median) · Skewness (how mean, median and mode drift apart) · Weighted Mean.