Originally posted by Storm:
if we take powers of 2 number of pills out (1,2,4,8,16,32,64,124,256,512) and weigh them and find out the sum total, we should be able to determine WHICH and HOW MANY bottles are poisonous. I chose powers of two because no matter how you add the bottles, you will always get a unique number... (tinkled with prime numbers for a while, but it didn't work too well)
example: if bottles 1 through 9 are poisonous, you should have an [b]excess weight of 1+2+4+...+256 = 511*0.01g = 5.11g... which is still 0.01g less than if ONLY bottle 10 was poisonous (and therefore with an excess weight of 5.12g)
OK in summary, find the excess weight, convert it to binary format, then where you have the digit 1 is where the poison is. (eg in the above 511 in binary will be 0111111111 so the poisonous pills are in bottles 9,8,7,6...,2 and 1).
Another e.g: if the excess weight was 0.75g, then in binary will be 0001001011 meaning bottles 7,4,2 and 1 are poisonous.
I'm sure there are other combinations of numbers that make up unique sums, but this is my first cut answer...
[/b]
Originally posted by Devil1976:......
Hmm.. Maybe I should learn binary format one day....?Originally posted by Storm:![]()
![]()
very easy.Originally posted by Devil1976:Hmm.. Maybe I should learn binary format one day....?![]()