[CrackMonkey] [schoen@loyalty.org: Pill-weighing]

Seth David Schoen schoen at loyalty.org
Sun Feb 13 19:50:47 PST 2000


Mr. Bad writes:

> >>>>> "B" == Bad  <mr.bad at pigdog.org> writes:
> 
>     B> This gets mucked up if you have 100 or more bottles,
>     B> though. Another way you could do it is for bottle X, put 100 *
>     B> (10 ^ ((X - 1) * 3) pills on.  In other words, for bottle 1,
>     B> put 100 pills on. For bottle 2, put 100,000 pills on. For
>     B> bottle 3, put 100,000,000 pills on. Then you'll get a reading
>     B> like 100101100. You can tell its the 2nd bottle that has the
>     B> bad pills, because it's where the "101" shows up.
> 
> Actually, now that I look at it, that's kind of lazy. You can do it
> with a lot fewer pills. For each bottle X, put on 10 ^ (X + 1)
> pills. So, for bottle 1, put on 100 pills. For bottle 2, put on 1000
> pills, for bottle 3, put on 10000 pills. If all the pills are honest,
> you'd get a number like:
> 
> 	1111100
> 
> But if there's a bunch of 101 pills in any of the bottles, you'll get
> a number like:
> 
> 	1121110
> 
> You can see that a "bad" bottle causes an extra value 2 places
> down. In this example, bottles 2 and 5 are bad.

That's kind of lazy too.  Why not put on 2^x pills from bottle x instead?

After all, as a busy pharmacist, you don't really have time to sit around
counting out ten million pills from bottle six alone.  That could get a
bit tedious.

-- 
Seth David Schoen <schoen at loyalty.org>  | And do not say, I will study when I
Temp.  http://www.loyalty.org/~schoen/  | have leisure; for perhaps you will
down:  http://www.loyalty.org/   (CAF)  | not have leisure.  -- Pirke Avot 2:5





More information about the Crackmonkey mailing list