Created
January 24, 2017 01:06
-
-
Save AurelienGasser/aedc22d69be3670427ef609227ad50e8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
You give a 1-1000 number to each bottle. | |
You convert that number to binary. The maximum number (1000) takes 10 digits (decimal 1000 == binary 1111101000) | |
You number each rat 1-10. | |
For each bottle, you make the Nth rat drink if the bottle's Nth digit is 1. | |
You see which rats die, and determine the binary code for the poisoned bottle. | |
e.g. | |
if rats 2,3,8 die | |
then bottle 0010000110 is poisoned | |
i.e. bottle 134 is poisoned |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment