@billb,
Finally figured out the pill question. Here it is....
Take pills out of each bottle.
Take 1 pill out of Bottle1
Take 2 pills out of Bottle2.
Take 3 pills out of Bottle3.
Take 4 pills out of Bottle4.
And take 5 pills out of Bottle5.
Measure all the pills together. Since the "contaminated pill" is a multiple of 9, then you will notice it in the overall weight.
Let's say the answer is Bottle3, meaning that it contains the contaminated pills. If that's the case, then the weight would be 147 grams. Here's why:
(each weight corresponds to its bottle)
10g + 20g + 27g + 40g + 50g = 147g
As long as you know the multiples of 9, then you can figure out the answer to the problem this way.