Took another one week hiatus from The Riddler, but am back to this one’s!

The Riddler is a weekly puzzle series from Oliver Roeder at FiveThirtyEight that usually involves some combination of math, logic and probability.

This weeks FiveThirtyEight Riddler, Can You Solve The Puzzle Of The Pirate Booty is:

Ten Perfectly Rational Pirate Logicians (PRPLs) find 10 (indivisible) gold pieces and wish to distribute the booty among themselves.

The pirates each have a unique rank, from the captain on down. The captain puts forth the first plan to divide up the gold, whereupon the pirates (including the captain) vote. If at least half the pirates vote for the plan, it is enacted, and the gold is distributed accordingly. If the plan gets fewer than half the votes, however, the captain is killed, the second-in-command is promoted, and the process starts over. (They’re mutinous, these PRPLs.)

Pirates always vote by the following rules, with the earliest rule taking precedence in a conflict:

Self-preservation: A pirate values his life above all else.Greed: A pirate seeks as much gold as possible.Bloodthirst: Failing a threat to his life or bounty, a pirate always votes to kill.Under this system,

how do the PRPLs divide up their gold?

Extra credit: Solve the generalized problem where there arePpirates andGgold pieces.

Unfortunately, I don’t have any gifs or R simulations this week. Instead I’ll be taking an iterative, logical approach.

We start with the case of 1 pirate.

Number of Pirates/Pirate Rank |
Rank A (Captain) |

1 Pirate |
10 Gold Pieces |

If there’s only 1 pirate, he gets all the gold. Now at two pirates:

Number of Pirates/Pirate Rank |
Rank A (Captain) |
Rank B |

1 Pirate |
10 Gold Pieces | |

2 Pirates |
10 Gold Pieces | 0 Gold Pieces |

At 2 pirates, Pirate A (the captain) still keeps 10 gold pieces. Pirate B, has no threat to his life (rule 1) & voting to mutiny against Pirate A moves him up to the 1 pirate scenario, which means he gets 10 gold pieces (rule 2, pirates seeks as much gold as possible). Consequently, Pirate B votes to mutiny, but since Pirate A does not vote to mutiny, the crew lacks the majority it needs for a mutiny.

In the case of 3 pirates:

Number of Pirates/Pirate Rank |
Rank A (Captain) |
Rank B |
Rank C |

1 Pirate |
10 Gold Pieces | ||

2 Pirates |
10 Gold Pieces | 0 Gold Pieces | |

3 Pirates |
9 Gold Pieces | 0 Gold Pieces | 1 Gold Piece |

In the case of 3 pirates, the captain will vote against the mutiny to save his own life (rule 1). Pirate B will always vote for mutiny since moving up to the 2 pirate scenario means Pirate B gets 10 gold pieces. The key becomes Pirate C, If pirate C gets just 1 gold piece, he won’t vote for the mutiny since that means the crew moves to the 2 pirate scenario (& Pirate C becomes Pirate B), and he won’t get any gold pieces. Pirate A keeps 9 gold pieces, since by rule 2 pirates are greedy, and he only needs to give away 1 gold piece to Pirate C to garner his vote. Consequently, only Pirate B votes for the mutiny, and the crew lacks the majority to kill the captain.

In the case of 4 pirates:

Number of Pirates/Pirate Rank |
Rank A (Captain) |
Rank B |
Rank C |
Rank D |

1 Pirate |
10 Gold Pieces | |||

2 Pirates |
10 Gold Pieces | 0 Gold Pieces | ||

3 Pirates |
9 Gold Pieces | 0 Gold Pieces | 1 Gold Piece | |

4 Pirates |
9 Gold Pieces | 0 Gold Pieces | 1 Gold Piece | 0 Gold Pieces |

Everything from the 3 pirate scenario holds true. In this case the captain doesn’t need to give any gold pieces to Pirate D, since Pirate C and himself already vote against the mutiny, and consequently, only pirate B/D vote for the mutiny, but lack the majority to enact it.

Now the 5 Pirate Scenario

Number of Pirates/Pirate Rank |
Rank A (Captain) |
Rank B |
Rank C |
Rank D |
Rank E |

1 Pirate |
10 Gold Pieces (GP) | ||||

2 Pirates |
10 Gold Pieces (GP) | 0 GP | |||

