Puzzle: A pirate ship with total crew of N pirates acquired a chest with K gold coins. Now they have to divide up the loot.

By long term pirate tradition the rules are as follow:

- The most senior pirate gets to propose a way to divide the loot.

- Each pirate, including the most senior pirate himself gets to vote.

- If the majority accept the proposal, the loot is divided as proposed.

- If the majority decline the proposal, then the most senior pirate is executed, and they start over again with the next senior pirate

Assume the pirates has perfect logic, extremely greed and don’t want to die.

What solution does the most senior pirate propose?

Solution:

As with any puzzles of this kind lest use induction with
N=1,2,3 etc until we get the pattern:

if N=2,
Let’s say pirate #1 being the most senior, he would just vote for himself and that would be the majority thus he is going to keep all the money, leaving pirate #2 empty handed.

if N=3,
Pirate #1 has to one other person to vote for his plan. Pirate #1 has perfect logic so, he realize that in case his proposal declined and he is executed pirate #3 will get nothing (see N=2 scenario).

So, his proposal is straight forward, give 1 coin to pirate #3 and keep (K-1) coins. Pirate #3 has to vote for his plan or he guaranteed to get nothing.

if N=4,
Now pirate #1 needs one vote as well, he know if he is executed,
pirate #3 guaranteed to get nothing, so the solution to give him one coin and keep the rest to himself.

If we continue the sequence following pattern will emerge:

Pirates with gold coins

So the general solution is to give away Math.Floor((N-1)/2) coins keeping K- Math.Floor((N-1)/2).

Company where asked this question:






Answers and Comments