### _wannacry_'s blog

By _wannacry_, history, 5 days ago,
You have 5 jars of pills. Each pill weighs 10 grams, except for contaminated pills contained in one jar, where each pill weighs 9 grams. Given a scale, how could you tell which jar had the contaminated pills in just one measurement?

• -3

 » 5 days ago, # |   0 I will put all the 5 jars on top of the measurement scale and the scale would definitely read as 49 Grams(1 contaminated pill=9 gram + 4 real pill = 4*10). Then, I will remove one jars at a time from the scale, if the pill is real the measured value would reduce by 10 and if the measured value reduced by 9, then we will get that this is the contaminated jar that we r looking for. In the worst case, we would need to remove one jar from the scale 4 times.
•  » » 5 days ago, # ^ |   0 .ComplaintFrame { display: inline-block; position: absolute; top: 0; right: -1.4em; } .ComplaintFrame a { text-decoration: none; color: #ff8c00; opacity: 0.5; } .ComplaintFrame a:hover { opacity: 1; } ._ComplaintFrame_popup p, ._ComplaintFrame_popup button { margin-top: 1rem; } ._ComplaintFrame_popup input[type=submit] { padding: 0.25rem 2rem; } ._ComplaintFrame_popup ul { margin-top: 1em !important; margin-bottom: 1em !important; } You can weight the pills only one time , like if u put some pills from every jar thats it then u cant remove and see
 » 5 days ago, # | ← Rev. 2 →   +20 Spoiler Alert! Spoiler From the $i$-th bag put $i$ coins on the scale. The total number of coins in $1+2+3+4+5=15$. Let the number of fake coins be $x$. Then the weight displayed will be $150 - x$. If the jar $i$ had the fake coins then the weight dsiplayed will be $150 - i$. Let the reading value be $v$. The fake jar is $150 - v$ (eg. if jar $4$ had the fake coins then reading would be $v = 10 + 20 + 30 + 36 + 50 = 146$ and we get $150 - v = 150 - 146 = 4$). There are many such solutions to problems like this. You can in general put $f(i)$ coins from the $i$-th jar as long as $f(i)$ is different for each relevant $i$.