Brain Teasers
Screwy Pirates
Five rational pirates vote on how to split 100 gold coins, and you work out the split by backward induction from a one-pirate crew up.
How it works
The story animates the rules. Five pirates, ranked senior to junior, loot a chest of 100 gold coins. The most senior pirate proposes a split. All five vote, and at least 50% must vote yes - with five pirates, that means three votes, and the proposer votes too. If the proposal clears the bar, it stands and no one is harmed. If it fails, the senior pirate is fed to the sharks and the process repeats with the next most senior pirate proposing, with the 50% bar recalculated for the smaller crew each round.
Three assumptions close the story: all pirates are perfectly rational; they want to stay alive first and maximise gold second; and, being bloodthirsty, they prefer fewer pirates on the boat when outcomes are otherwise equal. Then the question: how will the gold be divided?
From there you move to the answer builder at /brain-teasers/screwy-pirates/answer. You pick a crew size from 1 to 6, fill in how many coins each pirate keeps, write out your reasoning in a text box, and write an equation for the pattern you found. A full narrated breakdown lives at /brain-teasers/screwy-pirates/breakdown.
How scoring works
The answer builder grades three things deterministically. First, coins: each pirate's amount is checked exactly against the computed game-theory solution, and you see a count like 'Coins: 4 / 5 correct' with the right value shown next to each miss.
Second, your written explanation is scanned for four key ideas by keyword matching: that pirates are rational, that 50% of the vote is needed to survive, that the proposer buys just enough votes as cheaply as possible, and that the reasoning works through what happens if the proposal is rejected. Third, your equation is checked for four pieces: it starts from the full 100 coins, rounds down with a floor, uses (n - 1), and divides by 2. The checks are transparent pattern matches, not an AI judgment - clear wording that names the concepts scores them.
Solve the one-pirate crew first, then climb
The proposal-and-vote process ends somewhere: if every proposal failed, eventually one pirate would be left, and he keeps all 100 coins by voting for himself. That endpoint is solid ground, and every larger crew is solved by standing on it. With two pirates the senior needs one of two votes - his own suffices - so he keeps 100 and offers the junior nothing.
With three pirates the proposer needs two of three votes. He asks who does badly in the two-pirate world he creates by dying: the most junior pirate, who would get 0. One coin beats zero for a rational pirate, so the proposer offers that pirate a single coin, keeps 99, and offers the middle pirate nothing. The pattern for every larger crew is the same question: who gets zero in the next round down, and how cheaply can I beat zero?
Buy the cheapest votes, and only as many as you need
At each crew size k the proposer needs ceil(k/2) votes including his own, so he must buy ceil(k/2) - 1. The cheapest voters are exactly the pirates who receive 0 coins in the (k-1)-pirate outcome - a single coin makes each of them strictly better off than voting the proposal down. Everyone who gets something in the next round down is too expensive to bother with, so they get nothing.
This is why the answer alternates. The zero-getters flip each round, so the bribed set flips with them, and the proposer's keep falls by one coin only every second crew member added. The equation the builder is looking for captures it: keep(n) = 100 - floor((n - 1) / 2).
Say the tie-break assumptions out loud
The clean solution leans on the stated preference order: survival first, gold second, bloodthirst third. The bloodthirst rule is what makes a zero-coin offer insufficient - a pirate offered the same payoff either way prefers to see the proposer thrown overboard, so the proposer must strictly beat the alternative, which one coin does.
In an interview, naming that dependency is worth as much as the arithmetic. If the tie-break flipped, the bribes would change, and showing you know which assumption carries the weight is what separates recitation from understanding.
A worked example
Take the five-pirate crew in the builder. Work up from the base: 1 pirate takes 100. 2 pirates: senior keeps 100, junior gets 0 (the senior's own vote is 1 of 2, which meets 50%). 3 pirates: proposer needs one extra vote, buys the pirate who got 0 in the two-pirate world for 1 coin - split 99, 0, 1 from senior down.
4 pirates: proposer needs 2 of 4 votes, so one bribe. The zero-getter from the three-pirate outcome is the second pirate, who gets 1 coin; split 99, 0, 1, 0. 5 pirates: proposer needs 3 of 5 votes, so two bribes. The zero-getters from the four-pirate outcome are pirates 1 and 3, each bought for 1 coin.
So the five-pirate answer, senior down to junior, is 98, 0, 1, 0, 1. Enter those, and for the equation write keep(n) = 100 - floor((n - 1) / 2): the proposer keeps 98 of the 100 coins, and the crew that could throw him to the sharks approves it 3 votes to 2.
Common mistakes
• Splitting the gold evenly or 'fairly' - the pirates are rational maximisers, and fairness never enters the payoffs.
• Starting from five pirates and reasoning forward. The problem only opens from the one-pirate endpoint backward.
• Bribing with large amounts. A pirate compares your offer to what he gets in the next round down - one coin above zero is enough, and anything more is wasted.
• Bribing the wrong pirates. The votes for sale belong to whoever gets nothing if you die, not to the senior pirates near you.
• Forgetting the proposer votes for himself, which shifts how many votes he actually has to buy at each crew size.
Why interviews test this
This is a canonical quant interview question about backward induction with voting. The interviewer wants the base case stated, the recursion run cleanly, and the buy-the-cheapest-votes logic named - and the standard follow-ups (more pirates, a supermajority rule, different tie-breaks) all test whether you built the machine or memorised 98, 0, 1, 0, 1.