This is not a computer problem. Think about it backwards.

If there are only 2 pirates left, then the elder can claim all 100
coins, at worst the vote will be tied, and so he survives and takes
100 coins.

If there are 3 pirates left, then the oldest can claim 99 coins and
give the youngest 1 coin, with the second oldest pirate getting
nothing. Since the youngest gets more than he would if he voted no, he
will vote yes with the oldest, so the oldest survives and takes 99
coins.

If there are 4 pirates left, then the oldest can claim 99 coins and
give the third oldest 1 coin, with the second oldest and youngest
getting nothing. The third oldest vote yes because he gets more than
if he voted no, so the vote is at least tied, so the oldest survives
and takes 99 coins.

At the beginning, with all 5 pirates, the oldest can claim 98 coins
and give the third oldest and the youngest 1 coin each. They will vote
with him because they will get more than if they voted no, so the
oldest pirate survives and takes 98 coins.

Dave

On Aug 22, 10:36 pm, hari <harihari1...@gmail.com> wrote:
> Five  pirates (of different ages) have 100 gold coins to divide
> amongst themselves. They decide on the following approach to determine
> how much each pirate receives:
>
> The eldest pirate proposes an allocation. All pirates (including the
> eldest) then vote on the proposal. If the majority accept the proposal
> then the coins are divided in the way suggested. If not, then the
> eldest pirate is executed and the new eldest amongst the remaining
> pirates proposes a new allocation. If the votes are tied then this is
> enough for the proposal to be accepted.
>
> Assuming that the pirates are motivated primarily by survival, then to
> a lesser extent by greed and finally to the least extent by sadism
> (i.e. they'd prefer to receive a gold coin and see someone get
> executed than just receive one coin earlier, but would prefer one coin
> to none and an execution; and obviously would prefer 0 coins and
> surviving to 100 coins and being executed), and act in a logical way,
> what is the maximum number of coins the eldest pirate can get?
>
> please provide a source code
>
> thanks in advance

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to algoge...@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.

Reply via email to