How Do Patterns Turn Many Problems Into One?

Author: codeplu.com
Last Updated: 29 Jul 2026
Est. Duration: 10 min
Skill Level: Beginner

Root Concept

When something repeats, you are solving the same problem many times — and the move that saves the most work is capturing that repetition as one rule you write once and reuse.

CodePLU Goal

Upgrading Human Mental Models

Learn how to think in Workflows

Concept Playground
CodePLU logo

Concept Development By codeplu.com

Three kinds of repetition, each replaced by a single reusable rule

Why Is Spotting Repetition So Valuable?

Imagine copying out a shop's price list by hand every morning because the prices are the same every day. You would stop after two mornings and photocopy it instead. That instinct — noticing you are doing identical work repeatedly and replacing it with something reusable — is the habit this concept is about, and it is the single biggest source of leverage in problem solving.

The move has two halves. First you notice the repetition, which is harder than it sounds because repeated work often looks like a series of separate tasks. Then you capture what is common as a rule, keeping the part that varies as something you feed in. 'Quantity times price, then add them all up' is a rule; it handles a basket of three items or three hundred without changing.

This is why programmers can build things that seem impossibly large. They are not writing every case; they are finding the rule that covers all the cases. In the playground above you will build repetition down into the rule that replaces it, and each rule down to the pile of work it removes.

How Do You Find and Use a Pattern?

1

How do you notice repetition in the first place?

Watch for the third time. The first time you do something it is new, the second time feels like coincidence, and by the third you are in a pattern — that is the moment to stop and look. Two other signals are just as reliable: a sense of boredom while doing careful work, and copying something and changing one small part of it. Both mean the same thing, that the shape is fixed and only a detail varies. Beginners tend to power through repetition because each individual instance is quick, and that is exactly how an afternoon disappears into work a rule would have done in seconds.

2

How do you turn repetition into a rule?

Separate what stays the same from what changes. Take the receipt: what stays the same is 'multiply the quantity by the price and add it to a running total', and what changes is which item you are on. The fixed part becomes the rule, and the varying part becomes what you hand to the rule each time. This separation is the whole trick, and it has a name — generalising. A good check is to test your rule on a case you have not used yet. If it handles the fortieth item as comfortably as the first, you have a rule rather than a description of one example.

3

Why does a rule beat doing the work by hand?

Three reasons, and only one is speed. A rule applies to cases you have not met yet, so tomorrow's basket needs no new work. A rule is fixable in one place, so when the tax changes you edit once instead of hunting through forty repetitions and missing two. And a rule makes mistakes visible, because forty hand-worked lines can hide one wrong sum indefinitely while a wrong rule is wrong everywhere, obviously and immediately. That last point is counter-intuitive and important: a rule concentrates the risk, which makes errors easier to catch rather than harder.

4

When does a pattern mislead you?

When it fits what you have seen and not what is really going on. Two numbers, 2 and 4, could continue 6, 8 by adding two — or 8, 16 by doubling. The pattern you spot first is a guess, not a discovery, and confirming it needs more evidence or a reason. This is where real mistakes happen: sales rose three months running so someone declares a trend, when the cause was a seasonal event that is about to end. So the discipline is to test a pattern against cases you did not use to find it, and to ask whether there is a reason for it. A pattern with a mechanism behind it is far more trustworthy than one that merely fits.

5

Can a rule be too clever?

Yes, and this is worth knowing before you get carried away. A rule that handles every imaginable variation can end up harder to understand than the repetition it replaced — and one nobody dares to change is worse than five simple things anybody can edit. There is also a real risk in generalising from two cases: you invent flexibility for situations that never arrive while making today's simple job complicated. Sensible practice is to wait for the third occurrence, capture exactly the repetition in front of you, and extend the rule only when reality asks for it.

Real World Example

Thirty report cards, written by hand, until she noticed the shape underneath.

How Did One Teacher Reclaim Her Sunday Evenings?

A teacher spends every Sunday writing end-of-term comments for thirty pupils. Watch what happens when she stops treating them as thirty separate jobs.

1

The repetition hiding in plain sight

Each comment feels bespoke, so she writes thirty from scratch. Reading last term's back, though, the shape is identical every time: how the pupil is doing overall, their strongest area, one thing to work on, and an encouraging close. Thirty jobs, one shape.

2

Separating what stays from what changes

The four-part structure never changes. What changes is the name, the subject strengths, and the target. That separation is the whole move — the fixed part becomes a rule she writes once, and the varying part is what she supplies for each pupil.

3

The rule in practice

She writes a four-sentence frame with clear slots, plus a short list of phrasings for common strengths and targets. Filling it in takes two minutes per pupil instead of fifteen, and — unexpectedly — the comments improve, because the frame stops her forgetting the encouraging close when she is tired.

4

Where the pattern nearly misled her

Tempted to go further, she considers picking phrases automatically from test scores. She stops, because a quiet pupil who improved enormously would be described identically to a coasting high scorer. The pattern fitted the numbers and not the reality — so the judgement stays with her.

5

What she actually gained

Her Sundays, and something more durable: a rule she can fix in one place. When the school changes its reporting requirements she edits the frame once instead of remembering thirty times. That is exactly what programmers do all day, applied to paper.

FAQs

Final Words

The most powerful move in problem solving is noticing that you are doing the same work repeatedly, then separating what stays the same from what changes and writing the fixed part once. In the playground you did this three times — an endless number list became 'add 2 each time', a forty-line receipt became one sum, and five alarms became one weekday setting.

Two cautions keep the habit honest. A pattern you have only seen twice is a guess, so test it against cases you did not use to find it and look for a reason behind it. And resist over-cleverness: a rule nobody dares change is worse than a few simple things anyone can edit.