Skip to main content
The National Cipher Challenge

The Sunday Puzzle Thread

Viewing 10 reply threads
  • Author
    Posts
    • #154883
      harry
      Keymaster

      A place to discuss the solutions to the Sunday puzzles. We will hold back your posts until we publish the solutions, which, with a change of plan, we will now do on the Saturday after the puzzle is posted.
      Harry

      PS, we post the Sunday puzzles in the News feed on Sunday mornings. The first one is up now

      • This topic was modified 2 weeks, 2 days ago by Harry. Reason: Add info about current Sunday puzzle
    • #154945
      ByteInBits
      Participant

      SUNDAY PUZZLE #1 = Additive Alphametic
      ————————————————

      
       DATA
      +DATA
      =====
      FACTS
      
      For the alphametric with no leading zero allowed
      assuming base 10, there is 1 unique solution.
      
      -----------------------------------------------
      SOLUTION IN BASE 10
      
      Letter number values
       A  S  T  C  D  F 
       7  4  9  5  8  1 
      
       8797
      +8797
      =====
      17594
      
      SOLUTION IN BASE 10 IF LEADING ZERO ALLOWED
      
      Letter number values
       A  S  T  C  D  F 
       7  4  9  5  3  0 
      
       3797
      +3797
      =====
      07594
      
      -----------------------------------------------
      A SOLUTION IN BASE 9
      
      Letter number values
       A  S  T  C  D  F 
       6  3  8  4  7  1 
      
       7686
      +7686
      =====
      16483
      
      A SOLUTION IN BASE 9 IF A LEADING ZERO IS ALLOWED
      
      Letter number values
       A  S  T  C  D  F 
       7  5  8  6  3  0 
      
       3787
      +3787
      =====
      07685
      
      -----------------------------------------------
      A SOLUTION IN BASE 8
      
      Letter number values
       A  S  T  C  D  F 
       5  2  7  3  6  1 
      
       6576
      +6576
      =====
      15372
      
      -----------------------------------------------
      A SOLUTION IN BASE 7 IF A LEADING ZERO IS ALLOWED
      
      Letter number values
       A  S  T  C  D  F 
       5  3  6  4  2  0 
      
       2562
      +2562
      =====
      05463
      
      ------------------------------------------------------------
      Care to solve the unique base 10 solution for the following?
      
       CROSS
      +ROADS
      ======
      DANGER
      

      [Posted 03th September 21:25, Harry]

      • #158487
        Robb27
        Participant

        @ByteInBits

        I like this problem!

        1) D is straightforward:
        D = 1, given the carry from C + R = A

        2) We can quickly infer information about S and R:
        S + S = R implies R = [0, 2, 4, 6, 8] but we don’t know if there is a carry, and hence if these are from low values [0+0, 2+2, 3+3, 4+4] or high values [5+5, 6+6, 7+7, 8+8, 9+9] for S.

        S cannot be 0 otherwise S + S = R would mean S = R which is not allowed.
        S is not 5, if it was then R = 0. C + R = A must give a carry to get D. Therefore C would have to be 9 but require carry from R + O = N. The carry would only make C(=9) + R(=0) + 1 = 10 meaning A = 0 which is a contraction as R = 0.

        This reduces the possible values of R to [2, 4, 6, 8]

        S is not 9, if it was then R = 8, and there will be a carry so that S + D + 1 = E, giving S(=9) + (D=1) + 1 = 11, i.e. E = 1 which is a contraction as D = 1.

        This reduces the possible values of S to [2+2, 3+3, 4+4] or high values [6+6, 7+7, 8+8].

        3) At this point we have to up our logic game:
        Assume S = 2 and therefore R = 4
        Looking at C + R = A then C + 4 must be >= 10 to give a carry to get D, and noting that there may or may not be a carry from R + O = N too.
        C must be at least 5 and requires a carry. However,
        C is not 5 as with carry implies A = 0, but then O + A(=0) = G implies A = G which is not allowed.
        C is not 6 as without carry from R + O = N this implies A = 0, but then O + A(=0) = G implies A = G which is not allowed.
        C is not 6 as with carry from R + O = N this implies A = 1 which is a contradiction as D = 1.
        C is not 7 as without carry from R + O = N this implies A = 1 which is a contradiction as D = 1.
        C is not 7 as with carry from R + O = N this implies A = 2 which is a contradiction as S = 2
        C is not 8 as without carry from R + O = N this implies A = 2 which is a contradiction as S = 2
        C is not 8 as with carry from R + O = N this implies A = 3, but S(=2) + D(=1) = E = 3 which is a contradiction.
        C is not 9 as without carry from R + O = N this implies A = 3, but S(=2) + D(=1) = E = 3 which is a contradiction.
        C is not 9 as with carry from R + O = N this implies A = 4 which is a contradiction as R = 4
        Hence, there are no valid solutions for S = 2

        4) We can repeat this logic (I leave that to you to do) and thankfully we quickly find a valid solution where S = 3 and R = 6
        CROSS = 96233
        ROADS = 62513
        DANGER = 158746
        with C=9, R=6, O=2, S=3, A=5, D=1, N=8, G=7, E=4.

        We can also write a Python program to generate valid solutions, and actually find that this is the only valid solution (in base 10 😉 @ByteInBits I haven’t checked any other bases, but as we have 9 unique letters, then Base 10 is the lowest base)

        from itertools import permutations
        
        letters = "CROSADNGE"
        count = 0
        
        for digits in permutations(range(10), len(letters)):
            value = dict(zip(letters, digits))
            if value["C"] == 0 or value["R"] == 0:
                continue
        
            cross = (10000 * value["C"] + 1000 * value["R"]
                     + 100 * value["O"] + 11 * value["S"])
            roads = (10000 * value["R"] + 1000 * value["O"]
                     + 100 * value["A"] + 10 * value["D"] + value["S"])
            danger = (100000 * value["D"] + 10000 * value["A"]
                      + 1000 * value["N"] + 100 * value["G"]
                      + 10 * value["E"] + value["R"])
        
            if cross + roads == danger:
                count += 1
                print(f"{cross} + {roads} = {danger}")
                print(value)
        
        print(f"Total solutions: {count}")
    • #156824
      ByteInBits
      Participant

      Others posted (unseen) answers in their own threads before this
      thread went up, as the hashtag numbers show they were in the
      following order of submit.

      Pos Hashtag Participant
      1st #153274 Krishie-Ramnath
      2nd #153861 Robb27
      3rd #154945 ByteInBits

      Unlike myself they answered in full so go read their entries 😉
      The official answer will be in the NEWS along with another puzzle from Harry on Sunday morning.

    • #158756
      ByteInBits
      Participant

      @Robb27 You are correct on all points.
      If you wish to amuse yourself further:
      TRY DOUBLING UP FOR DANGER
      You should get 8 answers 6 with C,R,D not equel to zero, 2 answers with D or R = zero
      One of the answers is zero free for all letters! What is it?

      
       CROSS
       ROADS
       CROSS
      +ROADS
      ======
      DANGER
      
      • #162402
        Robb27
        Participant

        @ByteInBits
        Took a little while to work these through by hand, but I then checked with a simple adjustment to my previous python program.
        I won’t write out the logic for each, there is too much, however, I have included one…

        12933 + 29803 = 85472
        C=1, R=2, O=9, S=3, A=8, D=0, N=5, G=4, E=7

        This was probably the easiest, started by assuming D=0, then 2C+2R <=9, hence C and R can only be 2*3 + 2*1 or 2*2 + 2*1 Given that R must be even as 4S=R, then C=1 and R=2.

        The are only two values of S that give R=2, they are S = 3 (=12) and S = 8 (=32).
        As D=0, then 2S + 2D = E gives E either 2*3 + 0 + 1 carry = 7 or 2*8 + 0 + 3 carry = 9 with 1 carry.

        As 0, 1 & 2 are taken, O is at least 3, meaning 2R + 2O = N is at least 10 hence there will be a carry. As O could be 9 then the carry is either 1 or 2, but not 3, and leaving A as either [7, 8].

        Lets look at O in 2R + 2O = N
        O is not 3, 2R+2O=10 hence A=7 and N is notionally 0. Then 2O + 2A = 20, this mean N is now 2, which is a contradiction with R.
        O is not 4, 2R+2O=12 hence A=7 and N is notionally 2. Then 2O + 2A = 22, this mean N is now 4, which is a contradiction with O.
        O is not 5, 2R+2O=14 hence A=7 and N is notionally 4. Then 2O + 2A = 24, this mean N is now 6 which is OK and G is notionally 4. As A=7, S can’t be 3, so must be 8. E = 9 which is ok but carries 1 over to G making G = 5, which is a contradiction with O.
        O is not 6, 2R+2O=16 hence A=7 and N is notionally 6. Then 2O + 2A = 26, this mean N is now 8 which is ok and G is notionally 6. As A=7, S can’t be 3, so must be 8. E = 9 which is ok but carries 1 over to G making G = 7 which is a contradiction with A.
        O is not 7, 2R+2O=18 hence A=7 which is a contradiction with O.
        O is not 8, 2R+2O=20 hence A=8 which is a contradiction with O.

        Therefore O must be 9
        Checking 2R+2O=22 hence A=8 and N is notionally 2. Then 2O + 2A = 34, this means N is now 5 which is ok and G is notionally 4. As A=8, S can’t be 8, so must be 3. E = 7 which is ok. There is no carry so G = 4 which is also good.

        We have a solution 12933 + 29803 = 85472 with C=1, R=2, O=9, S=3, A=8, D=0, N=5, G=4, E=7

        The rest are found using similar logic:
        54911 + 49021 = 207864
        C=5, R=4, O=9, S=1, A=0, D=2, N=7, G=8, E=6

        72033 + 20813 = 185692
        C=7, R=2, O=0, S=3, A=8, D=1, N=5, G=6, E=9

        74166 + 41326 = 230984
        C=7, R=4, O=1, S=6, A=3, D=2, N=0, G=9, E=8

        76399 + 63829 = 280456
        C=7, R=6, O=3, S=9, A=8, D=2, N=0, G=4, E=5

        76844 + 68924 = 291536
        C=7, R=6, O=8, S=4, A=9, D=2, N=1, G=5, E=3

        80355 + 3615 = 167940
        C=8, R=0, O=3, S=5, A=6, D=1, N=7, G=9, E=4

        94711 + 47821 = 285064
        C=9, R=4, O=7, S=1, A=8, D=2, N=5, G=0, E=6

    • #157299
      Robb27
      Participant

      Sunday puzzle 2: A bug in the system
      The shortest distance is a straight line. If you imagine the hall is a box and you ‘flatten the box out’ to a 2D layout, the spider is 6m vertically and 26m horizontally from the bug. Pythagoras tells us that the shortest route, which is the hypotenuse, is ~26.68m = SQRT(26^2 + 6^2).

    • #157362
      ByteInBits
      Participant

      Sunday Puzzle number 2

      
      The shotest route is 30.46309 metres
      
      The course is different and the distance shorter than
      'common sense' would suggest. This can be verified by
      constructing a simple three dimensional model and
      opening it up like so:
      
      south          20m
      --------------------------------
      |      |                       |
      |    A |      ceiling          | 6m
      |      |                       |
      -------------------------------- Draw a strait line from A to B (Hypotenuse)
        8m   |                       | The Path spider takes (H)
          6m |      wall             |
             |                       |  8m
             --------------------------------
             |                       |      |
           c |      floor            |    B | Draw lines A to c and B to c
             |                       |      | to form a right triangle
             --------------------------------
             |                       | north
             |      wall             |
             |                       |
             -------------------------
      
      Mark the begging point A and end point B, now draw a strait line between
      them this will be the hypotenues H, if we draw two right angle lines from A 
      and B to c we form a right angled triangle, study of the distances the lines
      encompose we get:
      
      Line A = 3 + 6 + 3 = 12 metres
      Line B = 1 +20 + 7 = 28 meters
      To find the H : squreroot of ( 12^2 + 28^2 ) = 30.46309 metres
      
      This being the shortest distance between two given points.
      
    • #157356
      ByteInBits
      Participant

      Sunday puzzle number 2 : *** QUERY ***

      Harry, are you expecting an integer answer to your variation of this?

      I think normally this puzzle is set with dimensions that give an integer.
      I remember doing this puzzle many years ago though it was slightly
      different in that both the start and end positions were 1 metre from
      ceiling. Either way it is done I don’t get an integer.

      As an exsample here is a simular problem and my answer:

      Room 30 metres long, 12 metres wide and 12 metres high.
      Start middle of 12 metre wall, 1 metre below ceiling.
      End middle of opposite wall, 1 metre below ceiling.

      Answer is 40 metres

    • #162160
      ByteInBits
      Participant

      OOPS I got the 6m and 8m transposed 🙁

    • #162228
      ByteInBits
      Participant
      
      No, no, no, wait a mo, transposing the 8m and 6m was not at fault but
      I did missplace the sensor.
      
      My answer is now 25.0599m NOT same as Harry's - Help,
      
      Harry gave squreroot of ( 10^2 + 24^2 ) = 24
      I'm at a loss as to how ?
      
      I do not understand where the 10m and 24m comes from. Please enlighten me.
      
      constructing a simple three dimensional model and
      opening it up like so:
      
      and using the given dimensions:
      20 metres long
      6 metres wide
      8 metres high
      
      south
         8m          20m
      ------------------------------
      | <---    |   ceiling          |
      |       A*|********************| 6m
      |wall   . |                    |           Diagram not to scale.
      --------.-----------------------      <--- direction down to floor of wall
              . |                    |      *** strait path of spider = 1+20+7 =28m
              . |6m    wall          |      ... lines of AC and CB right triangle of AB
              . |                    |  8m   Remember A and B are in the Middle of wall.
              . -------------------------------     AC = 3+6+3 = 12m
              . |      floor         | <---   |     CB = 1+20+1= 22m
              C.|....................|.B******| 6m  AB line not drawn
                |                    |    wall|     AB = sqrt(12^2+22^2) = 25.0599m
                -------------------------------     so 3m less than *** route.
                |                    |    north
                |      wall          |
                |                    |
                ----------------------
      
      
    • #162388
      Robb27
      Participant

      @ByteInBits
      I was humbled too, I missed the ceiling to floor fold. I have borrowed and adjusted your diagram. Hope this now makes sense?

      Diagram not to scale.

      6m 20m
      ——————————–
      |wall 3m->| * Wall |
      | A | | 7m | 8m
      | . | | | 6m
      —–.——-*—————————
      . | ^ | > 1m |
      . | | 3m | |
      C….|..*……………..|.B | 8m
      | floor | |
      ——————————-

      … lines of AC and CB right triangle of AB
      AC = 7+3 = 10m
      CB = 3+20+1 = 24m
      AB = sqrt(10^2+24^2) = 26m

      • #162405
        Robb27
        Participant

        Lets retry that diagram with code tags!

        
            6m             20m
        --------------------------------
        |wall 3m->|  *    Wall         |
        |    A    |  | 7m              | 8m
        |    .    |  |                 |   6m
        -----.-------*---------------------------
             .    |  ^                 | > 1m   |
             .    |  | 3m              |        |  
             C....|..*.................|.B      | 8m
                  |      floor         |        |
                  ------------------------------- 
    • #162483
      ByteInBits
      Participant

      @Robb27 Thanks.

Viewing 10 reply threads
  • You must be logged in to reply to this topic.
Report a problem