-Bala Cynwyd, PA

# Here is an example of a brainteaser during the interview: You have five pirates, ranked from 5 to 1 in descending order. The top pirate has the right to propose how 100 gold coins should be divided among them. But the others get to vote on his plan, and if fewer than half agree with him, he gets killed. How will the coins end up being divided, assuming all the pirates are rational and want to end up alive?

Répondre

## Réponses aux questions d'entretien

15 réponse(s)

13

This is just a classic game theory question and you have to work backwards through it starting with the base case to understand the pirates motivation. If you have two pirates, p1 and p2, and if p1 is the final voter then he will always vote negatively unless p2 gives him all \$100 since he can kill him anyways and take the whole loot. This means p2 is in a compromised position and does not want the game to go down to 2 pirates and will take any value greater than 0 from any other pirate, or will vote yes if he receives at least \$1. When p3 is introduced, he knows p2 will need at least \$1 to vote for the plan therefore he keeps \$99 and gives away the last dollar to p2. This means p3 is in a dominant position and will vote down any plan that grants him less than \$99. When p4 is introduced then he needs two of the three voters to vote for his plan. Granted p1 will decline unless he receives all of it and p3 will decline unless he receives at least \$99 of it then he will give p3 exactly that and p2 \$1 otherwise he is killed. p4 is in a compromised position so he will accept any offer where he receives something greater than 0. When p5 is introduced he knows p4 and p2 are screwed and the maximum they can earn if it bypasses him is \$1. Therefore granting them each that money will guarantee their vote leaving the remaining \$98 for himself and half the votes are positive thus he is not killed and gets to keep \$98. So the distribution for p5, p4, p3, p2, p1 should be 98, 1, 0, 1, 0.

Utilisateur anonyme le

15

the answer isnt that obviouse.....you give the 3rd and 1st one coin and keep 98....start at the beginning. if theres 2 pirates, 100 for 2, 0 for 1 (one doesnt like this) If there is three 1 will be happy with just a single coin, b/c he does not want it to go down to 2. If there is 4 pirates, 2 will be happy with a single coin, b/c he does not want it to get down to 3 pirates where he will receive 0. So he gets 1 and 4 gets 99. At 5 it changes a bit. Here 1 and 3 will be happy with single coins b/c if it goes down to 4 they will receive 0 coins. So 5 takes 98, and 1 and 3 take 1 one each

sean le

6

sean is not right. The top pirate DOES NOT vote. If there are two pirates and the top decides to take the 100 coins for himself, the other one will vote against and the top pirate will be killed

martin le

3

98, 0, 1, 0 ,1

cxa le

2

If there are 4 pirates and you give 1 coin to 2 and 99 to yourself....surely 1 and 3 will vote against you and it will go down to 3 pirates??

Jack le

0

If the top pirate gets killed, the rest of the pirates gets to divide the 100 coins which is 25 coins per person. but the higher ranking pirates 3,4 will probably get more so the best case scenario for pirates 1,2 is 25 coins per person. If the top pirates give 1 and 2 26 coins per person, they will vote for him and he gets to keep the rest of the 48 coins

Utilisateur anonyme le

0

We have the following fundamental assumption: Any pirate will not vote down as long as his payout is greater or equal to that of what his payout would be with 1 fewer pirate. As such, we product the following chart, working up from 1 pirate: (Payout,Expected of 1 less pirate) , we require that (Payout >= Expected of 1 less pirate) to get their vote # pirates | Rank: 1 2 3 4 5 1 (100,) 2 (100,100)(0,0) 3 (0,100) (1,0) (99,0) 4 (1,0) (2,1) (0,99) (97,0) 5 (1,1) (0,2) (1,0) (0,97) (98,0)

Max le

0

20 each

Utilisateur anonyme le

0

Wait, that's wrong I just realized. The buck stops with pirate 3. He can get 50 and he will, so pay him 50 first. In the Four pirate scenario, Pirate 4 will also have to pay out 50 to pirate 3 or he'll be killed, so the most he can allot to himself is 17, which is all Pirate 5 should give him. New Tally: Pirate 5 - 33 Pirate 4 - 17 Pirate 3 - 50 Pirate 2 - 0 Pirate 1 - 0 Pirate 2 is always going to be looking for that \$50 payday in the Three Pirate scenario, so it's important to neutralize his vote immediately by having 4 and 3 agree with 5 in the first place.

Jkeeps le

0

lol i hope that you are kidding....otherwise it's better to find a manual-farmer job.... btw sean is right

alessandro le

0

If we assume that once the top pirate is killed the next one takes his place and decides how the money is allocated we can solve it like this: Five Pirates: || 34 || 33 | 33 | 0 | 0 | - pirates 4 and 3 make more than the 20 they should earn if the money is distributed equally and they should vote to pass while 2 and one vote against. Split 50/50 it should pass. BUT - could pirates 4 and 3 make more money if they voted against and then split it up among fewer people? Four Pirates: || 34 || 33 | 33 | 0 | - Again, everyone gets 33 and we assume pirates 3 and 2 vote in favor, outweighing pirate1. BUT - pirate 3 sees an opportunity Three Pirates: || 50 || 50 | 0 | - with only one vote to sway in order to get 50%, pirate 3 only has to give pirate 2 half of the total. So at best, pirate 3 will vote NO unless he gets his 50 up front. Pirate 4 will vote NO unless he gets his 34 up front. In order to survive, pirate 5 should pay accordingly to those pirates and take home a meager 16. Though 16<20, the other greedy pirates will always vote NO unless they get the amount they know they can receive. If Pirate 5 wants to stay alive that's what he'll do. TL;DR Pirate 5 - 16 Pirate 4 - 34 Pirate 3 - 50 Pirate 2 - 0 Pirate 1 - 0

Jkeeps le

0

highest rank keeps 98, two get 1 each, two receive nothing. now it's just up to the first two to be happy with 1 coin each, but then, if they were not, the other two would be more happy with 1 instead of 0 coins. one could argue that if all 4 are rational, they would demand 25 each or be unhappy alltogether.

le

1

0 to the lowest 2. 1/3*100 to the three others. half would disagree but the top pirate would live.

Beherano le

0

54321

mb le

4

If the pirates are RATIONAL- then they would all agree with taking just 20 coins a peice and splitting it evenly. That is the short and sweet answer. Unfortunately these nerd interviewers may prefer a pointlessly long and drawn out answer to demonstrate your irrelevant mathematical reasoning skills/ability In which case you may answer with the following Give one coin each to the 2 lowest ranked pirates. and split the remaining between the top 3( Maybe 32 for the top pirate and 33 for pirate 2 and 3 ). The bottom 2 will certainly vote against you- but now atleast you are increasing your odds of the other 2 pirates agreeing with the plan. ( which are the 2 minimum votes needed for pirate one to survive) Obvious explanation If there are 5 pirates, one comes up with the plan and the other 4 vote. If fewer then half agree with the top pirate- he gets killed. That means if less than 2 agree he would get killed. He need at the minimum 2 pirates to agree with him to live.

Jon K le

## Ajouter des réponses ou des commentaires

Pour commenter ceci, connectez-vous ou inscrivez-vous.