Puzzle time!
Jan. 24th, 2005 02:27 pmInsomnia makes me do odd things. Last night I decided to twist a well known puzzle to make it more evil, and then solve it, which I did. And this stopped me thinking of monsters under the bed and other scaries (I read the Nightmares and Fairy tales graphic novel yesterday, and it may have gotten to me...ooops), so was actually a good thing, I'm trying to tell myself.
Anyway, lets see which of you clever people solves this first: (all comments initially screened)
You have a balance scale and a big bag of marbles. The marbles are all identical in weight. You take 39 of the identical marbles and mix in another special marble (so 40 marbles now), which may be heavier or lighter than the others, or may not, but looks identical, so can be identified by weight alone. Allowing only 4 weighings, how can you identify whether the special marble is heavier or lighter than the others, and if so, which marble it is?
Update: Congratulations to the clever
ixwin who solved it by adding more marbles from the bag. So, lets make the problem HARDER. Assume the bag only has one more marble left in it. You have the original 40 marbles (39 identical and one special) and a bag with one more marble in it. Now solve it.
Anyway, lets see which of you clever people solves this first: (all comments initially screened)
You have a balance scale and a big bag of marbles. The marbles are all identical in weight. You take 39 of the identical marbles and mix in another special marble (so 40 marbles now), which may be heavier or lighter than the others, or may not, but looks identical, so can be identified by weight alone. Allowing only 4 weighings, how can you identify whether the special marble is heavier or lighter than the others, and if so, which marble it is?
Update: Congratulations to the clever
no subject
Date: 2005-01-24 02:47 pm (UTC)no subject
Date: 2005-01-24 02:56 pm (UTC)no subject
Date: 2005-01-24 02:56 pm (UTC)1, Weigh the whole bag - this gives you the weight of 39× + y.
2, Weigh an individual marble - this either gives you × or y.
3, Weigh another individual marble - again you either get × or y.
If 2 and 3 are the same weight then you know they were both ×, so multiply that weight by 39 - giving the weight of the 39 original marbles and subtract that from the total weight of the bag. The answer is the weight of y and you can tell from this whether × is greater than y.
If 2 and 3 are different weights then one is × and one is y, so weigh another marble to find out which one is which.
(am I anywhere close to the mark with this? am I missing something obvious? eg. 39 marbles identical in weight - doesn't mean they're identical in other respects.)
no subject
Date: 2005-01-24 03:09 pm (UTC)Clarification: It's a balance scale. You put some marbles on one tray, some others in another tray, and it either balances or one side goes up and the other side goes down. That is all it tells you.
You also need to identify which marble is the odd marble, if it is not the same weight as the others. This is the real challenge.
The marbles are all totally identical in appearance. One marble may have a different weight. You can label them 1-40 for identification purposes.
no subject
Date: 2005-01-24 03:52 pm (UTC)no subject
Date: 2005-01-24 03:53 pm (UTC)no subject
Date: 2005-01-24 03:22 pm (UTC)no subject
Date: 2005-01-24 03:39 pm (UTC)no subject
Date: 2005-01-24 03:42 pm (UTC)Okay, for each weighing you've got 3 possible outcomes - left side of the scale down, right side of the scale down, or a balance. So after 4 weighings you've got 3x3x3x3=81 possible results (e.g. balance, left, right, right) to point to 80 possible situations (i.e one each of 40 marbles, each of which might be lighter or heavier than average). So far, so good.
By the same logic, after the first weighing, you must be down to no more than 3x3x3=27 possible states, whatever the result of that first weighing.
Now the only thing that makes any sense is weighing x against x marbles. If you weight x against x and they don't balance, you know the marble is either on the lighter side and lighter, or on the heavier side and heavier, i.e. if you identify the marble from this point on, that in itself will tell you whether it's heavier or lighter. If they do balance, all you know is that the remaining marble is one of the ones not currently on the scale, and you don't yet know if it's heavier or lighter.
Therefore, if you weigh x against x marbles, and they balance, you have 2*(40-2x) possible options left (e.g. if you weigh 12 against 12, and they balance, you know the uneven marble is one of the remaining 16, but it might be either lighter or heavier i.e. you have 32 remaining possibilities and only 27 possible results, so that doesn't work. To have 27 or fewer possibilities at the end of the first weighing if they balance, you need to weigh at least 14 against 14 in the first weighing.
BUT if you weigh 14 against 14 in the first weighing, and they don't balance, you have 28 possible balls to choose from, and you can't pick one of 28 balls from 3 weighings (because of the only 3x3x3=27 possible results).
I may very well be wrong about this, but if so I'd be very interested to know why the above doesn't hold.
no subject
Date: 2005-01-24 03:52 pm (UTC)Hint: There are still more marbles in the bag.
no subject
Date: 2005-01-24 03:53 pm (UTC)no subject
Date: 2005-01-24 03:55 pm (UTC)no subject
Date: 2005-01-24 04:00 pm (UTC)If the thirteen are out of balance, weigh six against six; if they match, the thirteenth is the ringer, otherwise split the six with the ringer 3/3 and then match two of the three with the ringer.
If the 27 are out, weigh nine against nine; weigh three against three from whichever of the three nines is the ringer; weigh two of the three with the ringer.
(and I don't think your wrinkle is evil, I think it's obnoxious.)
no subject
Date: 2005-01-24 04:14 pm (UTC)no subject
Date: 2005-01-24 03:58 pm (UTC)no subject
Date: 2005-01-24 04:15 pm (UTC)no subject
Date: 2005-01-24 04:02 pm (UTC)If you've got it down to 13, and you don't know which way they balance then...(back in a minute)
no subject
Date: 2005-01-24 04:17 pm (UTC)no subject
Date: 2005-01-24 04:18 pm (UTC)So instead, weigh 9 of the 13 against 9 of known weight. If the scale doesn't balance, you're back in the previous scenario - 2 weighings to identify 1 of 9 where you already know if it's heavier or lighter.
If the scale balances you're down to 4 and so weigh 3 of them against 3 of known weight. Then you've either got 1 weighing for 1 of 3 where you know if it's heavier or lighter (same as above), or 1 known odd-one-out ball, which you can weigh against any of known weight to work out if it's heavier or lighter.
That is a very nice puzzle...
no subject
Date: 2005-01-24 04:23 pm (UTC)That was the easier version. Next assume you only have 1 spare marble in the bag to play with. It can still be solved.
no subject
Date: 2005-01-24 04:26 pm (UTC)Maybe later. I must do some actual work...
no subject
Date: 2005-01-24 04:32 pm (UTC)no subject
Date: 2005-01-24 05:40 pm (UTC)Weighing 1
Weigh 14 of the unknown against 13 of the unknown and the 1 known.
If they balance, you know it's one of the 13 not on the scales, and you can solve as the previous case (as you now know that all of the marbles on the scales are of standard weight).
If they don't balance (and assuming the side with 14 of known weight was heavier - obviously just reverse light and heavy if the reverse is true),call the ones on the heavy side, possibly-heavy marbles, and the ones on the light side possibly-light marbles. You have 14 possibly-heavy, 13 possibly-light and 14 of known standard weight.
Weighing 2
Put 5 possibly-heavy marbles and 9 possibly light marbles on the left side of the scales, and 4 possibly-light and 10 known-weight marbles on the right side. This leaves 9 possibly-heavy marbles not in this weighing.
If the scales balance, you know the odd marble is heavier and one of the 9 not currently on the scales. It reduces to the previously solved case, where you are choosing between 9 and the direction is known and you have 2 weighings left.
If the left side of the scales rises, you similarly know that the odd marble is lighter, and one of the 9 possibly lighter ones on the left side. Again, you've reduced it to the previous case.
If the right side of the scales rises, you know it's either one of the 5 possibly-heavy ones on the left hand side, or one of the 4 possibly-light ones on the right hand side. In which case, proceed to weighing 3.
Weighing 3
Put 3 of the possibly-heavy and 3 of the possibly-light on one side of the scale, and 6 of known weight on the other.
If the left side rises you know it's one of the 3 possibly-light ones on the left hand side, and likewise if it falls you know it's one of the three possibly-heavy ones on the left hand side. (either way, reducing it again to the previously solved case for the final weighing)
If it balances, you know it's one of the two possibly-heavy ones, or the one possibly-light one that were left off the scales for weighing 3. In which case, weighing 4 comprises one possibly-heavy, and one possibly-light against 2 of known weight, which gives you your final answer by the same process of deduction as used for weighing 3.
no subject
Date: 2005-01-24 06:35 pm (UTC)And for my next trick, take 120 identical marbles and the special one, and 1 more in the bag, and solve it with 5 weighings...
no subject
Date: 2005-01-24 03:47 pm (UTC)Weigh 12 against 12. This leaves 16 unweighed. If the 12s match, we have a reference marble weight; weighing 16 reference marbles against the unweighed 16 gives us the direction of the difference. If the 12s don't match, swapping out one of the 12s for the other lets us get the reference marble weight and the direction. [two weighings]
OK. We now have the bad marble narrowed down to one of 12 or 16 marbles, and know whether it's heavy or light.
If 12: Split into sixes, balance. Split the anomalous six into threes, balance. Take two of the anomalous three and balance; if the match, the third is the odd one out; if they don't, the known direction of imbalance tells us which of the tested pair is bad. [three more weighings for a total of five]
If 16: Split into eights, balance. Split the anomalous eight into fours, balance. Split the anomalous four into twos, and balance. Take the anomalous pair, balance, and use the known sign to determine which of them is bad. [four more weighings for a total of six]
no subject
Date: 2005-01-24 03:57 pm (UTC)no subject
Date: 2005-01-24 03:58 pm (UTC)WEIGHING 1
You put twenty marbles in each side. If the scale doesn't balance then the special marble is either heavier or lighter than the others.
WEIGHING 2
You lay marbles 1-20 aside.
You put marbles 21-30 in one side of the balance
You put marbles 31-40 in the other side.
If they balance, then go to 'weighing 3a'. If they don't, go to 'weighing 3b'.
WEIGHING 3a
Discard marbles 21-30 altogether and put marbles 1-10 in their place.
If marbles 1-10 weigh more than marbles 31-40, then the special marble is heavier.
If marbles 1-10 weigh less than marbles 31-40, then the special marble is lighter.
If they weigh the same, go to 'weighing 4a'
WEIGHING 3b
Lay marbles 31-40 aside.
Put marbles 1-10 in their place.
If marbles 21-30 are heavier than marbles 1-10 then the special marble is heavier.
If marbles 21-30 are lighter than marbles 1-10 then the special marble is lighter.
If they weigh the same, go on to weighing 4b.
WEIGHING 4a
Discard marbles 1-10, and repeat 'weighing 3a' using marbles 11-20 instead of them.
If marbles 11-20 weigh more than marbles 31-40, then the special marble is heavier.
If marbles 11-20 weigh less than marbles 31-40, then the special marble is lighter.
If they weigh the same then something has gone wrong!
WEIGHING 4b
Discard marbles 1-10, and repeat 'weighing 3b' using marbles 11-20 instead of them.
If marbles 11-20 weigh more than marbles 31-40, then the special marble is lighter.
If marbles 11-20 weigh less than marbles 31-40, then the special marble is heavier.
If they weigh the same then something has gone wrong!
Couldn't it be done in three weighings, leaving off weighing one? I'm sure I'm missing something here (and if I'm right, I bet there's a less long-winded way of expressing it.)
no subject
Date: 2005-01-24 04:04 pm (UTC)no subject
Date: 2005-01-24 04:07 pm (UTC)no subject
Date: 2005-01-24 04:12 pm (UTC)(Orwell taught me everything I need to know...)
no subject
Date: 2005-01-24 04:01 pm (UTC)(I still think I win due to the ambiguity though!)
no subject
Date: 2005-01-24 04:05 pm (UTC)no subject
Date: 2005-01-24 04:07 pm (UTC)no subject
Date: 2005-01-24 04:10 pm (UTC)no subject
Date: 2005-01-24 06:25 pm (UTC)In each case, we want to partition state space exactly in three.
Start by weighing 1-14 vs 15-27 + spare
If they balance, then either the 40th ball is of the same weight as the others (1 case), or one of 28-40 is either heavier (13) or lighter (13) than the others, and we've reduced to one of the cases from the original problem - 13 unknown balls.
If the left side goes down, then weigh 1-5,15-18 vs 6-10,19-22
If these balance, then either one of 11-14 is heavier, or one of 23-27 is lighter (4+5 = 9 cases)
If the left side goes down, then either one of 1-5 is heavier, or one of 19-22 is lighter (5+4 = 9 cases)
If the right side goes down, then either one of 6-10 is heavier, or one of 15-18 is lighter (5+4 = 9 cases)
Suppose the first of these cases. Then weigh 11,12,23 vs 13,14,24.
This divides into (balanced) 25 light, 26 light, or 27 light; (left down) 11 heavy, 12 heavy or 24 light; (right down) 13 heavy, 14 heavy, 23 light.
In the first case, weigh 25 vs 26, as in the original. In the second and third cases, weigh the two potentially heavy marbles against each other.
Similarly for the other branches, which I won't work out here to save my remaining vestigial sanity, but where the same procedure holds.
no subject
Date: 2005-01-24 06:39 pm (UTC)no subject
Date: 2005-01-24 05:44 pm (UTC)Joe
no subject
Date: 2005-01-24 06:41 pm (UTC)no subject
Date: 2005-01-25 09:59 am (UTC)Incidentally, how about finding the odd marble from 41, given it definately does weigh more or less than the others and you have a spare good marble.
Also, I've got a special puzzle for you and any physicists you know -
If you have an n dimensional hypercube of 1 ohm resistors, where each edge of the hypercube is a resistor, what is the resistance between the two opposite corners?
Joe
no subject
Date: 2005-01-25 10:57 am (UTC)no subject
Date: 2005-01-24 09:42 pm (UTC)no subject
Date: 2005-01-24 09:48 pm (UTC)no subject
Date: 2005-01-24 10:19 pm (UTC)no subject
Date: 2005-01-24 11:38 pm (UTC)no subject
Date: 2005-01-27 08:54 pm (UTC)Is there a formula for the maximum number of marbles you can sort out for N uses of the scales?
no subject
Date: 2005-01-28 12:22 am (UTC)Formula is easy to work out - each use of the scale has 3 possible results (balanced, left side down or right side down), so N uses of the scales gives 3^N possible results. Now if there are M marbles, there are M results where a marble is heavier, and M results where a marble is lighter, and also the single possible case where the special marble is the same weight as all the others. Hence we must have that 3^N = 2M+1, which we can rearrange to get the formula for the number of marbles M = (3^N - 1)/2 (which correctly gives M=40 when N=4).
I must sound like a maths teacher. Forgive me.
Anyway, I'm wondering who you are. Have I met you on my wanderings in Cambridge or not?