Poison Bottle Finder (Binary Rats)

Each rat is a bit: alive = 0, dead = 1. With n rats you can identify up to 2^n bottles.

1) Minimum rats

2) Decode which bottle is poisoned

Enter which rats died after 1 hour (0-indexed). Example: 1,3,9

3) (Optional) Which rats drink from a given bottle?

Type a bottle number and the app shows which rats (bits) drink from it.

How the mixing works (quick)

  1. Number bottles 0..(B-1).
  2. Use N rats where N = ceil(log2(B)).
  3. For each bottle, write its number in N-bit binary.
  4. If bit i is 1, include a sip from that bottle in rat i’s cup.
  5. Dead rats form a binary number = poisoned bottle.