InterviewSolution
Saved Bookmarks
| 1. |
There are 9 coins and a weighing balance. 8 coins are of the same weight and 1 coin is heavier. In how many minimum numbers of iterations can you find out the heaviest coin in the worst case? |
|
Answer» Most people try to divide the coins into 2 groups. But the TRICK here is to divide them into 3 groups. The reason being if we divide coins into 2 groups and weigh them, we can only discard one group. But if we divide them into 3 groups and weigh 2 groups, either they both will be equal or not. If both are equal then the coin with heavier weight will be on the LEFT out group and if they both are not equal then the heavier weight group contains the coin with heavier weight. We can discard 2 groups out of the 3 groups in this case. Hence we first divide 9 coins into 3 equal groups.
|
|