File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Programming Diversions and the fly likes solve this riddle Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Other » Programming Diversions
Bookmark "solve this riddle" Watch "solve this riddle" New topic
Author

solve this riddle

Kishore Dandu
Ranch Hand

Joined: Jul 10, 2001
Posts: 1934
You've been placed on a course of expensive medication in which you are to take one tablet of medicine A and one tablet of medicine B daily.

You must be careful that you take just one of each because taking more of either can have serious side effects. Taking an A without taking a B, or vice versa, can also be very serious, because they must be taken together in order to be effective. In summary, you must take exactly one of the A pills and one of the B pills at one time.

Therefore, you open up the A bottle, and you tap one A pill into your hand. You put that bottle aside and you open the B bottle. You do the same, but by mistake, two Bs fall into your hand with the A pill.

Now, here's the problem. You weren't watching your hand as the pills fell into it, so you can't tell the A pill apart from the two B pills. The pills look identical. They are the same size, same weight, same color, same everything, and they are not marked differently in any way. What are you going to do? You cannot tell which pill is which, and you cannot afford to throw them away and start over again.

How do you get your daily dose of exactly one A and exactly one B without wasting any of the pills?


Kishore
SCJP, blog
Sameer Jamal
Ranch Hand

Joined: Feb 16, 2001
Posts: 1870
Can we break those pills into halves ?
Stefan Wagner
Ranch Hand

Joined: Jun 02, 2003
Posts: 1923

And is the number of pills in both bottles known or have they been identical?


http://home.arcor.de/hirnstrom/bewerbung
Kishore Dandu
Ranch Hand

Joined: Jul 10, 2001
Posts: 1934
There are identical pills in both boxes. THey can be cut to half(that is the clue), there is no rule stopping you from that.
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18570
    
    8

You know you have one A and two B's. So get one more A out of the bottle and you have two A's and two B's. Grind all four pills into powder and mix thoroughly. Take half of the powder today and the other half tomorrow.
Jayesh Lalwani
Ranch Hand

Joined: Nov 05, 2004
Posts: 502
Originally posted by Paul Clapham:
You know you have one A and two B's. So get one more A out of the bottle and you have two A's and two B's. Grind all four pills into powder and mix thoroughly. Take half of the powder today and the other half tomorrow.



Or Take one A out. Cut all 4 pills into half, and have half of each pill today, and the other half tommorrow.
Srinivasa Raghavan
Ranch Hand

Joined: Sep 28, 2004
Posts: 1228
Originally posted by Paul Clapham:
You know you have one A and two B's. So get one more A out of the bottle and you have two A's and two B's. Grind all four pills into powder and mix thoroughly. Take half of the powder today and the other half tomorrow.


Good Idea


Thanks & regards, Srini
MCP, SCJP-1.4, NCFM (Financial Markets), Oracle 9i - SQL ( 1Z0-007 ), ITIL Certified
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: solve this riddle