fluffymark: (Default)
[personal profile] fluffymark
Insomnia 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 [livejournal.com profile] 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.

Date: 2005-01-24 02:47 pm (UTC)
From: [identity profile] fluffymormegil.livejournal.com
Ooof. That one's bad enough with a rather smaller number of marbles.

Date: 2005-01-24 02:56 pm (UTC)
karen2205: Me with proper sized mug of coffee (Default)
From: [personal profile] karen2205
Umm - how about

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.)

Date: 2005-01-24 03:52 pm (UTC)
deborah_c: (Default)
From: [personal profile] deborah_c
For further clarification: are you required to work out which of "lighter" or "heavier" the odd marble is, assuming that it is one of them, or simply that it is different from the others?

Date: 2005-01-24 03:22 pm (UTC)
zotz: (Default)
From: [personal profile] zotz
I can see how to narrow it down to five and know whether the ringer's lighter or heavier, but I can't see how to get further in only four weighings. I think I could maybe get that far in three, actually, but narrowing it down past 5 remains a problem.

Date: 2005-01-24 03:42 pm (UTC)
From: [identity profile] ixwin.livejournal.com
My initial reasoning suggests it isn't possible for the following reason.

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.

Date: 2005-01-24 04:00 pm (UTC)
From: [identity profile] fluffymormegil.livejournal.com
Thirteen, against thirteen from the bag, gives either a pool of thirteen to chop, or a pool of 27, and reveals the direction.
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.)

Date: 2005-01-24 03:58 pm (UTC)
From: [identity profile] ixwin.livejournal.com
...in which case, you can start by weighing 27 of the 40 against 27 of the others in the bag. That gives you either 27 where you know which of heavier or lighter the marble is (if the scales don't balance), or 13 where you don't (i.e. 26 possibilities) (if they do).

Date: 2005-01-24 04:02 pm (UTC)
From: [identity profile] ixwin.livejournal.com
Then, if you've got it down to 27 and you know one of them's lighter (obviously exactly the same would apply for heavier), it's 9 against 9 to get which 9 it's in, then of that 9 3 against 3 to get which 3 it's in, and then of that 3, 1 against 1. In each case, it's whichever end of the scales tip up, if they're unbalanced, and the ones not on the scales if they do balance.

If you've got it down to 13, and you don't know which way they balance then...(back in a minute)

Date: 2005-01-24 04:18 pm (UTC)
From: [identity profile] ixwin.livejournal.com
...then you're back in the same bind that weighing them against each other will give you more than 9 possibilities from some results.

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...

Date: 2005-01-24 04:26 pm (UTC)
From: [identity profile] ixwin.livejournal.com
Now that is evil.

Maybe later. I must do some actual work...

Date: 2005-01-24 05:40 pm (UTC)
From: [identity profile] ixwin.livejournal.com
Okay, having done some work...

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.

Date: 2005-01-24 03:47 pm (UTC)
From: [identity profile] fluffymormegil.livejournal.com
I can't do four. Here's how to do it in a maximum of six.
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]

Date: 2005-01-24 03:58 pm (UTC)
From: [identity profile] the-alchemist.livejournal.com
OK, this seems obvious to me. Tell me what I'm doing wrong! *wince*

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.)

Date: 2005-01-24 04:07 pm (UTC)
From: [identity profile] the-alchemist.livejournal.com
I still think I win. My superior English-studenty sentence-parsing skills cut through the Gordian Knot of your mathematical cunning.

Date: 2005-01-24 04:01 pm (UTC)
From: [identity profile] the-alchemist.livejournal.com
Hmm... looking at the other comments, I think I might have misinterpreted the question. You said: "how can you identify whether the special marble is heavier or lighter than the others, and if so, which one it is?" I interpreted "which one" as meaning "which one:heavier or lighter?" but perhaps you meant which one of the marbles, which would be much more difficult. Clarify?

(I still think I win due to the ambiguity though!)

Date: 2005-01-24 04:07 pm (UTC)
From: [identity profile] fluffymormegil.livejournal.com
Overall: I think the use of "big" is bad; it fails to make clear that there are an arbitrarily large number of extra marbles available.

Date: 2005-01-24 06:25 pm (UTC)
deborah_c: (Default)
From: [personal profile] deborah_c
(We got to the first solution a little after [livejournal.com profile] ixwin, but I have been trying to work as well.)

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.

Date: 2005-01-24 05:44 pm (UTC)
From: (Anonymous)
After the first weighing of 1..14 and 15..27+known good one you've got tons of known good marbles anyway?

Joe

Date: 2005-01-25 09:59 am (UTC)
From: (Anonymous)
I'd seen it for 12 and 13 before, so I knew the naughty trick with the spare marble. Once you know that you've just got to work it down.

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

Date: 2005-01-24 09:42 pm (UTC)
From: [identity profile] feanelwa.livejournal.com
I'm not allowed to pick them up one by one and guess, am I?

Date: 2005-01-24 10:19 pm (UTC)
From: [identity profile] feanelwa.livejournal.com
If it's only different by the mass of one atom, and assuming the marbles are all of the same size, then the increment in density is negligible or can be put down to experimental error, the extra marble is the same as all the others and it is a trick question.

Date: 2005-01-27 08:54 pm (UTC)
From: [identity profile] dreamfracture.livejournal.com
Ahh. Done it for the version with 40 and only one spare marble. I'm not sure I feel like writing out the full solution, it would take forever...

Is there a formula for the maximum number of marbles you can sort out for N uses of the scales?
Page generated Dec. 28th, 2025 04:02 pm
Powered by Dreamwidth Studios