by jwwells » Sat Sep 23, 2006 8:51 am UTC
Note: The nomenclature that works best for me is to call marbles that are either heavy or normal H, call marbles that are either light or normal L, call unknown marbles U, and call definitely normal marbles N. This simplifies things, though we get long rows of H's and L's.
For example, one possible state of the 12-marble solution looks like this:
HHHHLLLLNNNN. (I know that four are either heavy or normal, four are either light or normal, and four are definitely normal.)
The other possible state after the first weighing is:
NNNNNNNNUUUU. (Which we can simplify to UUUU + N pool.)
Or, if you prefer, 4U NP. This helps me a lot.
Below is a step-by-step reasoning process that gets to the solution to the 39-marble case. It's a lot of recursion, really.
(More white text ahead:)
You can do exactly nine marbles in two weighings in the current setup, provided that the situation is either HHHHHLLLL or HHHHLLLLL.
It's easy. Weigh HHL vs. HHL, leaving HLL aside, in the first case. (In the second case, it's just LLH vs. LLH, leaving HHL aside.) No matter what the outcome, you're left with 2H 1L or vice-versa, which is solvable in one weighing. This is a variation on the same trick I used to solve the 12-case, but with 9 marbles instead of 8.
Call this the 5-and-4 trick - we can solve 5H 4L or 5L 4H in two weighings. It's going to REALLY come in handy.
For example, if we have 13 marbles and a control N, we can solve it in 3 moves by first weighing 5U vs 4U 1N, setting aside 4U. This either gives us a 5-and-4 case, or a 4-unknowns case, both of which can be solved in the remaining 2 moves.
Using the 5-and-4 trick repeatedly lets us deal with 27 marbles in three weighings, provided that the situation is either 14H 13L or 13H 14L. For example, in the 14H 13L case, divide them into these groups:
5H 4L, 5H 4L, 4H 5L
(Notice the analogy to HHL, HHL, LLH!)
And weigh the first two against each other. That takes one weighing. Then you've got two weighings left, and all of those are 5-and-4 scenarios.
If we can weigh 27 marbles, well we can solve the 40-marble set-up, right? Just weigh 14 against 13-and-a-control. This puts us in the 14-and-13 setup above and leaves us with 13 unknowns. We can deal with 13 unknowns, easy! We've got the procedure above.
Oh, wait. No control. Oh, well. You can solve the 40-case if you smuggle a normal marble in, maybe from one of the earlier problems. On the bright side, the 39-case is easy now.
Make 3 groups of 13. Weigh two against each other. If they weigh the same, we have 13U NP, our 13U-and-a-control-in-three-weighings case, solved above. Otherwise, we have 13H 13L NP. That uses one weighing.
Weighing 2: Set aside 5H 4L, and weigh 4H 4L 1N vs. 4H 5L. If the two weigh the same, we've got 5-and-4 with two weighings to go. Otherwise, we either have 4H 5L NP (5-and-4) or 4H 4L NP (4-and-4, which we split into HHL vs HHL with leftover LL - easy.) Either way, we solve it in the remaining 2 weighings.
BUT HOW DO WE DO IT WITH 41?!
Last edited by
jwwells on Sat Sep 23, 2006 9:06 am UTC, edited 1 time in total.