3 Pirates |
9 Gold Pieces (GP) | 0 GP | 1 GP | ||

4 Pirates |
9 Gold Pieces (GP) | 0 GP | 1 GP | 0 GP | |

5 Pirates |
8 Gold Pieces (GP) | 0 GP | 1 GP | 0 GP | 1 GP |

In the 5 pirate scenario, similar to the 3 pirate scenario, the captain has to bribe Pirate E with 1 gold piece so that he will vote against the mutiny.

Say Pirate E gets 0 pieces of gold. There’s no immdiete threat to his own life (rule 1). Killing the captain moves him to the 4 pirate scenario where he’s rank D, and still gets no extra gold. So greed isn’t a driving factor (rule 2). However, since these pirates are a bloodthirsty bunch (rule 3), Pirate E will vote to mutiny without a bribe.

At this point the pattern should be clear. Every other pirate after the captain gets 1 gold piece each, and the captain keeps the rest for himself. So the 10 pirate scenario yields:

Number of Pirates/Pirate Rank |
Rank A (Captain) |
Rank B |
Rank C |
Rank D |
Rank E |
Rank F |
Rank G |
Rank H |
Rank I |
Rank J |

1 Pirate |
10 Gold Pieces (GP) | |||||||||

2 Pirates |
10 Gold Pieces (GP) | 0 GP | ||||||||

3 Pirates |
9 Gold Pieces (GP) | 0 GP | 1 GP | |||||||

4 Pirates |
9 Gold Pieces (GP) | 0 GP | 1 GP | 0 GP | ||||||

5 Pirates |
8 Gold Pieces (GP) | 0 GP | 1 GP | 0 GP | 1 GP | |||||

6 Pirates |
8 Gold Pieces (GP) | 0 GP | 1 GP | 0 GP | 1 GP | 0 GP | ||||

7 Pirates |
7 Gold Pieces (GP) | 0 GP | 1 GP | 0 GP | 1 GP | 0 GP | 1 GP | |||

8 Pirates |
7 Gold Pieces (GP) | 0 GP | 1 GP | 0 GP | 1 GP | 0 GP | 1 GP | 0 GP | ||

9 Pirates |
6 Gold Pieces (GP) | 0 GP | 1 GP | 0 GP | 1 GP | 0 GP | 1 GP | 0 GP | 1 GP | |

10 Pirates |
6 Gold Pieces (GP) | 0 GP | 1 GP | 0 GP | 1 GP | 0 GP | 1 GP | 0 GP | 1 GP | 0 GP |

So that solves the original question of “*how do the PRPLs divide up their gold”*!

What about the generalized case of P Pirates and G gold pieces. Under the 10 pirate scenario, the minimum amount of gold pieces needed to prevent a mutiny is below:

Number of Pirates/Pirate Rank |
Rank A (Captain) |
Rank B |
Rank C |
Rank D |
Rank E |
Rank F |
Rank G |
Rank H |
Rank I |
Rank J |

10 Pirates |
0 Gold Pieces (GP) | 0 GP | 1 GP | 0 GP | 1 GP | 0 GP | 1 GP | 0 GP | 1 GP | 0 GP |

The captain still doles out 1 gold piece each to every other pirate after him (total of 4 pieces), in order to guarantee their vote against mutiny. The captain’s main priority, per rule 1, is to keep himself alive, so he doesn’t need any gold for himself.

Say, only 3 gold pieces are available. The captain can no longer bribe Pirate I, and consequently, Pirate I votes for the mutiny, creating 6 votes for the mutiny and 4 votes against. So we can see that the amount of gold pieces determine the maximum amount of pirates that are alive. In equation form it looks like;

Pirates Alive (P) = [Gold Pieces (G) * 2] + 2

The amount of gold the captain gets is:

Gold Captain Gets = Gold Available (G) – [[Number of Pirates (P) / 2] – 1]

where the quantity [Number of Pirates (P) / 2] is rounded up to the nearest itneger

So going back to the question, the answer to how gold is distributed with 10 pirates and 10 pieces of gold:

**The captain gets 6 pieces of gold, with every other pirate following the captain getting a piece each (4 total pirates). **

And for the general case of P pirates and G gold.

**There is a mutiny until [Gold Pieces (G) * 2] + 2 > Pirates Alive. After which every other pirate following the captain gets a gold piece each, with the captain taking the balance of gold pieces. **