Poison and Rat | Puzzles for Interview - Interview Preparation PDF Download

Introduction 

If you have 1000 wine bottles and suspect that one of them is poisoned, you can figure out which one it is by using rats. But how many rats do you need to get the job done in just one hour?

Solution

To solve this puzzle in just one hour, you'll need 10 rats. This is based on the binary number system, which uses only two digits (0 and 1) to represent numbers. Using this system, you can write the numbers 1 to 1000 in binary form.

Idea

Assign each rat a position in the binary numbers written on the bottles. For example, rat 1 represents the first bit in every bottle, rat 2 represents the second bit, and so on. Each rat drinks from a different set of bottles, depending on their assigned bit position.
After one hour, the rats that die will indicate which bottles contain the poisoned wine. The binary number formed by the dead rats' bit positions will reveal the number of the poisoned bottle.

Result

Using this method, you can figure out the poisoned bottle with just 10 rats. This is because ⌈ Log21000 ⌉ (the smallest integer greater than or equal to the logarithm of 1000 to base 2) is equal to 10. So, assign the first rat to drink from bottles numbered with the first bit, the second rat to drink from bottles numbered with the second bit, and so on until the tenth rat drinks from bottles numbered with the tenth bit.
For example, if rats 2, 4, and 6 die, then bottle number 42 (Binary 0000101010) is poisoned.

Conclusion

By using the binary number system and assigning rats to each bit position, you can figure out the poisoned wine bottle with just 10 rats in one hour. This puzzle showcases the power of binary numbers and how they can be applied to solve real-world problems.

The document Poison and Rat | Puzzles for Interview - Interview Preparation is a part of the Interview Preparation Course Puzzles for Interview.
All you need of Interview Preparation at this link: Interview Preparation
109 docs

Top Courses for Interview Preparation

Explore Courses for Interview Preparation exam

Top Courses for Interview Preparation

Signup for Free!
Signup to see your scores go up within 7 days! Learn & Practice with 1000+ FREE Notes, Videos & Tests.
10M+ students study on EduRev
Related Searches

Poison and Rat | Puzzles for Interview - Interview Preparation

,

study material

,

ppt

,

Summary

,

Important questions

,

Viva Questions

,

practice quizzes

,

Previous Year Questions with Solutions

,

Extra Questions

,

shortcuts and tricks

,

MCQs

,

pdf

,

Poison and Rat | Puzzles for Interview - Interview Preparation

,

Poison and Rat | Puzzles for Interview - Interview Preparation

,

past year papers

,

Sample Paper

,

mock tests for examination

,

video lectures

,

Semester Notes

,

Objective type Questions

,

Free

,

Exam

;