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 Also 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 Also" Watch "Solve This Also" New topic
Author

Solve This Also

Rakesh Joshi
Ranch Hand

Joined: Feb 24, 2006
Posts: 218
The pharmacy has an old scale which has only two measuring weights 30 grams and 5 grams. How can you divide 300 grams of powder medicine into 3 groups, one 150 grams, one 100 and the other 50 grams. You can only weigh 3 times.


Life is a Game play it.
Manish Hatwalne
Ranch Hand

Joined: Sep 22, 2001
Posts: 2581

1. Keep 30 gms in one pan (pan A) of the weighing scale/balance and keep 5 gms in another (pan B). Weigh powder in pan B. So effectively you have 25 gms powder now.
2. Keep 25 gms powder & 30 gms in pan A and 5 gms in Pan B. Weigh powder in pan B. You have effectively 50 gms powder in pan B now.
3. Keep 25 gms & 50 gms powder along with 30 gms weight in pan A and 5 gms weight in pan B. Measure 100 gms powder in Pan B now.

This is your 100 gms pack at step 3. Step 2 gave you 50 gms pack. And what is left is 150 gms pwder out of 300 gms total.

- Manish
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Solve This Also