● An interactive explainer · three simulations · ~15 minutes
In 1817, a retired London stockbroker named David Ricardo answered that question with a result so slippery that, a century and a half later, the economist Paul Samuelson nominated it as the only proposition in all of social science that is both true and non-trivial. It is called the law of comparative advantage, and most people who think they know it are actually thinking of something else. This page will not lecture you into believing it. It will let you discover it — by running a tiny economy yourself.
Before we begin — commit yourself
Two people are shipwrecked on an island: Ada, a wiry ex-competitive-swimmer with quick hands, and Bo, who is, frankly, having a rough week. There are two jobs: spearing fish in the lagoon and gathering coconuts from the grove.
Here is everything you need to know. In one hour, Ada can catch 3 fish or gather 6 coconuts. In one hour, Bo can catch 2 fish or gather 1 coconut. Ada is better at both jobs — 50% faster at fishing, six times faster at gathering.
Your answer is saved. We'll come back to it at the end — after you've run the island yourself.
Simulation 01 · The island economy
Each castaway has 8 working hours a day. Your job: divide each person's day between fishing and gathering. To be fed and content, the island needs 16 fish and 24 coconuts per day, combined.
One thing to notice before you touch anything: Bo cannot feed even himself alone. His half of the target — 8 fish and 12 coconuts — would take him 16 hours a day. If this island is going to work, it's not because Bo pulls his weight. It's something stranger than that.
| Producer | Fish/day | Coconuts/day |
|---|---|---|
| Ada | – | – |
| Bo | – | – |
| Island total | – | – |
Sit with what just happened. The winning plan puts Bo — the slower fisher — in charge of all the fishing, and pulls Ada, the best fisher on the island, out of the water entirely. The "obvious" plan (best fisher fishes) starves the island of coconuts. The plan that feels backwards produces the target with 24 coconuts to spare. Why on earth does that work?
The mechanism
The trap in your head is a single word: better. You compared Ada's speed to Bo's speed. But the island doesn't pay for speed. Every hour Ada spends in the lagoon is an hour the grove goes unharvested — the true price of anything is what you give up to get it. Economists call it opportunity cost, and it changes who "wins" each job. Flip the table below.
This is the entire secret. Measured in speed, Ada wins every column — that's called absolute advantage, and it turns out to be almost useless for deciding who should do what. Measured in cost, no one can win every column. Ada's fish are expensive precisely because her skill at picking coconuts is so great: sending her to the lagoon burns 6 coconuts an hour. Bo's fish are cheap for the mirror-image reason — his coconut hands are so bad that the grove barely misses him.
And notice: this isn't a lucky feature of our numbers. Opportunity costs are ratios, and ratios come in reciprocal pairs. If Ada's fish cost 2 coconuts, then her coconuts cost ½ fish — whoever is relatively better at one good is automatically relatively worse at the other. Except in one freak case you'll hunt for in Simulation 03, somebody always has the lower cost in each column. Everyone — however slow, however clumsy — is the cheapest producer of something.
The law of comparative advantage · Ricardo, 1817
Total output rises when each producer specializes in the good for which their opportunity cost is lowest — regardless of who is absolutely better at what. Both sides can then gain by trading.
That it is logically true need not be argued before a mathematician; that it is not trivial is attested by the thousands of important and intelligent men who have never been able to grasp the doctrine for themselves or to believe it after it was explained to them. Paul Samuelson, on comparative advantage, answering Stanislaw Ulam's challenge to name one social-science proposition both true and non-trivial
Simulation 02 · The terms of trade
Specialization creates the surplus; trade decides who eats it. Suppose the castaways specialize — Bo fishes all day (16 fish), Ada gathers all day (48 coconuts) — and Bo offers Ada 8 fish. The only question left is the price: how many coconuts per fish?
Drag the price. Watch when each side walks away — and notice where the walls are.
The walls of the deal-zone are not arbitrary — they are the two opportunity costs. Below ½ coconut per fish, Bo does better going it alone (his own fishing hour only costs him half a coconut). Above 2, Ada does better catching fish herself. Anywhere strictly between the two costs, both sides end up with more than they could produce solo. Trade isn't charity, and it isn't exploitation — it's the space between two people's prices.
One more thing worth stealing from this chart: the closer the price sits to your own opportunity cost, the smaller your gain. Bo profits most when fish are dear; Ada profits most when fish are cheap. The general version of that is one of the least-appreciated facts in economics: you gain the most from trading with people who are most unlike you. A partner whose costs match yours has nothing to offer — the surplus lives in the gap.
Simulation 03 · The sandbox
Maybe the island was rigged. Fine — build your own. Set all four production rates to anything you like, and the machine below will hunt for a free lunch: a reshuffle of hours (starting from everyone splitting their day 50/50) that leaves fish output unchanged and coconut output higher. Your challenge: find rates where no free lunch exists.
Rates run ½ to 12. The baseline for comparison is each person spending 4 hours on each good.
There is exactly one way to kill the free lunch, and you may have found it with the Twins preset: make the two producers' opportunity costs exactly equal. Not similar — equal to the last decimal. Twins with identical ratios have nothing to trade, because trade feeds on difference, not on skill. Tip any rate by a hair and the lunch reappears. That is what economists mean when they say comparative advantage almost always exists: being worse at everything can't kill it, being better at everything can't kill it. Only being identical kills it — and nobody is identical.
The interference pattern
Here is the diagnosis for why comparative advantage refuses to stick: your head already contains a different, louder idea with a confusingly similar name. Business strategy is built on competitive advantage — Michael Porter's question of how a firm beats its rivals. It is a fine idea. It is also almost the exact opposite of Ricardo's, and it acts like a magnet placed next to a compass.
Every time you hear "comparative advantage" and reach for "the thing I'm better at than other people," the magnet has captured the compass. The test is one question: better than whom? Competitive advantage compares you to your rivals. Comparative advantage compares your fish to your own coconuts. It is a fact about you and your alternatives, not about you and anyone else's talent.
You never need to be good — you need to be relatively less bad. Bo is a walking catastrophe at both jobs, and the island still gets richer the moment he specializes. His comparative advantage in fishing comes not from his fishing (bad) but from his gathering (worse). Weakness in one thing is the source of cheapness in the other.
Run Sim 03 with the "Ada better at everything" preset: the free lunch is still there, and Ada eats part of it. Her gain is real: every fish she buys from Bo for less than 2 coconuts frees an hour she'd otherwise burn in the lagoon at 6 coconuts an hour. The strong party doesn't trade out of pity. It trades because its own time is too valuable to waste on its second-best use.
That's competitive advantage wearing the wrong name badge — you'll see the phrase misused this way in business writing constantly. Your comparative advantage is discovered by comparing your own options: it is the activity whose opportunity cost — to you — is lowest. A mediocre programmer who is a truly terrible salesperson has a comparative advantage in programming, and no competitive advantage anywhere.
Sim 02 is the honest picture: between the two opportunity costs lies a whole window of prices where both sides beat their go-it-alone outcome — that's what makes it trade rather than theft. What the price does decide is how the surplus is split, and a party with no outside options may accept a price barely above their cost. The law says the pie gets bigger; it has never promised the slices are fair.
Ricardo's result is about the size of the total pie, and it is airtight. It is silent on three things people often want it to settle:
Distribution. "The nation gains" does not mean every person in the nation gains. When a country reshuffles toward its comparative advantage, the workers in the shrinking industry really do lose, sometimes for decades, unless the winners compensate them — which is a political choice, not an economic law.
Adjustment. The model reallocates hours instantly. Real people retrain slowly, and towns built around one industry don't glide to the new equilibrium.
Dynamics. Today's opportunity costs aren't destiny. Skills compound: what you practice, you get cheaper at. That's why "specialize where your cost is lowest today" is the beginning of career advice, not the end of it.
Field guide
A surgeon types faster than her scheduler — say 90 words a minute to his 45. Should she do her own admin? Her hour in the operating room is worth thousands; that's the opportunity cost of her typing hour, and it dwarfs his. She "loses" every typing race and should still never enter one. When you hear "don't spend $500-an-hour time on $20-an-hour work," that is comparative advantage — the island with dollar signs.
In On the Principles of Political Economy and Taxation (1817), Ricardo imagined England and Portugal trading cloth and wine — and he deliberately made Portugal better at producing both. Portugal needed 90 workers to make cloth England made with 100, and 80 workers to make wine England needed 120 for. Portugal's Ada was England's Bo, and Ricardo showed both countries end up with more cloth and more wine when Portugal makes wine, England makes cloth, and they trade. The scandal of the example — the whole point of the example — is that England, worse at everything, was still worth trading with.
The founder who still does the bookkeeping, the senior engineer who "just quickly" handles every deploy, the parent who redoes the child's chore because it's faster than watching it done badly — all are winning speed contests and losing ledger flips. The question is never "am I better at this?" (you probably are). It's "what am I not doing while I do this?"
The modern version of the trap question: if AI becomes better than you at everything, what could you possibly be for? Notice that this is exactly the Ada question, and Ricardo's answer doesn't care whether Ada is a person. As long as the better party's capacity is finite — compute, energy, attention, anything scarce — its hours have opportunity costs, and it comes out ahead leaving its relatively weakest work to others. Comparative advantage doesn't promise the wages will be wonderful (see the honest caveats above — the price within the window still matters enormously). But "worse at everything" has never once meant "worth nothing to anyone." That was Ricardo's scandal in 1817. It still is.
The final exam
Six questions. The last one you've seen before.
Take it with you
Do the thing that costs you the least to do — measured in what you give up, not in how good you are — and trade for the rest. So should everyone else. That's it. That's the law.