Check if two node are siblings in a binary tree
August 1, 2017
Hashing introduction
August 3, 2017

Medicine tablet (Pill) taking puzzle

Doctor gave you two types of medicine tablets (pils) A and B, and asked you to take one from each daily. The two tablets are in different bottles and look exactly same

One day, while taking the pills, you open Bottle-A and tap one pill out in your hand. Then you open the second bottle to take one pill from it, but accidentally two pills pop out from the bottle on your hand. Now you have 1 A-Pill and 2 B-Pills in your hand and you cannot distinguish them.
The pills are very expensive and you do not want to throw them, neither can you afford to take wrong pills. What should you do?

Solution
Take one more pill from Bottle-A. Now you have 4 pills in your hand two from each bottles. Make two groups, cut each of the 4 pills in two halves, and put one half in group-1 and other half in group-2 for each pill.
This way, the two groups have 4 half tablets, two from bottle-A and two from bottle-B. In other words, the two groups have one pill from each bottle.

Leave a Reply

Your email address will not be published. Required fields are marked *