PDA

View Full Version : Tough brainteaser.


partygirluk
11-29-2004, 04:45 PM
You have 8 balls. You know that 7 of them weigh 500 grams. 1 of them weighs 499 or 501 grams. You do not know which is the odd one out.
All you have to help determine the black sheep is an old fashioned set of balancing scales, and three separate weighings.

Let the balls be A,B,C,D,E,F,G,H.

Outline a method which can guarantee identifying which ball weighs a different amount to the others AND whether it weighs more or less.

stabn
11-29-2004, 05:29 PM
Classic microsoft style interview question. I've already done it in the past so i won't spoil it with an answer.

cnfuzzd
11-29-2004, 05:31 PM
but i only have three balls....


you did get the weight correct though...


peace

john nickle

beerbandit
11-29-2004, 05:34 PM
thats funny because i have dos balls

cheers

morello
11-29-2004, 06:30 PM
There was a virtually identical question posted a few months ago :/

Iceman
11-29-2004, 11:10 PM
[ QUOTE ]
You have 8 balls. You know that 7 of them weigh 500 grams. 1 of them weighs 499 or 501 grams. You do not know which is the odd one out.
All you have to help determine the black sheep is an old fashioned set of balancing scales, and three separate weighings.

Let the balls be A,B,C,D,E,F,G,H.

Outline a method which can guarantee identifying which ball weighs a different amount to the others AND whether it weighs more or less.

[/ QUOTE ]

(1) ABC versus DEF.

If ABC and DEF are the same, (2) weigh G against F. If G and F are the same, then H is the outlier, and (3) weigh H against F to see if H is heavier or lighter. If G and F differ, then G is the outlier and you know if it's heavier or lighter based on what happened when you weighed it against F.

If ABC is heavier than DEF, you know GH are normal, (2) so weigh AGH against BCD. If AGH are lighter than BCD, than either B or C are the heavy one, so (3) weigh B against G to find out if B is the heavy one and if not it's C. If AGH are heavier than BCD, then either A is heavy or D is light, so (3) weigh A against G to find out which. If AGH and BCD are the same, then either E or F are the outlier and lighter, so (3) weigh E against F and the lighter one is the outlier and light.

If ABC is lighter than DEF, you know GH are normal, (2) so weigh AGH against BCD. If AGH are heavier than BCD, than either B or C are the light one, so (3) weigh B against G to find out if B is the light one and if not it's C. If AGH are lighter than BCD, then either A is light or D is heavy, so (3) weigh A against G to find out which. If AGH and BCD are the same, then either E or F are the outlier and heavier, so (3) weigh E against F and the heavier one is the outlier and heavy.

partygirluk
11-29-2004, 11:56 PM
You are wrong.
Do you see why?
I'll let others eloborate.

bugstud
11-30-2004, 12:56 AM
note that when one is heavier/lighter it's possible to be heavy or light

vegasone
11-30-2004, 07:49 AM
is there actually a solution?
with each weighing i can eliminate half the balls, but there is always an end case where it's just one ball is heavier than another.

aquifex harse
11-30-2004, 08:12 AM
OK here goes!

1) Weigh AB vs CD. If they are equal A, B, C and D are normal and the outlier is either E, F, G or H. If they are unequal then outlier is A, B, C, or D and E, F, G, H are normal. So in effect we've narrowed the field down to 4.

2) Weigh 2 'normal' balls vs 2 'unknown balls' If they balance then the two unknown balls are normal. If they don't balance one the two weighed unknown balls is the outlier. Either way you norrow the field down to two unknowns.

3) Wiegh one of the two unknown balls aganst a normal ball. If they match then the outlier is the final (unwieghed) ball. If they dont match the outlier is the wieghed unknown ball.

I hope this makes sense
aquifex

partygirluk
11-30-2004, 08:39 AM
You are wrong.
I'll elobarate.
Say you weigh AB v CD and they balance.
So the outlier is E,F,G or H.
According to your theory you now wiegh
AB v EF.
And if they balance they G or H must be the outlier.
Now you weigh G against A. If they balance, then H must be the outlier. But you don't know if H is ligther of heavier than the others.
You are close, but sadly no cigar.

aquifex harse
11-30-2004, 09:03 AM
Ok I see your point I'll try again...

1) First step as above to narrow the field four balls- A, B, C and D and four 'normal' balls N,N,N,N.

2) Weigh A, B, and C against 3 normal balls (!)
If they are equal, D is the outlier and you use the last weighing to work out if it heavier or lighter than a normal ball.

If they dont match, you know the outlier is A, B, or C ALSO you KNOW IF IT IS HEAVIER/LIGHTER THAN NORMAL!

3) Now, for the third weighing, weigh A vs B. If they are equal C is the outlier (and you know the mass). If they are unequal, because you know the mass difference of the outlier, you can identifier the outlier between A and B.

Hows that?
aquifex