Easy | Strategy |

Five pirates need to divide 100 Gold Coins. Pirates have hierarchy, from Level 5 to level 1. The level-5 pirate proposes a division plan and all the pirates vote on it. If at least 50% of the pirates agree on the plan, the gold is split according to the proposal. If not, level-5 pirate is kicked from the ship, and the level-4 pirate now proposes a plan. This process continues until a proposal is accepted. All pirates are extremely smart and extremely greedy. How does level-5 Pirate divide the treasure?

Hint

Here n=5, think in terms of what happens if n=1,2,3...

Answer

Division is: 98,0,1,0,1

Solution

To understand the answer, we need to reduce this problem to only 2 pirates. So what happens if there are only 2 pirates. Pirate 2 can easily propose that he gets all the 100 gold coins. Since he constitutes 50% of the pirates, the proposal has to be accepted leaving Pirate 1 with nothing.

Now let's look at 3 pirates situation, Pirate 3 knows that if his proposal does not get accepted, then pirate 2 will get all the gold and pirate 1 will get nothing. So he decides to bribe pirate 1 with one gold coin. Pirate 1 knows that one gold coin is better than nothing so he has to back pirate 3. Pirate 3 proposes {pirate 1, pirate 2, pirate 3} {1, 0, 99}. Since pirate 1 and 3 will vote for it, it will be accepted.

If there are 4 pirates, pirate 4 needs to get one more pirate to vote for his proposal. Pirate 4 realizes that if he dies, pirate 2 will get nothing (according to the proposal with 3 pirates) so he can easily bribe pirate 2 with one gold coin to get his vote. So the distribution will be {0, 1, 0, 99}.

Smart right? Now can you figure out the distribution with 5 pirates? Let's see. Pirate 5 needs 2 votes and he knows that if he dies, pirate 1 and 3 will get nothing. He can easily bribe pirates 1 and 3 with one gold coin each to get their vote. In the end, he proposes {1, 0, 1, 0, 98}. This proposal will get accepted and provide the maximum amount of gold to pirate 5.

PS:This puzzle gives a basic idea of game theory and dynamic programming.

Now let's look at 3 pirates situation, Pirate 3 knows that if his proposal does not get accepted, then pirate 2 will get all the gold and pirate 1 will get nothing. So he decides to bribe pirate 1 with one gold coin. Pirate 1 knows that one gold coin is better than nothing so he has to back pirate 3. Pirate 3 proposes {pirate 1, pirate 2, pirate 3} {1, 0, 99}. Since pirate 1 and 3 will vote for it, it will be accepted.

If there are 4 pirates, pirate 4 needs to get one more pirate to vote for his proposal. Pirate 4 realizes that if he dies, pirate 2 will get nothing (according to the proposal with 3 pirates) so he can easily bribe pirate 2 with one gold coin to get his vote. So the distribution will be {0, 1, 0, 99}.

Smart right? Now can you figure out the distribution with 5 pirates? Let's see. Pirate 5 needs 2 votes and he knows that if he dies, pirate 1 and 3 will get nothing. He can easily bribe pirates 1 and 3 with one gold coin each to get their vote. In the end, he proposes {1, 0, 1, 0, 98}. This proposal will get accepted and provide the maximum amount of gold to pirate 5.

PS:This puzzle gives a basic idea of game theory and dynamic programming.

Source: Technical Interview

Enable Like and Comment Easy | General |

There is a light bulb inside a room and four switches outside. All switches are currently at off state and only one switch controls the light bulb. You may turn any number of switches on or off any number of times you want. How many times do you need to go into the room to figure out which switch controls the light bulb?

Hint

A lighted bulb also emits heat, and gets hot slowly (not instantaneously!)

Answer

1

Solution

I think this puzzle is stupid, but it was asked to my friend in an interview, so I can't skip it. The main point is that bulb gets hot slowly when turned on. Turn on bulb 1 and 2 keeping others off. Wait for 20 minutes. Switch off 2 and turn on 3, quickly enter room and touch the bulb. If the bulb is:

on and hot -> switch 1 controls it

off but hot -> 2

on but cool -> 3

off and cool -> 4

on and hot -> switch 1 controls it

off but hot -> 2

on but cool -> 3

off and cool -> 4

Source: Analytical Interview Puzzle

Enable Like and Comment Easy | Probability |

How do you place 50 good candies and 50 rotten candies in two boxes such that if you choose a box at random and take out a candy at random, it better be good!

That means probability of choosing a good candy should be highest.

That means probability of choosing a good candy should be highest.

Hint

Placing all bad in 1 box and all good in another will give probability of choosing good just half. But placing only one type of candy in one box makes sure that good candy has a probability of at-least 1/2

Answer

Put 1 good candy in one box and all other (49 good and 50 rotten candies) in second box

Solution

Put 1 good candy in one box and all other (49 good and 50 rotten candies) in second box. This will give a probability of (1/2)*1 + (1/2)*(49/100) = 74.5%

Easy | Probability |

In a world where everyone wants a girl child, each family continues having babies till they have a girl. What do you think will the boy to girl ratio be eventually? (Assuming probability of having a boy or a girl is the same)

Answer

1:1

Solution

Suppose there are N couples. First time, N/2 girls and N/2 boys are born (ignoring aberrations). N/2 couples retire, and rest half try another child. Next time, N/4 couples give birth to N/4 girls and rest N/4 boys. Thus, even in second iteration, ratio is 1:1. It can now be seen that this ratio always remain same, no matter how many times people try to give birth to a favored gender.

Easy | Strategy |

Hundred tigers and one sheep are put on a magic island that only has grass. Tigers can live on grass, but they want to eat sheep. If a Tiger bites the Sheep then it will become a sheep itself. If 2 tigers attack a sheep, only the first tiger to bite converts into a sheep. Tigers don’t mind being a sheep, but they have a risk of getting eaten by another tiger. All tigers are intelligent and want to survive. Will the sheep survive?

Hint

Instead of 100, think of 1 or 2 tiger's case.

Answer

Sheep survives!

Solution

If there is 1 tiger, then it will eat the sheep because he does not need to worry about being eaten. Sheep will not survive.

If there are 2 tigers, both of them knows that if one eats the Sheep, the other tiger will eat him. So, the sheep will survive.

If there are 3 tigers, then they each of them knows that if one tiger eats up the sheep, then Iceland will be left with 1 sheep and 2 tigers and as shown in the previous case, the sheep will survive. Hence each tiger will try to eat up the sheep. The sheep will not survive.

If there are 4 tigers, then the sheep will survive.

And so on….

So, If there are even number of tigers the sheep will survive, else it will die. Hence, if there are 100 tigers the sheep will survive.

If there are 2 tigers, both of them knows that if one eats the Sheep, the other tiger will eat him. So, the sheep will survive.

If there are 3 tigers, then they each of them knows that if one tiger eats up the sheep, then Iceland will be left with 1 sheep and 2 tigers and as shown in the previous case, the sheep will survive. Hence each tiger will try to eat up the sheep. The sheep will not survive.

If there are 4 tigers, then the sheep will survive.

And so on….

So, If there are even number of tigers the sheep will survive, else it will die. Hence, if there are 100 tigers the sheep will survive.

Source: Common

Enable Like and Comment Latest solved Puzzles

Color Switches Weird Sequences Intersecting Pillars Consecutive sums Scaling a Square Difficulty Level

© BRAINSTELLAR |