Fundamentals 5 min read

How to Identify a Poisoned Bottle with Minimal Rabbits Using Binary Logic

This article explores a classic puzzle where one must locate a single poisonous bottle among 1000 using rabbits as testers, comparing time‑focused, space‑focused, and balanced strategies before revealing an optimal binary‑encoding solution that finds the poison in one day with just ten rabbits.

NiuNiu MaTe
NiuNiu MaTe
NiuNiu MaTe
How to Identify a Poisoned Bottle with Minimal Rabbits Using Binary Logic

Problem Statement

There are 1000 bottles of liquid, one of which is poison; a single drop kills within a day. Using rabbits as testers, we need to identify the poisoned bottle while minimizing the number of rabbits and the time required.

Approaches

1. Time‑focused (use many rabbits)

Assign one rabbit to each bottle, requiring 1000 rabbits and yielding the result in a single day.

2. Space‑focused (use few rabbits, more days)

Divide the bottles repeatedly (e.g., halves), using one rabbit per round. In the worst case this needs 10 rabbits and 10 days (1000 → 500 → 250 → … → 1).

3. Balanced multi‑way split

Generalize to an‑way split using a‑1 rabbits. For example, 9 rabbits allow a 10‑way split, solving the problem in 3 days (1000 → 100 → 10 → 1). With 2 rabbits (3‑way split) it takes 7 days. The formula is d = log_a(N), where d is days, a is the number of parts, and N is the bottle count.

Binary Encoding Solution

Label each bottle from 1 to 1000 in binary using 10 bits. Assign 10 rabbits, each representing one bit position. A rabbit drinks from every bottle whose binary representation has a 1 in its corresponding bit. After one day, the pattern of dead rabbits directly yields the binary code of the poisoned bottle, identifying it in a single day with only 10 rabbits.

The binary method achieves the optimal balance: minimal rabbits (10) and minimal time (1 day), demonstrating how algorithmic thinking can turn a seemingly complex testing problem into a simple, elegant solution.

OptimizationalgorithmlogicBinarypuzzle
NiuNiu MaTe
Written by

NiuNiu MaTe

Joined Tencent (nicknamed "Goose Factory") through campus recruitment at a second‑tier university. Career path: Tencent → foreign firm → ByteDance → Tencent. Started as an interviewer at the foreign firm and hopes to help others.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.