Visual walkthrough — Cumulative frequency — ogive, median from graph
We build only on three ideas you already have: a frequency table (a list of "how many landed in each bin"), the median (the value with half the data below it), and straight-line interpolation (walking along a straight ramp).
Step 1 — Turn "how many IN" into "how many BELOW"
WHAT. We start with a plain frequency table: each class (a range of values, e.g. –) has a frequency — the count of observations that fell inside it. We turn it into a running total.
WHY. The median is defined by "how many lie below a value," not "how many are in a bin." So we need a quantity that answers the below-question directly. That quantity is the cumulative frequency — add up every bin from the left as you go.
PICTURE. Watch the bars fill a rising staircase. Each new bar's height is stacked on top of everything before it.

- — the count in bin number .
- The sum runs up to — "everything at or before class ."
- — the total sitting below the upper edge of class .
The very last value is , the total number of observations — our sanity check.
Step 2 — Anchor each total to the RIGHT point
WHAT. We place each cumulative total as a dot on a graph. The height of the dot is . The horizontal position is the upper boundary of class .
WHY the upper boundary and not the middle? counts everything below the upper edge of the class. So the only honest x-position for that height is the upper edge itself: the dot then reads "this many values () lie below this x." Put it at the midpoint and you'd be claiming the count is complete halfway through the bin — a lie that shifts the whole curve left.
PICTURE. The red dot sits at the right wall of the bin, at the height of the running total.

Step 3 — Join the dots: the ogive is born
WHAT. Connect the dots with a rising curve. Start it on the floor: at the lower boundary of the first class, nothing is below yet, so . It climbs to at the far right.
WHY join them? Between the plotted upper boundaries we have no data — so we make the honest simplest assumption: inside each class the observations are spread uniformly. A uniform spread means the count grows at a constant rate across the bin, which is a straight line. Joining the dots segment-by-segment draws exactly that.
PICTURE. The ogive — a staircase of straight ramps that only ever goes up.

Step 4 — Ask the median question ON the graph
WHAT. The median is the value with half the data below it. "Half the data" is a height on our y-axis: . So we mark , slide across to the curve, and drop straight down.
WHY and not ? The rule is for counting a discrete ordered list of items. Here the ogive treats the data as a smooth, continuous flow — we want the height that splits the total rise into two equal halves, and half of the rise is exactly .
PICTURE. A red horizontal line at height , meeting the curve, then a red vertical line dropping to the median.

Step 5 — Find WHICH ramp we land on (the median class)
WHAT. The horizontal line hits one particular ramp. That ramp's bin is the median class: the class inside which the running total climbs through .
WHY care? Because the interpolation happens on that one ramp. We identify it by finding where jumps from below to at-or-above .
PICTURE. Zoom to a single ramp. Its bottom-left corner is at ; its top-right at .

Naming the corners (these are the four letters in the final formula):
- — lower boundary of the median class (x where this ramp starts).
- — cumulative frequency of the class before, i.e. the ramp's starting height.
- — frequency of the median class, so the ramp rises by across the bin.
- — the class width, so the ramp runs horizontally.
Step 6 — The ramp is a straight line: read off its slope
WHAT. On this single ramp the count grows uniformly, so it's a straight line. Rise over run gives its slope.
WHY slope? The slope tells us "how many extra counts per unit of x." Once we know how many extra counts we still need to reach , the slope converts that count back into a distance in x.
PICTURE. The right triangle under the ramp: vertical leg (rise), horizontal leg (run).

- — total extra count as we cross the whole bin.
- — total x-distance across the bin.
- — counts added per unit of x. This is the exchange rate between "count" and "distance."
Step 7 — Convert the missing count into a distance
WHAT. We start the ramp at height and must climb to . The extra count needed is . Divide by the slope (counts-per-x) to get the x-distance we must walk right.
WHY divide? Slope is counts per unit x. To turn a count into an x-distance, undo the rate — divide by it. ("Have 7 extra counts, gain counts per step walk steps.")
PICTURE. The small red sub-triangle: vertical leg , horizontal leg — the same slope as the big triangle.

- — the counts still missing when we enter the bin.
- dividing by — trades counts for x-distance using the ramp's rate.
- the fraction — "what fraction of the way through the bin," a number between and .
- — scale that fraction up to real x-units.
Then the median is the starting x plus that walk:
Step 8 — Two edge cases you must never trip on
WHAT. Two boundary situations that look confusing but the same rule handles cleanly.
Case A — lands exactly on a corner. The missing count turns out to equal (or ). Then the fraction is (or ) and the median sits exactly on a class boundary. No special handling — the formula returns the corner.
Case B — the twin-ogive crossing. Draw the more-than ogive too (a running total counted from the right, so it falls as x increases). The less-than curve reads "count below x"; the more-than reads "count above x." They are equal only where both equal — their crossing. Drop a perpendicular there: same median, no arithmetic.
PICTURE. Both curves; the red dot marks their intersection at height .

Worked check — the derivation in action
The one-picture summary
Everything above is one triangle sitting on one ramp: enter at , need more counts, trade them for distance via slope , walk right, arrive at the median.

Recall Feynman: retell the whole walkthrough
A frequency table says how many kids fall in each height band. I stack the bands into a running total — "how many kids shorter than this line" — and that total only ever grows: draw it and you get the ogive. The middle kid is the one with half the kids below, so half of is ; I go up the height axis to and walk across to the curve. I land on one ramp — the median class, from up to . That ramp is straight because I assumed the kids inside are evenly spread, so it rises by over a run of : slope counts per step. Entering the ramp I'm short by counts, so I divide by the slope to turn that shortfall into a sideways walk , and the median is . If I draw the from-the-right curve too, where they cross "below" equals "above" equals — same answer without doing any sums.
Recall Self-test
Why plot at the upper boundary? ::: CF counts everything below the upper edge, so that's its honest x. What does slope mean physically? ::: extra counts added per unit of x inside the median class. How do you turn a missing count into a distance? ::: divide the missing count by the slope . What forces the twin-ogive crossing to be the median? ::: below = above there, so both equal .