Wednesday, March 30, 2011

Pills Puzzle



A person was prescribed to take two pills (tablets), one each, from the two bottles viz. Bottle A and Bottle B, daily. The tablets are exactly look alike.

The medicines have to be taken exactly one tablet from each bottle, neither less nor more, else the medicines will not be effective.

One fine day, the patient popped out one tablet from Bottle A, but while taking the tablet from bottle B, by mistake, two tablets spilled over. Now he has three tablets in his hand, and he can't put back the extra tablet to Bottle B as all the tablets are identical in looks.

He has to ensure that he takes exactly one tablet from each of the bottle and at the same time he must avoid any wastage of the medicine.

Constraints:
1. Both bottles have equal number of tablets, say 30.
2. Tablets from both the bottles look exactly identical.
3. Medicine is very costly, so any kind of wastage is not affordable.

Problem Statement: How would you ensure that, in the above situation, you take exactly one tablet from each bottle, at the same time ensuring no wastage of the medicine.


Answer

- Take (1) Pill A from the bottle and add it to the 3 unknown pills. You now have (2) Pill A and (2) Pill B in your pile.
- Take each of the 4 pills and cut them in half.
- For each pill, put one of the halves in a pile on the right and one of the halves in a pile on the left.
- Each pile now contains 2 halves of Pill A and 2 halves of Pill B, which is the same as (1) Pill A and (1) Pill B in each pile.

2 comments:

Anonymous said...

Google is asking this in their interview process as of 05/2012

Vijesh Jain said...

Hey since u dont know that the 3 pills are of which bottles....
so if u take 1 pill from bottle A ... so it might add 3 pills of bottle B and one pill of bottle A.!!!