Gate
Exam
Q. You have 9 coins and a weighting scale,in these coins a defected coin is included,we want to remove this coin by using weighting scale (minimum times), so how much time you will use w.s. to do this work. give a minimum answer?
Read Solution (Total 5)
-
- 1/9 times minimum
8/9 times maximum - 11 years agoHelpfull: Yes(1) No(3)
- Take 4+4+1 (2 times using for 4,4)
here 1 left may be defect.
Otherwise
take defect 4 coins set
2+2 (2 times using)
then take defect 2 coins set
1+1 (2 times using)
So, min 2 times,max 6 times - 11 years agoHelpfull: Yes(1) No(0)
- 9 coins.....
weight 4 and 4 coins ,if they are equal then remaining one coin is defect,
else weighting more side is defect coin is ,now 2nd time take 1 and 1,do the same process
within 3 chances u can find defect coin - 11 years agoHelpfull: Yes(0) No(0)
- weigh 4 and 4:if they r same then the remained coin is odd one.
if one of them has more weight than others take that pack of 4 coins
weigh 2 and 2 of which one pack of 2 will have more weight .
weigh 1 and 1 of which one will have more weight and so,max no.of using the weighing machine is 3. - 11 years agoHelpfull: Yes(0) No(0)
- This is a typical Binary search problem, where we divide the total coins, say, 4 4 1, weighing equal number of coins to check the tipping of scales. Using binary search algorithm, the problem has O(log 9) complexity, minimum is one time, max is 3 times.
- 11 years agoHelpfull: Yes(0) No(0)
Gate Other Question