PROJECT EULER · #0950
Pirate Treasure
A band of pirates has come into a hoard of treasure, and must decide how to distribute it amongst themselves. The treasure consists of identical, indivisible gold coins.
According to pirate law, the distribution of treasure must proceed as follows:
- The most senior pirate proposes a distribution of the coins.
- All pirates, including the most senior, vote on whether to accept the distribution.
- If at least half of the pirates vote to accept, the distribution stands.
- Otherwise, the most senior pirate must walk the plank, and the process resumes from step 1 with the next most senior pirate proposing another distribution.
The happiness of a pirate is equal to
The pirates have a number of characteristics:
- Greed: to maximise their happiness.
- Ruthlessness: incapable of cooperation, making promises or maintaining any kind of reputation.
- Shrewdness: perfectly rational and logical.
Consider the happiness
Define
Find
Write-up coming later
The complete problem is available here. An approach, code, and answer will be added later.