Balls question
- netmaestro
- PureBasic Bullfrog
- Posts: 8451
- Joined: Wed Jul 06, 2005 5:42 am
- Location: Fort Nelson, BC, Canada
Balls question
You have 12 billiard balls, all the same size, color and weight except that one ball is a very slight amount heavier or lighter than the other 11. You don't know which. If you have a balance scale to weigh two objects (or groups) against each other, and it costs $1 per use, how much does it cost to identify the odd ball and specify whether it is heavy or light? Warning- this isn't an easy one.
Last edited by netmaestro on Wed Feb 22, 2006 5:12 am, edited 3 times in total.
BERESHEIT
- Joakim Christiansen
- Addict
- Posts: 2452
- Joined: Wed Dec 22, 2004 4:12 pm
- Location: Norway
- Contact:
- netmaestro
- PureBasic Bullfrog
- Posts: 8451
- Joined: Wed Jul 06, 2005 5:42 am
- Location: Fort Nelson, BC, Canada
Three is it. Just post your proof...
Last edited by netmaestro on Wed Feb 22, 2006 5:13 am, edited 2 times in total.
BERESHEIT
- netmaestro
- PureBasic Bullfrog
- Posts: 8451
- Joined: Wed Jul 06, 2005 5:42 am
- Location: Fort Nelson, BC, Canada
That won't tell whether it's heavy or light.
Last edited by netmaestro on Wed Feb 22, 2006 5:14 am, edited 2 times in total.
BERESHEIT
Here we go; take a deep breath!
Label the balls; A, B, C, D, E, F, G, H, I, J, K, L
Compare 2 groups of 4 balls. If equal weight, then the misfit is in the remaining foursome, say one of ABCD. Compare ABC with 3 normal balls, e.g. JKL. If equal, then the misfit is D and a 3rd comparison will tell us whether D is under or over weight. If ABC was not equal in weight to JKL then the 2nd comparison tells us whether one of ABC was underweight or overweight. A comparison of A and B then identifies which of A, B or C is the culprit.
This takes care of the case when the original two sets of 4 balls were of equal weight.
Now assume that they were not equal; say ABCD was unequal to EFGH. Assume also (without any loss of generality) that ABCD was of a lesser weight than EFGH.
I need a colour code now; blue for balls which could be under weight, red for balls which might be overweight, and balls which are definitely normal remain black.
Compare ABCEF with DIJKL. If equal weight, then culprit is one of GH, for which one more comparison will do it. Else, if ABCEF was underweight then the culprit is one of ABC. Comparing A and B will do it. Else, (finally) if ABCEF was overweight, then the culprit is either EF or D. Comparing EF will do it.
This accounts for every possibility!
Right, is there a prize?
Label the balls; A, B, C, D, E, F, G, H, I, J, K, L
Compare 2 groups of 4 balls. If equal weight, then the misfit is in the remaining foursome, say one of ABCD. Compare ABC with 3 normal balls, e.g. JKL. If equal, then the misfit is D and a 3rd comparison will tell us whether D is under or over weight. If ABC was not equal in weight to JKL then the 2nd comparison tells us whether one of ABC was underweight or overweight. A comparison of A and B then identifies which of A, B or C is the culprit.
This takes care of the case when the original two sets of 4 balls were of equal weight.
Now assume that they were not equal; say ABCD was unequal to EFGH. Assume also (without any loss of generality) that ABCD was of a lesser weight than EFGH.
I need a colour code now; blue for balls which could be under weight, red for balls which might be overweight, and balls which are definitely normal remain black.
Compare ABCEF with DIJKL. If equal weight, then culprit is one of GH, for which one more comparison will do it. Else, if ABCEF was underweight then the culprit is one of ABC. Comparing A and B will do it. Else, (finally) if ABCEF was overweight, then the culprit is either EF or D. Comparing EF will do it.
This accounts for every possibility!
Right, is there a prize?
I may look like a mule, but I'm not a complete ass.
hehe. 
My approach was more simplistic. Balls are A to L
1: ABCD -v-EFGH (If this balances we save a buck!)
2: EFGH -v- IJKL
3: ABCD -v- IJKL
Two of three cases the scale tips. Say it went down in steps 1 and 3 on the ABCD side, oddball is in there and heavier. Still works if it goes up in ABCD, but the ball is lighter.
4: AB -v- CD
Whichever side goes down has oddball. Say AB
5: A -v- B
If A goes down, A is it.
Save a buck if step 1 balances. Oddball is in IJKL
2: ABCD -v- IJKL, if IJKL go down, heavier, else lighter
then 4 & 5 with IJKL groups.
So $5 and 1 in 3 times, $4.

My approach was more simplistic. Balls are A to L
1: ABCD -v-EFGH (If this balances we save a buck!)
2: EFGH -v- IJKL
3: ABCD -v- IJKL
Two of three cases the scale tips. Say it went down in steps 1 and 3 on the ABCD side, oddball is in there and heavier. Still works if it goes up in ABCD, but the ball is lighter.
4: AB -v- CD
Whichever side goes down has oddball. Say AB
5: A -v- B
If A goes down, A is it.
Save a buck if step 1 balances. Oddball is in IJKL
2: ABCD -v- IJKL, if IJKL go down, heavier, else lighter
then 4 & 5 with IJKL groups.
So $5 and 1 in 3 times, $4.
@}--`--,-- A rose by any other name ..
- netmaestro
- PureBasic Bullfrog
- Posts: 8451
- Joined: Wed Jul 06, 2005 5:42 am
- Location: Fort Nelson, BC, Canada
Good job, srod. You have it. Not exactly identical to my solution, but yours is just as valid. Excellent work.
Last edited by netmaestro on Wed Feb 22, 2006 5:16 am, edited 2 times in total.
BERESHEIT
blue balls, red balls, black balls - but he said they're all the same colorsrod wrote:Here we go; take a deep breath!
Label the balls; A, B, C, D, E, F, G, H, I, J, K, L
I need a colour code now; blue for balls which could be under weight, red for balls which might be overweight, and balls which are definitely normal remain black.
Right, is there a prize?

Just kidding

But coming from me, that might not be a compliment, since I "erred" in my solution by only determining which ball was heavy or light in three tries, but not whether it was heavy or light

Congratulations anyway - looks good to me.
- netmaestro
- PureBasic Bullfrog
- Posts: 8451
- Joined: Wed Jul 06, 2005 5:42 am
- Location: Fort Nelson, BC, Canada
Alas, the only prize on offer is "Biggest Cheapskate", which is yours (if you want it!) Again, good workIs there a prize?
Last edited by netmaestro on Wed Feb 22, 2006 5:18 am, edited 2 times in total.
BERESHEIT