Skip to main content
The National Cipher Challenge

The Sunday Puzzle Thread

Tagged: ,

Viewing 3 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 1 week, 1 day 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
      
Viewing 3 reply threads
  • You must be logged in to reply to this topic.
Report a problem