Your pharmacist gives you 5 jars filled with pills. The pills contained in each jar have an identical appearance and size (i.e. if you mixed all of the pills you wouldn't be able to tell them apart).

4 of the 5 jars hold pills that weigh 10 grams each, and the remaining jar holds pills that weigh 9 grams each. However, you don't know which jar is the one holding the lightweight pills. Keep in mind that all of the pills in all jars are identical in appearance and size.

You are given a weighing scale that can only be used once. Using this scale (only once), how do you determine which jar is holding the 9 gram pills?

Note: assume the jars are quite large and that you have an unlimited quantity of pills from each jar.

Suppose jar 4 contained the 9 gram pills. The total mass that you observe would be (1+2+3+5) * 10 + 4*9 = 146 grams. Since the mass you observe is 4 grams less than the expected 150 grams, you know jar 4 is holding the 9 gram pills.

The solution is explained in detail under "Show Solution", but the key idea is that you take different amounts of pills from each jar so you'll know exactly which jar has the pills with a different weight.

For example, if jar 2 has the 9 gram pills and you picked 2 pills from jar 2, the total weight of the pills will be 2 grams less than the expected weight

Take from the first jar 1 pill, 2 from the second, 3 from the third one,... 5 from fifth
If the weight is 149, then ( 150 - 149 ) = 1 then the first jar contains 9 gram pills
If the weight is 148, then ( 150 - 148 ) = 2 then the second jar contains 9 gram pills
....
145 means that the 5th jar has light-weighted pills