The Wayback Machine - https://web.archive.org/web/20240204103504/https://www.geeksforgeeks.org/puzzle-20-5-pirates-and-100-gold-coins/
Open In App
Related Articles

Puzzle 20 | (5 Pirates and 100 Gold Coins)

Improve
Improve
Improve
Like Article
Like
Save Article
Save
Report issue
Report

There are 5 pirates, they must decide how to distribute 100 gold coins among them. The pirates have seniority levels, the senior-most is A, then B, then C, then D, and finally the junior-most is E. 

Rules of distribution are: 

  1. The most senior pirate proposes a distribution of coins.
  2. All pirates vote on whether to accept the distribution.
  3. The distribution is approved if at least half of the pirates agree (including the proposer)
  4. If the distribution is accepted, the coins are disbursed and the game ends.
  5. If not, the proposer is thrown and dies, and the next most senior pirate makes a new proposal to begin the system again.
  6. In case of a tie vote, the proposer can have the casting vote

Rules every pirate follows.

  1. Every pirate wants to survive
  2. Given survival, each pirate wants to maximize the number of gold coins he receives.

What is the maximum number of coins that pirate A might get? 
Answer: 
The answer is 98 which is not intuitive. 
A uses the facts below to get 98. 

  1. Consider the situation when A, B, and C die, only D and E are left. E knows that he will not get anything (D is senior and will make a distribution of (100, 0). So E would be fine with anything greater than 0.
  2. Consider the situation when A and B die, C, D, and E are left. D knows that he will not get anything (C will make a distribution of (99, 0, 1)and E will vote in favor of C).
  3. Consider the situation when A dies. B, C, D, and E are left. To survive, B only needs to give 1 coin to D. So distribution is (99, 0, 1, 0)
  4. Similarly, A knows about point 3, so he just needs to give 1 coin to C and 1 coin to E to get them in favor. So distribution is (98, 0, 1, 0, 1).

Whether you're preparing for your first job interview or aiming to upskill in this ever-evolving tech landscape, GeeksforGeeks Courses are your key to success. We provide top-quality content at affordable prices, all geared towards accelerating your growth in a time-bound manner. Join the millions we've already empowered, and we're here to do the same for you. Don't miss out - check it out now!

Looking for a place to share your ideas, learn, and connect? Our Community portal is just the spot! Come join us and see what all the buzz is about!


Last Updated : 19 Jan, 2023
Like Article
Save Article
Previous
Next
Share your thoughts in the comments
Similar Reads