Enter your email address:

November 18, 2008

Microsofts Interview Question

There is a table on which a number of coins are placed. You also
know that there are as many coins with Head up as many coins with
Tail up. Now you have to divide the coins (number of coins is even)
into two equal piles such that number of coins with Heads up and
Tails up in either piles be the same. The catch is you are
blind folded and you cannot determine the sides (for sure)
if you are blinded


Arjun said...

Since the number of coins is not mentioned, I would imagine it to be 2 coins( still even), then I guess it is simple......

Sry if i sounded stupid... :)


Secret Squïrrel said...

It doesn't matter how many coins there are as long as the number is even but, for example, lets say that there are 42 coins. Since the number of heads and tails is the same, there will be 21 H and 21 T. No matter how these are divided, as long as the 2 piles are equal, there must be the same number of heads in pile 1 as there are tails in pile 2 (and vice versa); eg
Pile 1: 8H + 13T
Pile 2: 13H + 8T

Flip all of the coins in one of the piles. Now both piles will have the same number of H & T.

My Love said...

niceone friend.Good question and also an intelligent answer.

obi wan kenobi said...

The actual question was something like this:

There are 1000 coins on the table. 30 are in tails up state and the rest 970 are in heads up state. Now the task is to divide the coins in 2 groups so that the both groups have the same number of heads OR tails..

Of course, you are blindfolded and all those terms..

well answer is pretty much the same.. just divide the coins into groups of 30 and 970.. and then invert the group which has 30 coins. Then the no. of tails in both groups will be same.

If you invert the 970 coin set then the number of heads in both groups will be same.