Explain like I'm five · Law/Policy

What are Divide-and-Conquer, Greedy, and Dynamic Programming?

Divide-and-conquer, greedy, and dynamic programming, told as a story about the student council allocating twenty clubs' festival budget with three different methods. (These are algorithm design techniques, not law or policy — but even the council solves a hard decision with a clear procedure.)

how do we decide twenty clubs' budget requests all at once?too many clubs to compare all at once

Deciding the festival budget for twenty clubs at once is too complicated.Too many clubs to compare all at once.

we submitted first, so we got everythingwe were last, so we got nothinghanding out money by submission order alone misses a fairer split

Granting budgets purely by submission order is unfair.Handing out money by submission order alone misses a fairer split.

three ways to solve a big problem: divide-and-conquer, greedy, dynamic programmingTHREE METHODSdivide and conquer — split by grade, decide, combinegreedy — fund the most urgent request firstdynamic programming — save each answer and reuse itall three: handle the big problem in small pieceseven the student council should follow a clear procedure for a hard decision, just like an algorithm

There are three ways to solve a big problem: divide-and-conquer, greedy, and dynamic programming.Even the student council should follow a clear procedure for a hard decision, just like an algorithm.

Divide & conquer — split, then combinesolves small pieces, then merges them
Greedy — pick the best right nowalways picks what looks best this instant
Dynamic programming — remember the answernever solves the same subproblem twice
In common — handle a big problem in small stepsbreaks the big problem into smaller problems or steps
DIVIDE AND CONQUERsplit into 1st/2nd/3rd-grade shareseach grade's rep decides separatelythen all shares are combinedGREEDY / DPgreedy: fund the most urgent club firstDP: never redoes a grade combo it solvedgreedy: fast, but may miss the overall bestthe right method depends on whether the problem splits cleanly or repeats the same subproblems

Applied to the festival budget, the three differ in how they split, what they pick first, and how often they recalculate.The right method depends on whether the problem splits cleanly or repeats the same subproblems.

funded the most urgent one right awaybut across the whole budget, a better split existedgreedy is fast — but it doesn't always guarantee the overall best

Greedy is fast because it skips comparing every combination, but it isn't always the best.Greedy is fast — but it doesn't always guarantee the overall best.

In one breath

Divide-and-conquer splits a problem and combines the results, greedy always picks the best choice right now, and dynamic programming remembers an already-solved answer instead of re-solving it.

Divide-and-conquer splits a problem into independent smaller subproblems, solves each, and combines the results (e.g., merge sort). Greedy repeatedly picks whatever choice looks best at each step without considering the whole picture — fast, but not always globally optimal (though for some problems, like minimum spanning trees, it is). Dynamic programming stores the result of a subproblem once computed (memoization) and reuses it, avoiding redundant recomputation — suited to problems with optimal substructure and overlapping subproblems. All three handle a big problem in smaller pieces, but they differ in how they treat those pieces.

When grown-ups say it

Divide and Conquer
Splitting a problem, solving the pieces, then combining. Sorting gives a concrete example. → different ways to line cars up by size
Greedy Algorithm
Picking whatever looks best right now, every time. Greedy is provably optimal for connecting every point at the lowest cost. → piping every branch together for the least cost
Dynamic Programming
Remembering an already-solved answer and reusing it. Never solves the same subproblem twice.
Memoization
The technique of storing a result once it's computed. A common way to implement dynamic programming.
Optimal Substructure
The property that optimal sub-answers combine into the optimal whole. Dynamic programming only works when this property holds.
Overlapping Subproblems
The same small problem showing up again and again. Memoization only pays off when the same subproblem repeats.
Backtracking
Backing up and trying another path when stuck. Yet another strategy for tackling a big problem.
Time Complexity (Big-O)
The ruler that measures how much slower an algorithm gets as a problem grows. All three methods are compared using this same ruler. → how much slower as cars pile up
Next story
The Automatic Checker That Cross-Checks Every Rule Board at Once →
Want another term as a picture book? Request →