A classroom, an airline and a video game turn out to be one problem. Learn to see the shape and you stop meeting new problems — you start recognising old ones.
Problems that sound completely unrelated are usually the same problem underneath — and once you can see the shape, you already know how to solve every problem that has it.
This is the skill that separates someone who has memorised twenty solutions from someone who can handle the twenty-first. The twenty-first is never new. It is one of the twenty in a different outfit.
Spotting the shape is called pattern recognition. Writing the shape down with the specifics stripped out is called abstraction. Those two words sound academic and they describe something you already do constantly — you have never been taught how to open this particular door, you learned doors.
Read the three below. They have nothing to do with each other — a classroom, an airline, a video game. Click a step on the left and watch the matching line light up in all three at once.
Then press the button underneath and watch the three become one.
What you just made is a shape with the specifics removed. It does not care about students, flights or scores — it cares about items and what “beats” means. Swap in a different meaning of beats and the same four steps find the shortest word, the earliest date, the closest star.
You will meet this exact shape in your course, probably in week four or five, and it will be called something like finding the maximum. People who did not do this level memorise it as a new fact. You already know it, and you know why the first line has to be there.
Step 1 says take the first one as the best so far. Why not start with zero, or with nothing? Try it: find the coldest temperature in a list where every temperature is below freezing. If you start from zero, your answer is zero — a temperature that is not even in the list. Starting from a real item is not a detail. It is the whole correctness of the thing.
Make up everyday “find the…” problems. The busiest day. The nearest coffee shop. The longest song. Whatever comes to mind.
For each one, say the four steps out loud with that problem’s words in them. Then try hard to invent one where the shape does not fit.
Person B has the better job, because the interesting ones are the near-misses. “Find the two tallest.” “Find the most common word.” Those need a changed shape, not this one — and noticing that a familiar shape almost fits, but not quite, is exactly the judgment this course is trying to build.
Before solving, ask what this reminds you of. It usually reminds you of something.
Replace students and flights with “items” and the shape appears on its own.
“Almost the same shape” is where the real thinking — and most of the marks — live.
Not recall — these are the shapes an exam actually uses. Every answer below was produced by compiling and running the code, so if you disagree with one, the compiler is the one to believe.
Have a real go before revealing. Being wrong here is worth more than being right in three weeks.
The tallest student, the cheapest flight and the highest score. How many different algorithms do you need?
Why must “find the smallest” start from a real item rather than from zero?
← back to all 12 levels · stuck on anything? ask peter.