A country that is worse at making everything still gains by trading — the least intuitive true theorem in economics. The trick is Ricardo's: specialize by opportunity cost, not by who is absolutely better. Down the center, data flows: two countries' labour costs go in, the engine finds who should make what, and the gains from trade come out. The blue team builds and defends it; the red team attacks the boundary of the model.
source David Ricardo, On the Principles of Political Economy and Taxation (1817), ch. 7 — archive.org/details/onprinciplesofpo0000rica. A model of economies, not financial or investment advice. Rendered, not quoted.
Each country has one factor, labour, and a cost in labour-hours per unit of each good. What matters is not the hours, but what a good costs in the other good:
opp. cost of wine = (labour per wine) ÷ (labour per cloth) = cloth foregone per wine. A country has a comparative advantage in the good whose opportunity cost is lower for it — even if it is slower at both.
For the current inputs, live opportunity costs (cloth per wine, wine per cloth):
| country | opp. wine (cloth/wine) | opp. cloth (wine/cloth) | C.A. in |
|---|
Ricardo, 1817: Portugal made both wine and cloth with less labour than England — yet both gained when Portugal made wine and England made cloth. Absolute skill was a red herring; opportunity cost decided.
Specialize by opportunity cost, not absolute skill; trade at a price between the two costs, and total output expands. The same clearing logic that runs one market runs across borders — the counterintuitive engine feeding the-supply-and-demand. Each sphere is the next one's premise.
The blue team's live check: on the canonical pair (NORTH ahead in both), re-derive who has the comparative advantage and re-compute the gain from specialization. If red switches the rule to absolute advantage, this badge is where it shows.
Two countries — NORTH and SOUTH — each with 12 labour-hours, and two goods, wine and cloth. The inputs are the labour-hours per unit: lower means faster. Set them below; the defaults make NORTH faster at both (absolute advantage in both) — the case where the theorem bites.
The engine reads these four numbers, derives opportunity costs, assigns specialization by the lower cost, and proves the joint gain.
Move any slider — the assignment and the gain are computed from opportunity cost on the spot, never looked up. These are exact model results, not a forecast.
What the machine proves: comparative advantage sits in the good of lower opportunity cost — regardless of absolute advantage; specialization by that rule strictly expands total output beyond autarky (+3 wine at fixed cloth, in the canonical case); a trade price between the two opportunity costs makes both better off; and the gains vanish only at the knife-edge of equal costs.
The blue team's witness (left) confirms this live; the red team (right) swaps the rule to absolute advantage and idles the poorer country.
Relax them and the clean result blurs: increasing costs stop specialization short of the corner; with many factors, Stolper–Samuelson says some workers lose even as the nation gains — the aggregate gain is real but its distribution is not automatic. "Everyone wins" is the part that is false.
"The country better at everything should make everything." Cut. That is the absolute-advantage fallacy the theorem exists to kill — assignment is by opportunity cost, so both specialize and both gain.
"Gains from trade come from exporting more than you import." Cut. Mercantilism. The gain is the extra output from specialization; imports are what you get for it.
"Comparative advantage means every person is better off." Kept, corrected. The total rises; individuals can lose without compensation. True as aggregate output, false as a promise.
The red team's move: assign each good to whoever is absolutely better at it. NORTH wins both, so SOUTH — worse at everything — is told to make nothing, and the gain evaporates. The blue witness (window 7) is watching.
Switch to absolute advantage and SOUTH idles; world output falls below autarky. The witness recomputes, finds no gain, and turns red. Nothing is faked; the attack is real and it is caught.