This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Java Interview Guide and have Anthony DePalma on-line!
See this thread for details.
The moose likes Meaningless Drivel and the fly likes Another puzzle Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Other » Meaningless Drivel
Bookmark "Another puzzle" Watch "Another puzzle" New topic

Another puzzle

Thomas Paul
mister krabs
Ranch Hand

Joined: May 05, 2000
Posts: 13974
In front of you are 10 sacks containing 25 gold coins each. Each gold coin weighs exactly 1 oz. One of the sacks actually contains counterfeit gold coins. The counterfeit coins weigh 1.1 oz.
Also in front of you is a penny scale. This is the type of scale that you put a penny in and it gives you back a card telling you what something weighs. The scale is accurate to .1 oz.
You have one penny. Using the scale and your one penny, how do you determine which sack contains the counterfeit gold?
[ May 07, 2002: Message edited by: Thomas Paul ]

Associate Instructor - Hofstra University
Amazon Top 750 reviewer - Blog - Unresolved References - Book Review Blog
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944

Good one.. take 1 coin from the first bag, 2 from the second, 3 from the third .. and 10 from the tenth bag.
Stack these coins separatly on your penny scale, plonk in your penny and measure it. The weight will be xx.yy oz
if yy is 1, it means that you had 1 counterfeit coin weighing 1.1, so bag 1 is the culprit, .2 means you had 2 bad coins, so bag 2 is the culprit and so on...

[ May 07, 2002: Message edited by: Thomas Paul ]
Shubhrajit Chatterjee
Ranch Hand

Joined: Aug 23, 2001
Posts: 356
Take one from first sack , two from second ....
10 from tenth
If all were correct, it would weigh 1+2+... = 55
If nth sack is faulty then it would weigh
55 + .1n
Now find out n

I agree. Here's the link:
subject: Another puzzle
It's not a secret anymore!