There are 2 pills A from bottle A and 2 pills B from bottle B. You have to take 1 pill A and 1 pill B every day, for two days, to survive. After taking 1 pill A from bottle A, you accidentally retrieved 2 pills B from bottle B. Now you have 3 indistinguishable pills in your hand (you do know that 1 out of the 3 is A and the rest are B). What's your survival strategy?
Ans:
Cut all 3 indistinguishable pills in halves (6 half-pills in total) and separate them into two piles. Make sure that each pile only contains a half from each individual pill. Now, each pile would necessarily contain 0.5 pill A and 1 pill B. Take the remaining pill A (still in bottle A) and split that in halves. We have created two "daily-doses" (the two piles) of the right composition for survival, although we still do not know which pill is which type.
Remark:
This can be trivially extended to n pills, n>2.
See here for more interview questions/brainteasers
No comments:
Post a Comment