cs-140 — The Sliced Anomaly
| Field | Value |
|---|---|
| id | cs-140 |
| difficulty | Intermediate |
| topics | aggregation, bias, data |
| lecture | lecture-27 |
| estimated time | 5-minute attempt + 10-minute discussion |
| prerequisites | lecture-09 (aggregation), lecture-25 (thinking with data) |
| objective | see how one aggregate flips when the group weights change, then decide what to report |
| solution | held by the instructor; discussed after the attempt |
Problem
Two campus bookshops, each with a coffee bar. Per-shop revenue per customer:
Books Coffee
North 30 2
South 16 1
Per-bookshop customer mix:
Books-bar Coffee-bar customers
North 20 100
South 100 20
The city newspaper writes: "South's bookshops run a more lucrative business — look at their blended revenue per customer." Compute the blended figure and you will see their point. Then:
Your deliverables:
- The blended revenue per customer for each bookshop.
- The per-bar comparison (books bar vs books bar, coffee bar vs coffee bar) that the blend hides.
- In two sentences: what happened, and why "who buys what" can flip an aggregate while every sub-group ranking stays the same.
- The fair two-line comparison you would give the newspaper instead.
If the problem is ambiguous anywhere, state the assumption you are making and carry on — a stated assumption is part of a good answer.
Examples
- Input: the per-bar revenue table and the customer-mix table
- Output: North blended 6.67 vs South blended 13.50 — yet North leads within both bars — plus the explanation and the fair comparison
Solve for the worked instance first. Then ask what would change if one number, name, or condition were replaced by something stranger.
What to notice
- A blend is a weighted average, and the weights are the group sizes — change who buys what and the blend moves even when no bar gets better.
- The paradox is only visible when you slice: aggregate, then break apart by the same grouping that drives the weights.
- The remedy is not "never aggregate" — it is reporting the aggregate with the weights, or a like-for-like slice.
Discussion starter
After the solution is revealed, the class spends five minutes on this prompt: "The newspaper insists on one number per city. What single number would you defend, computed how — and what must you print next to it?"
Constraints and assumptions
- Difficulty: Intermediate (aggregate reasoning with a twist).
- Topics: aggregation, bias, data.
- Revenue figures are per customer per bar; mixes are exact customer counts.
- Classroom-scale inputs unless the problem says otherwise.
- Time-box: about five minutes for a first attempt; partial answers with clear reasoning are worth more than silent struggling.
- Optional stretch (not required): describe an alternative approach and say when it beats the obvious one.
Hints and extension
- First nudge: compute each shop's total revenue and total customers before averaging anything.
- If stuck after three minutes, write the input/output line you expect and trace the smallest example by hand.
- After the reveal, attempt the extension below before the next lecture.
- Extension challenge: design a standardised mix (fixed weights) and recompute both cities under it — what claim does the standardisation let you make, and what does it hide?