Post Go back to editing

KCC's Quizzes: Contaminated Pills

  1. Eight jars with hundreds of identical looking pills, although 7 jars have medicine pills of 1000 mg each, 1 jar has contaminated pills of 999 mg each. The contaminated pills are ever so slightly lighter than the medicine pills. You have a precise electronic scale (precision better than 1mg). With ONE (1) weighing, how can you detect the jar with the medicine pills?
  2. Same question as above but the situation is there could be multiple jars with contaminated pills. With ONE (1) weighing, how can you identify which jars (could be multiple) have contaminated pills?

Many thanks to Ralph Montforts, ADI Director, General Accounting for proposing this quiz!



Edit title
[edited by: emassa at 3:46 PM (GMT -5) on 18 Jan 2023]
Please share your answer to view other submitted answers
Parents
  • Since the weighing of N pills will be 1mg shy of N grams per contaminated pill on the scale, to determine which jar is contaminated we just need to correlate different pill quantities with each jar, weigh them all collectively, and see how many mg below N grams the weighing is, which will point us to the correct jar.  E.g., number the jars 1 to 8 and weigh that many pills from each jar - a total of 36 pills.  The ideal weight would be 36 grams without contamination, but knowing 1 jar has contaminated pills the weighting will come up X mg short of 36 grams, and X will be the jar # with the contaminated pills.

    For the second weighing, we will need to use quantities of pills from each jar that would produce a unique weighing regardless of how many contaminated pill jars there may be.  The simplest way to do that is assigning binary weightings of the quantity of pills we weigh from each jar.  Again, numbering the jars 1 to 8, to weigh the minimum number of pills we would weigh 2^M pills from each jar, where M = jar# -1.  So, 1 pill from jar 1, 2 from jar 2, 4 from jar 3... up to 2^7=128 pills from jar 8, a total of 255 pills.  With a weighing that is N mg less than 255 grams, translating that value of N to binary, each binary digit instance of 1 will identify a contaminated jar.  E.g. a 1 in the LSB place means jar 1 is contaminated, a 1 in the 4th LSB place means jar 4 is contaminated, etc. 

    (Pro pharmacy tip:  Please put 8 containers on the scale (and zero out the scale), each container devoted to the pills from a particular jar, and keep track of which pills came from which jar so we needn't mix all the pills for the weighing and have to throw them all away!)

Reply
  • Since the weighing of N pills will be 1mg shy of N grams per contaminated pill on the scale, to determine which jar is contaminated we just need to correlate different pill quantities with each jar, weigh them all collectively, and see how many mg below N grams the weighing is, which will point us to the correct jar.  E.g., number the jars 1 to 8 and weigh that many pills from each jar - a total of 36 pills.  The ideal weight would be 36 grams without contamination, but knowing 1 jar has contaminated pills the weighting will come up X mg short of 36 grams, and X will be the jar # with the contaminated pills.

    For the second weighing, we will need to use quantities of pills from each jar that would produce a unique weighing regardless of how many contaminated pill jars there may be.  The simplest way to do that is assigning binary weightings of the quantity of pills we weigh from each jar.  Again, numbering the jars 1 to 8, to weigh the minimum number of pills we would weigh 2^M pills from each jar, where M = jar# -1.  So, 1 pill from jar 1, 2 from jar 2, 4 from jar 3... up to 2^7=128 pills from jar 8, a total of 255 pills.  With a weighing that is N mg less than 255 grams, translating that value of N to binary, each binary digit instance of 1 will identify a contaminated jar.  E.g. a 1 in the LSB place means jar 1 is contaminated, a 1 in the 4th LSB place means jar 4 is contaminated, etc. 

    (Pro pharmacy tip:  Please put 8 containers on the scale (and zero out the scale), each container devoted to the pills from a particular jar, and keep track of which pills came from which jar so we needn't mix all the pills for the weighing and have to throw them all away!)

Children