All about flooble | fun stuff | Get a free chatterbox | Free JavaScript | Avatars    
perplexus dot info

Home > Logic > Weights and Scales
Trickier Pearls (Posted on 2002-10-08) Difficulty: 2 of 5

Your boss liked how you solved the Tricky Pearls problem and has now given you a new one.

You have 5 bags of pearls. You are told that each bag contains either all genuine pearls, or all fake pearls. Real pearls weigh 10 grams and fake pearls weigh 9 grams.

Armed with a very precise scale, how can you figure out which bags contains the fake pearls with the fewest number of weighings?

  Submitted by Happy    
Rating: 2.5000 (4 votes)
Solution: (Hide)
This time, you want to think in binary.
Number the bags 1 to 5.
from bag 1, take 1 pearl
from bag 2, take 2 pearls
from bag 3, take 4 pearls
from bag 4, take 8 pearls
from bag 5, take 16 pearls

Let W = Weight of selected pearls (in grams)

If every bag contains genuine pearls, the total weight should be 10*(1+2+4+8+16) grams or 310 grams.

Let X = 310g - W

Now X can be viewed as a binary representation of which bag is fake. Here's how to decode it:

If X >= 16g, then bag 5 must contain fake pearls. Subtract 16g from X and continue to next step.

If X >= 8g, then bag 4 must contain fake pearls. Subtract 8g and continue.

If X >= 4g, then bag 3 is fake. Subtract 4g.

If X >= 2g, then bag 2 is fake. Subtract 2g.

If X >= 1g, then bag 1 is fake.

Comments: ( You must be logged in to post comments.)
  Subject Author Date
piece of cakeRohan Shah2004-03-31 13:39:33
I got itChaz2003-05-03 07:51:03
Re: solutionjohn2003-04-03 16:22:31
re: A much simpler solutionTomM2002-12-13 08:14:54
A much simpler solutionJimmy Bob2002-12-13 07:47:51
Less bags and more bagsTomM2002-10-08 18:09:56
Please log in:
Login:
Password:
Remember me:
Sign up! | Forgot password


Search:
Search body:
Forums (0)
Newest Problems
Random Problem
FAQ | About This Site
Site Statistics
New Comments (9)
Unsolved Problems
Top Rated Problems
This month's top
Most Commented On

Chatterbox:
Copyright © 2002 - 2024 by Animus Pactum Consulting. All rights reserved. Privacy Information