Five pirates have 100 gold pieces and a strict order of seniority. The most senior proposes a split. Everyone votes, the proposer included. If half or more agree, it stands. Otherwise he goes overboard and the next most senior proposes to those who are left, and so on.
Every pirate is perfectly rational. In order of priority he wants to live, then to have more gold, and only then, when the first two make no difference, to see the proposer drown. A pirate who gets exactly the same gold either way votes no. One who is offered strictly more votes yes.
What does the senior propose?
Number the pirates from the most senior down, and write for the gold, in whole coins. Here . The rules are the film's, and the proof needs every one of them.
This is the film's first route, and it fails for a reason that can be counted. To know how pirate will vote you need to know what he gets if the proposal fails, which is the answer to the game with one pirate fewer, which needs the game with one fewer again. So you must solve every smaller game to judge one proposal.
The splits to weigh grow fast. A split of coins among pirates is a way of placing dividers among slots, so there are
of them: 101 for two pirates, 5151 for three, 176,851 for four and 4,598,126 for five. Reasoning forwards means testing each against votes that nobody has worked out yet.
Work from the smallest game up. Each step assumes the answer to the one before, and that is the whole proof, so it is worth seeing both the cases and the pattern.
One pirate takes everything: (100).
Two pirates. The junior would get all 100 if the senior drowned, so he votes no to anything less. But half of two is one, and the senior's own vote is one. So the senior keeps everything: (100, 0). With a strict majority this split would fall, which is why the rule says half or more. The script asserts exactly that.
Three. The bottom pirate gets nothing in the two-pirate game. One coin is more than nothing, so one coin buys his vote, and with the senior's own that is 2 of 3: (99, 0, 1).
Four. Half of four is 2, so one vote besides his own. In the three-pirate game the one who gets nothing is the middle pirate, who is now the third of four. One coin to him: (99, 0, 1, 0).
Five. He needs 3 votes, so two besides his own. In the four-pirate game the pirates who get nothing are the second and the fourth, now the third and the fifth. A coin each: (98, 0, 1, 0, 1).
Call the claim . We prove it for by induction on , which is backward induction written out.
Base. For the one pirate keeps , and the formula gives .
Step. Let and suppose . Then the split in the -game is: the proposer keeps , odd positions from 3 get one coin, the rest get nothing. If the senior's proposal fails he drowns and everyone moves up one place, so pirate of the -game is pirate of the -game. Because every proposer in the smaller games survives (the claim says each of them has a passing proposal), what pirate falls back on is a number of coins, and by rule 4 his vote costs one coin more than that. Price each pirate:
The senior needs yes votes besides his own, and that equals (check even and odd separately). So the number of votes he must buy is exactly the number of pirates priced at 1.
Now the optimum. Any proposal that stands gives at least the price to each of other pirates, so it costs at least the sum of the cheapest prices, which is coins. Paying exactly those prices and nothing else reaches that bound, and the bound is at most because . So the proposer keeps , which is the most any passing proposal leaves him. It is the only one: every pirate outside the cheap set costs at least 2, so swapping one in costs at least a coin more, and extra coins to anyone only come out of his share. Hence .
One coin. Coins come whole and a tie votes no. To win a pirate whose fallback is you must offer , and offering more buys nothing extra, since a vote is a vote. So a pirate who would get nothing costs one coin.
Those pirates. A pirate's price is what he would get in the -game, plus one. The ones who get nothing there are the cheapest, and the cheapest are the ones the senior buys. In the -game the paid pirates are the odd positions from 3, so those who got nothing are the even positions, and moving up one place makes them odd again. That is why the bought pirates alternate, and why each step flips who is paid.
Nobody is fooled. The pirate offered one coin is not being tricked, because the alternative is truly nothing. The senior keeps most of the gold because everyone below him can count what happens next.
The proof used twice: to keep the cost within , and to keep pirate 2 from falling back on nothing. For that is , and the script checks the closed form against the induction up to there. This is the exact range of the simple pattern under these rules, and past it three things change.
The last point is an argument and not something the script runs; the script stops at that count. Beyond it a new effect appears: a pirate who knows he would be the doomed proposer next will vote yes to anything, to save himself, and the votes no longer cost coins. This is the many-pirates case analysed by Ian Stewart in Scientific American in 1999. The page does not reproduce it, and none of it is checked here.
Each row is what the split gives the pirate, what he gets if it fails (his place in the four-pirate game), and how he votes. The senior's own fallback is drowning.
| Pirate | Offered | If it fails | Vote | Why |
|---|---|---|---|---|
| 1 | 98 | drowns | yes | his own proposal; if it fails he drowns |
| 2 | 0 | 99 | no | 0 is no better than 99 |
| 3 | 1 | 0 | yes | one coin beats 0 |
| 4 | 0 | 1 | no | 0 is no better than 1 |
| 5 | 1 | 0 | yes | one coin beats 0 |
Pirates 3, 5 are the ones paid. Could he keep more? He needs two votes besides his own and every vote costs at least a coin, so he keeps at most 98. Buying pirate 2 instead is no help: his price is one more than the 99 he would otherwise get. Brute force over every split agrees that (98, 0, 1, 0, 1) is the best proposal that stands, and the only one that gives the senior 98.
The script scripts/pirates.mjs asserts the following before it writes any number on this page.
What is not checked: the proof itself, which the script tests but does not replace; any other than 100; the argument for beyond the count of votes; and anything past it.
He needs votes, so two besides his own. In the five-pirate game (98, 0, 1, 0, 1) the pirates who get nothing are the second and the fourth, who are now the third and the fifth. He pays each one coin and keeps 100 minus 2. The script's closed form agrees.
He needs 3 yes votes, so two besides his own. Each costs at least a coin, so he pays at least 2, and keeps at most 98. Brute force over the 4,598,126 splits finds no better passing one.
If the senior drowns, pirate 2 becomes the proposer of the four-pirate game and gets 99. To beat that you would have to offer him one more, the whole 100, which leaves the senior nothing and still leaves him a vote short. A pirate who would get nothing costs one coin.
At , which is 201 pirates. At 202 the senior can still live but must choose whom to pay, and at 203 the votes he must buy, 101, outnumber his coins.