Trouble in River City

http://www.srainc.com/people/brentr/riddle-12.html

Thanks for taking a shot at the Pool ball riddle. As of 6/5/2000 only 100 people have solved it in the 25+ years I‘ve been telling this one. And most of those were in 1999.

I‘m thinking of stopping the "I‘ll check it for you service" as soon as 99 folks solve it...

New News...

6/5/2000. Well... since 100 folks have solved it... that‘s it! If you want to solve it... then just grab the perl script and run it or give it to somebody who can... Usually unix/linux types and even a few NT types can spell perl and are willing to help you. The great thing is that THEY can now tell you to stop sending creatively-formatted text and use the format provided...

The scale you are using is a balance scale. You put something on the left and something on the right and then the scale either dips to the right or left, or stays even. There is no "normal" setting or readout.

In order to check your answer, submit it in the following format: Each weighing is symbolized by 1., 2., or 3. for first, second, and third weighing.

Outcomes are symbolized by #L, #R, #= meaning left is heavy, right is heavy, or the scale balances.

Please formulate them exactly as shown below, for example "3 light" looks like: "3 -> L".

Many people send solutions... please make it less tedious for me and use the format exactly as provided. For example, don‘t subtract spaces that are there now to make things look better. And don‘t add extra stuff to make it more beautimous. Now if you‘re not supposed to commit sins of omission and you‘re not supposed to commit sins of comission, then that just about covers the possibilities, no ? :-)

Well, it should. But it doesn‘t. Why do people send things like "3 is heavy" or 3 --> Light" or "3 :: L" or other garbage? People send all kinds of crazy stuff, reformatted as though their cat were dancing on the keyboard. If your cat‘s a better typist than you, then buy "Mario Teaches Typing." Then practice, then send your solution.

Line,   Weighing #,   left balls  :  right balls

1.  1. 1 2 3 4 5 6 : 7 8 9 10 11 12

        This means weighing 1 resulted in Left side heavy..
            |   
            v

2.          1L      2. 7 8 9 : 10 11 12

 
                   Weighing 2 resulted in Left side heavy...
                    |
                    v
                    
3.                  2L      3. 4 : 8

 
                                Weighing 3 ... Left sideheavy...
                                   |
                                   v
                  
4.                                 3L      # -> H/L (i.e. Heavy or Light)
5.                                 3=      # -> H/L
6.                                 3R      # -> H/L

7.                  2=      3. # : #
8.                                 3L      # -> H/L
9.                                 3=      # -> H/L
10.                                3R      # -> H/L

11.                 2R      3. # : #
12.                                3L      # -> H/L
13.                                3=      # -> H/L
14.                                3R      # -> H/L


15.        1=      2. # : #
16.                2L      3. # : #
17.                                3L      # -> H/L
18.                                3=      # -> H/L
19.                                3R      # -> H/L

20.                2=      3. # : #
21.                                3L      # -> H/L
22.                                3=      # -> H/L
23.                                3R      # -> H/L

24.                2R      3. # : #
25.                                3L      # -> H/L
26.                                3=      # -> H/L
27.                                3R      # -> H/L

28.        1R      2. # : #
29.                2L      3. # : #
30.                                3L      # -> H/L
31.                                3=      # -> H/L
32.                                3R      # -> H/L

33.                2=      3. # : #
34.                                3L      # -> H/L
35.                                3=      # -> H/L
36.                                3R      # -> H/L

37.                2R      3. # : #
38.                                3L      # -> H/L
39.                                3=      # -> H/L
40.                                3R      # -> H/L
I have a program which takes that input and checks it for me automatically, simulating in turn each ball being lighter and heavier and seeing whether your algorithm correctly identifies the guilty ball.

Thanks to Paul & Michael for submitting a perl script scale.pl to check solutions defined in the above format. You no longer have to have the line numbers in perfect order as long as the 1st, 2nd, 3rd weighings flow top-down.

To be clear, the answer is just the 40 lines above substituted with your weighings and outcomes.

Important: To represent the notion that all balls weigh the same, use "0 -> N". ("N" as in None) Important: To represent the notion that a given outcome is not possible, use "0 -> H". Here is an example of the first 6 lines with bogus numbers, just to show clearly what the solution should look like.

This little portion shows 3 outcomes, 5 heavy, 6 light, and "all balls are equal weight."

So if the scale dipped left with the first weighing, then dipped left again when weighing balls 7 8 9 against 10 11 12, then if the third weighing (ball 4 against 8) went left, the 5 ball is Heavy. (This example makes no sense in terms of the balls, just the format...) Some folks leave off the very first "1." Notice that first line - it has a line number, plus a weighing number.

1.  1. 1 2 3 4 5 6 : 7 8 9 10 11 12
2.          1L      2. 7 8 9 : 10 11 12
3.                  2L      3. 4 : 8
4.                                 3L      5 -> H
5.                                 3=      6 -> L
6.                                 3R      0 -> N

Contact webmaster@twinbear.com
Copyright (c) 1997, 1998 Brent Neal Reeves
Last edited: early 21st Century