You have been given 10 bags of pearls. You are told that one of the bags is full of those cheap plastic kind of pearls, but the other nine are the real deal. Naturally, you cannot tell the difference just by looking. However, you know that the fake pearls weigh 9 grams each, while the real ones are one gram heavier and weigh 10.
Armed with a very presice scale, you could weigh a pearl from each bag until you find the fake one by weight, but that would take up to 10 weighings. Can you do it in less?
The maximum number of weighings for x bags of pearls when you are only given a of each is round-up(log(a+1)x).
(The number in parentheses is the base)
So with 3 pearls in each bag, put 0 from some bags, 1 from some 2 from some 3 from some.
Only 2 weighings would be needed
|
Posted by Gamer
on 2003-04-08 12:40:36 |