Skip to main content
The National Cipher Challenge

The Sunday Puzzle Thread

Viewing 27 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 month, 2 weeks 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.

    • #162911
      Robb27
      Participant

      Sunday puzzle 3: One rotten apple (doesn’t necessarily spoil the barrel)

      I had to dust off memory for this one, so I hope I have remembered correctly. I do remember that there are two types of parity checking; Even and Odd. It is not clear which one applies. This is usually agreed in advance of sending messages. I have answer using both as both gave me an answer I could reason logically. That said, I think the answer was probably expecting Even parity, as you will see from my reasoning.

      Even parity checking:
      – Gold checks 1, 2 and 7 = 3 and even parity places a 1 in 4.
      – Blue checks 1, 3 and 7 = 3 and even parity should place a 1 in 5, but there is a 0.
      – Red checks 2, 3 and 7 = 3 and even parity should place a 1 in 6 but there a 0.

      Logic tells me that the wrong bit must belong to Blue and Red but not Gold, hence bit 3 must be wrong.
      The correct original seven-bit message was 1101001.
      The four-bit message, having removing the error checking bits 4, 5 and 6, is therefore 1101.

      Odd parity checking:
      – Gold checks 1, 2 and 7 = 3 and odd parity should place a 0 in 4, but there is 1.
      – Blue checks 1, 3 and 7 = 3 and odd parity places a 0 in 5.
      – Red checks 2, 3 and 7 = 3 and odd parity places a 0 in 6.
      Blue and Red are correct but not Gold. There could be an issue with bit 1 or 2, but if either of them was changed then the Blue or Red check would then fail meaning another bit is also wrong. Whilst it is possible for more than a single bit to be wrong, we are told that exactly one bit was changed. Therefore, with odd parity checking, bit 4 must be wrong.

      The correct original seven-bit message was 1110001.
      The four-bit message, having removing the error checking bits 4, 5 and 6, is therefore 1111.

    • #163923
      ByteInBits
      Participant

      Hi @Robb27,
      I have only now (5 days later) seen your post #162402

      You really are a good logician, love the way you work it through, and
      of course you are right with all 8 answers, including the one with no
      zeros (your 6th answer.)

      I did not properly understand this weeks puzzle 3, so I had to give it a miss.

    • #164029
      ByteInBits
      Participant

      Sunday Puzzle 4 – Mind the gap

      Solve done manually.
      Spreading it out from 2×8 to 1×16 makes for easier solving.
      For spacing reasons 10 to 16 (double digits) replaced with A to G.

      •1•2•3•4•5•6•7•8•9•A•B•C•D•E•F•G• Position
      •-•8•-•-•-•6•-•-•5•-•-•-•-•1•-•-• Channels Given
      •3•8•4•7•3•6•2•4•5•2•8•7•6•1•5•1• MY SOLVE

      Pairing radio units
      ====================
      Channel••Hansets
      1 •••••• 14 & 16 (E,G)
      2 •••••• 7 & 10 (7,A)
      3 •••••• 1 & 5
      4 •••••• 3 & 8
      5 •••••• 9 & 15 (9,F)
      6 •••••• 6 & 13 (6,D)
      7 •••••• 4 & 12 (4,C)
      8 •••••• 2 & 11 (2,B)

    • #164727
      Holmium
      Participant

      I think:

      Sunday puzzle 4: Solution

      Requirement and given answer:
      ?, 8, ?, ?, ?, 6, ?, ?, 5, ?, ?, ?, ?, 1, ?, ?
      3, 8, 4, 7, 3, 6, 2, 4, 5, 2, 8, 7, 6, 1, 5, 1.

      Assumptions:
      The 8 in position 2 forces the other 8 into position 11. Correct
      The 6 in position 6 forces the other 6 into position 13. Correct
      The 5 in position 9 forces the other 5 into position 15. Incorrect – it can also go in position 3.
      The 1 in position 14 forces the other 1 into position 16. Incorrect – it can also go in position 12.

      The above gives four possible solutions:

      3, 8, 4, 7, 3, 6, 2, 4, 5, 2, 8, 7, 6, 1, 5, 1
      2, 8, 5, 2, 4, 6, 7, 3, 5, 4, 8, 3, 6, 1, 7, 1
      3, 8, 5, 2, 3, 6, 2, 7, 5, 4, 8, 1, 6, 1, 4, 7
      2, 8, 3, 2, 4, 6, 3, 7, 5, 4, 8, 1, 6, 1, 5, 7

    • #164737
      BruceForce
      Participant

      I propose that the elf that created SP#4 and the elf that wrote its solution be put to the test.

      • This reply was modified 3 weeks, 5 days ago by Harry.
      • This reply was modified 3 weeks, 5 days ago by Harry.
      • #164743
        Holmium
        Participant

        Assuming my previous post was correct, which is a big assumption given my age matches the atomic number of my display name and my eyes grow dim…

        I would suggest the follow-up question …

        Can you find a positioning solution for SP#4 with radio 1 in position 8 and radio 2 in position 5, but no other constraints, other than that of the previously prescribed radio pair separations, for all radios 1 through 8?

    • #164846
      Robb27
      Participant

      @Harry/@Eleves has my #164091 been missed, or is there another reason it is still in moderation?

      • #164849
        harry
        Keymaster

        Not sure, I will check with the elves (they have been out on launch drill ready for Christmas Eve so I can’t ask today)

      • #164865
        Elf_on_the_Shift
        Keymaster

        Should be approved now!

    • #164091
      Robb27
      Participant

      Sunday puzzle 4: Mind the gap

      @Harry
      … the answer doesn’t appear unique? If I am wrong, I am not sure where my logic, or programming, is incorrect.

      With unit 8 in position 2 that means the other unit 8 must be in position 11
      With unit 6 in position 6 that means the other unit 6 must be in position 13

      So now we have
      Position: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16
      Channel : ?, 8, ?, ?, ?, 6, ?, ?, 5, ?, 8, ?, 6, 1, ?, ?

      The rest we have to figure by looking for contradictions using the possible positions noted in the diagrams below.

      The right hand side looked a good place to start and figuring it out quickly led me to the answer:
      -As we have unit 1 in position 14, the other unit 1 can only go in positions 12 or 16. This immediately meant that Unit 3 possibility 5 can’t be valid as that uses both positions 12 and 16 so would mean we couldn’t place the second unit 1.
      -Working backwards through the unit 3 possibilities, I then considered the Unit 3 possibility 4, where the units are in position 8 and 12. If this is correct, then the second unit 1 must be in position 16. These two placings mean that (1) the only valid unit 7 possibility is placing the units 7 in positions 7 and 15, and (2) the only valid unit 4 possibility is placing units 4 in positions 5 and 10

      We have now placed units 1, 3, 4, 5, 6, 7 and 8 leaving the remaining two empty positions for unit 2 being 1 and 4, which are also correctly spaced, so must be the correct answer.

      I have shown the possible positions for units 3, 4, 5 and 7. I didn’t need to consider unit 2 to work out the answer.

      Position:  1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11, 12, 13, 14, 15, 16
      
      Possible Unit 3
      U3 Pos 1:  3,  *,  *,  *,  3,  -,  -,  -,  -,  -,  -,  -,  -,  -,  -,  -
      U3 Pos 2:  -,  -,  3,  *,  *,  *,  3,  -,  -,  -,  -,  -,  -,  -,  -,  -
      U3 Pos 3:  -,  -,  -,  3,  *,  *,  *,  3,  -,  -,  -,  -,  -,  -,  -,  -
      U3 Pos 4:  -,  -,  -,  -,  -,  -,  -,  3,  *,  *,  *,  3,  -,  -,  -,  -
      U3 Pos 5:  -,  -,  -,  -,  -,  -,  -,  -,  -,  -,  -,  3,  *,  *,  *,  3
      
      Possible Unit 4
      U4 Pos 1:  -,  -,  4,  *,  *,  *,  *,  4,  -,  -,  -,  -,  -,  -,  -,  -
      U4 Pos 2:  -,  -,  -,  -,  4,  *,  *,  *,  *,  4,  -,  -,  -,  -,  -,  -
      U4 Pos 3:  -,  -,  -,  -,  -,  -,  4,  *,  *,  *,  *,  4,  -,  -,  -,  -
      
      Possible Unit 5
      U5 Pos 1:  -,  -,  5,  *,  *,  *,  *,  *,  5,  -,  -,  -,  -,  -,  -,  -
      U5 Pos 2:  -,  -,  -,  -,  -,  -,  -,  -,  5,  *,  *,  *,  *,  *,  5,  -
      
      Possible Unit 7
      U7 Pos 1:  -,  -,  -,  7,  *,  *,  *,  *,  *,  *,  *,  7,  -,  -,  -,  -
      U7 Pos 2:  -,  -,  -,  -,  -,  -,  7,  *,  *,  *,  *,  *,  *,  *,  7,  -
      U7 Pos 3:  -,  -,  -,  -,  -,  -,  -,  7,  *,  *,  *,  *,  *,  *,  *,  7

      I thought I was done until I looked at the bonus challenge of programming a solution!

      We start the same:
      With unit 8 in position 2 means that the other unit 8 must be in position 11
      With unit 6 in position 6 means that the other unit 6 must be in position 13
      The rest we have to figure by looking for contradictions using the possible positions noted in the diagrams below.

      The right hand side looked a good place to start and figuring it out quickly led me to the answer:
      -As we have unit 1 in position 14, the other unit 1 can only go in positions 12 or 16.

      But If I make a different assumption…
      -If I assume that the units 7 goes in position 8 and 16, then the second unit 1 must go in position 12.
      -These two placings mean that (1) the only valid unit 4 possibility is placing the units 4 in positions 5 and 10 and (2) the only valid unit 3 possibility is placing units 3 in positions 3 and 7.

      We have now placed units 1, 3, 4, 5, 6, 7 and 8 leaving the remaining two empty positions for unit 2 being 1 and 4, which are also correctly spaced, so this must be ANOTHER correct answer!?

      So now the answer doesn’t appear unique as suggested, and in fact I find two other possible correct answers starting with a different assumptions (not shown as this post is long engough). This is supported by my python.

      Position: 1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11, 12, 13, 14, 15, 16
      Soln 1:   2,  8,  5,  2,  4,  6,  7,  3,  5,  4,  8,  3,  6,  1,  7,  1
      Soln 2:   2,  8,  3,  2,  4,  6,  3,  7,  5,  4,  8,  1,  6,  1,  5,  7
      Soln 3:   3,  8,  4,  7,  3,  6,  2,  4,  5,  2,  8,  7,  6,  1,  5,  1
      Soln 4:   3,  8,  5,  2,  3,  6,  2,  7,  5,  4,  8,  1,  6,  1,  4,  7

      `units = {2: 8, 6: 6, 9: 5, 14: 1} #radio unit positions given
      row = [0] * 16 #hold the radio number positions
      solutions = []

      def search(n=8): #8 sets of 2 radios
      if n == 0:
      if all(row[p – 1] == r for p, r in units.items()):
      solutions.append(row.copy())
      return

      for i in range(16 – n – 1): #8 sets of 2 radios =16, but 0 based
      j = i + n + 1 #place each radio pair n + 1 positions apart
      if row[i] or row[j]: #if position i or position j already contains a radio (a value bigger than 0) move to the next placing attempt.
      continue
      if any(p in units and units[p] != n for p in (i + 1, j + 1)): #prevent placing a new radio where one already exists
      continue

      row[i] = row[j] = n
      search(n – 1) #recursively search decreasing from n to 0
      row[i] = row[j] = 0

      search()

      for solution in solutions:
      print(*solution)
      print(f”{len(solutions)} solutions”)’

    • #164852
      ByteInBits
      Participant

      The elves are on the shelves !

      • #164867
        Elf_on_the_Shift
        Keymaster

        Seems like this one’s back on shift 😉

      • #164871
        harry
        Keymaster

        Not sure that exercising the Reindeer and planning optimal delivery routes count as sitting on a shelf.

    • #164879
      ByteInBits
      Participant

      Don’t thing I’ll be getting anything for xmas now 🙁
      Unless the naughty one favours me 😉

    • #164921
      Holmium
      Participant

      If you are enjoying the National Cipher Challenge and the Sunday Puzzles, you may enjoy the GCHQ Monday Puzzle.

    • #164975
      Robb27
      Participant

      Sunday puzzle 5: Making connections

      I produced a graph of the adaptors and counted the connections with the following result: A = 3, B = 4, C = 4, D = 4, E = 4, F = 5
      – For a through route, arriving and departing connections through an adapter must pair. As A and F both have an Odd count they must must be the end connections.
      – This also answers the bonus question: a closed loop is impossible. In a loop, every arrival must pair with a departure, including where the loop closes, so every adaptor letter must have even number of connections. A and F are odd preventing a closed loop using all twelve adaptors exactly once.

      I then followed my graph and found this chain as a solution A – E, E – B, B – D, D – C, C – F, F – B, B – C, C – E, E – F, F – D, D – A and finally A – F.

      However, this is not the only viable route. I wrote some python and discovered 1,712 different viable routes A to F. This ignores the reverse F to A routes which would double that number.

      from collections import Counter
      
      ADAPTORS = (
          ("A", "D"), ("B", "E"), ("C", "F"), ("A", "E"),
          ("B", "D"), ("D", "F"), ("B", "C"), ("E", "F"),
          ("A", "F"), ("C", "E"), ("C", "D"), ("B", "F"))
      
      def solution_routes():
          """Yield every trail from A to F using each adaptor exactly once."""
          neighbours = {letter: [] for letter in "ABCDEF"}
          for edge_id, (a, b) in enumerate(ADAPTORS):
              neighbours[a].append((b, edge_id))
              neighbours[b].append((a, edge_id))
          for choices in neighbours.values():
              choices.sort()
      
          all_used = (1 << len(ADAPTORS)) - 1
          route = ["A"]
      
          def visit(current, used):
              if used == all_used:
                  if current == "F":
                      yield tuple(route)
                  return
              for next_letter, edge_id in neighbours[current]:
                  bit = 1 << edge_id
                  if not used & bit:
                      route.append(next_letter)
                      yield from visit(next_letter, used | bit)
                      route.pop()
      
          # A and F are the only odd-degree vertices.
          # Starting at A avoids listing every physical chain again in the reverse direction.
          yield from visit("A", 0)
      
      def main():
          degrees = Counter(letter for adaptor in ADAPTORS for letter in adaptor)
          lines = ["Degrees: " + ", ".join(f"{v}={degrees[v]}" for v in "ABCDEF")]
          count = 0
          for count, route in enumerate(solution_routes(), start=1):
              lines.append(f"{count:5d}: " + " - ".join(route))
          lines.append(f"Total of a chain and its reverse counted once): {count}")
          result = "\n".join(lines) + "\n"
          print(result, end="")
      
      if __name__ == "__main__":
          main()
      
    • #165054
      ByteInBits
      Participant

      Sunday Puzzle 5

      The ends of the chained leads will have A and F.

      Given there are 3 A’s, 2 of which must join inside the loop and
      so the odd A must therefore be the leading or end plug.

      Given there are 5 F’s, 4 of which must join inside the loop and
      so the odd F must therefore be the leading or end plug.

      With A and F as end terminals a loop cannot be formed.

      Two ways to connect the 12 leads:

      A==D~D==F~F==A~A==E~E==B~B==F~F==C~C==B~B==D~D==C~C==E~E==F

      A==D~D==F~F==C~C==B~B==D~D==C~C==E~E==B~B==F~F==A~A==E~E==F

      I was late to this (Friday Evening) so did not check if there are others.

    • #165098
      ByteInBits
      Participant

      @Holmium in reply to your post #164743

      Can you find a positioning solution with
      radio 1 in position 8 and radio 2 in position 5.

      Answer: 4 2 7 8 2 4 6 1 5 1 7 3 8 6 5 3 simples 😉

      • #165120
        Holmium
        Participant

        Re: Solution to follow-up puzzle:

        4, 2, 7, 8, 2, 4, 6, 1, 5, 1, 7, 3, 8, 6, 5, 3

        Well done. ‘Simples’ indeed …

        Anyone following this may also know that all 300 possible solutions (150 pairs) to Sunday puzzle 4, without any additional constraints, on this radio in that position, if expressed as a sixteen digit number; for example, if …

        4, 2, 7, 8, 2, 4, 6, 1, 5, 1, 7, 3, 8, 6, 5, 3

        was expressed as the number: 4278246151738653 …

        Then all solutions are divisible exactly by the number nine, without any remainder. It is easy to show, once you see the pattern. But, do you see the pattern?

    • #165287
      Robb27
      Participant

      Sunday Puzzle #6
      Secure data store B71 Floor Plan (STRAP)

      Firstly, by just looking at placing the panels, we can see that F1 & F2 can only be filled by Horizontal panels. Also, E5 & F5 can only be filled by using vertical panels.

      A B C D E F
      1| _ _ _ _ _ h
      2| _ # _ _ _ h
      3| _ _ _ _ _ #
      4| _ _ _ _ _ _
      5| _ _ _ # v v
      6| _ _ _ _ _ _

      If we fill in these panels then consider C1. C1 can’t be Vertical as that would leave A1 and B1 unable to be panelled, C1 is therefore Horizontal and C2 is therefore Vertical. This quickly leads to a position where D3, E3 and D4 can’t be panelled Horizontally or Vertically. Therefore there is no logical solution.

      A B C D E F
      1| h h h h h h
      2| _ # v h h h
      3| _ _ v _ _ #
      4| _ _ v _ _ v
      5| _ _ _ # v v
      6| _ _ _ _ _ v

      Taking another approach.
      Using the hint to number the diagonals and counting we obtain the space count as follows: 1=12, 2=10 and 3=11.

      A B C D E F
      1| 1 2 3 1 2 3
      2| 2 # 1 2 3 1
      3| 3 1 2 3 1 #
      4| 1 2 3 1 2 3
      5| 2 3 1 # 3 1
      6| 3 1 2 3 1 2

      We have 33 spaces (12+10+11) but made up of an unequal number of spaces. Each of the three panel segments would occupy a different space; 1, 2 or 3. To have a possibility of a solution, the count of the panel spaces would need to be equal, i.e. 11 each of spaces 1, 2 and 3. Therefore, there is no panel placing solution for this equipment floor plan.

    • #165347
      ByteInBits
      Participant

      Sunday Puzzle 6 – A Floor? in the plan (definately a flaw)

      I will keep this brieve.

      I would send the panels back to the supplier and have them cut the panels
      to 1×1 squares, and de-employ whoever ordered them as 3×1 panels.
      One quick clance at the floor arrangement indicates that it is impossible
      to use 3×1 floor panels without some cutting taking place. In fact using 2×2
      panels is also not possible, none of this would be a problem if 1×1 panels
      were used, that is a no brainer!

      It was asked:
      If you think it can be done, show how. IT CANNOT BE DONE!

      If you think it can’t be done explain why not. HO, WOW, REALLY?
      Because idiots could not figure out how to make the job simple, duh.

      PS I’m just making fun, I feel certain others will give more logical reasons.

    • #165983
      Robb27
      Participant

      Sunday puzzle 7: Going round in circles

      In excel I was able to quickly create the 27 different unique permutations manually. With a bit of care to the ordering I manually arranged these to obtain the calibration: RRRARAAGAAARGARRGGGRAGGAGRG. If I insert a hyphen to show each group of three pairings this gives the following colour arrangement: RRR-RRA-RAR-ARA-RAA-AAG-AGA-GAA-AAA-AAR-ARG-RGA-GAR-ARR-RRG-RGG-GGG-GGR-GRA-RAG-AGG-GGA-GAG-AGR-GRG-RGR-GRR back to RRR.

      I can see that this solution is not unique so I then wrote a simple python program (below) to generate all the unique circular arrangements. This gave me 373,248 solutions (!) assuming I treat any rotations of a solution, like mine above, as the same arrangement.

      For the Extra Challenge, given we are told that “every possible ordered sequence of three colours must appear once and only once as you travel around the drum” then there are 3x3x3=27 possible unique colour permutations. If each must appear once then no drum with less than 27 markers can be possible.

      def all_drums():
          #Every arrangement will contain RRR exactly once
          #Starting with this to avoid rotated copies.
          used = {"RRR"}
      
          def extend(sequence):
              if len(used) == 27:
                  # The final two letters must close the circle.
                  if sequence[-2:] == "RR":
                      yield sequence[:-2]
                  return
      
              for colour in "RAG":
                  triple = sequence[-2:] + colour
      
                  if triple not in used:
                      used.add(triple)
                      yield from extend(sequence + colour)
                      used.remove(triple)
      
          yield from extend("RRR")
      
      count = 0
      for drum in all_drums():
          print(drum)
          count += 1
      
      print("Total:", count)
    • #166102
      Holmium
      Participant

      Could you provide a little more detail on the solution to Sunday puzzle 6: A floor(?) in the plan? You say:

      “The solution is a lovely invariant. Colour the grid diagonally with three colours according to row + column modulo 3. Every horizontal or vertical 1×3 panel necessarily covers exactly one square of each colour. A complete tiling with eleven panels would therefore have to cover 11 squares of each colour”.

      I note that the 6 x 6 grid, without any cabinets, does not actually tile in the way illustrated in the solution. It does tile in a number of ways, including in vertical columns of blue, yellow and red. In this case, the cabinets leave colour totals of 11 yellow; 11 red; 11 blue.

      So, I a agree with your conclusion that the floor with cabinets cannot be tiled, but I don’t follow how you arrived at that conclusion. Additional pointers would be most welcome.

      • #166107
        harry
        Keymaster

        Suppose you had managed to tile the follow using the 11 provided tiles. However you have lain them down to achieve it, each of the floor tiles will cover exactly one blue square, one red square and one yellow square as coloured on the periodic diagram. So in total the 11 tiles will have to cover 11 red, 11 blue and 11 yellow squares. But, because of the plinth positions, that is impossible. There are only 10 yellow squares and 12 blue ones to be covered across the whole floor, so at least one of the blue squares is uncovered and one of the yellow squares would have to be covered twice by tiles.

      • #166126
        Holmium
        Participant

        @Harry, thanks for the reply.

        I don’t think I made my point clearly, or I am possibly confused. I believe the proposed solution is based on an invalid tiling. Given the three-cell arrangement of the tiles, then if cell A1 is blue, then cell A2, or cell B1 may be yellow, but they can’t both be yellow. Consequently I believe the solution given is based on an invalid tiling.

        Impossible tiling solution

        If we take one of the valid tiling solutions, then the cabinets cover one each of a blue, yellow and red square and the number of the remaining tile colours is equal. So, the argument presented doesn’t seem exclude a solution being possible.

        One possible tiling solution

      • #166322
        harry
        Keymaster

        I don’t think I was clear, sorry! The colours on the tiles shown on the solution are not the only possible ones. The point is that as each tile is laid down on the three-coloured grid its own three squares inherit a colour each. It doesn’t matter where you put the tile on the floor its three squares will be coloured differently because the colouring of the floor shown in the diagram has the property that any three adjacent squares in a row or in a column are always three different colours. That means that if we could lay the tiles down to cover the floor then the 11 tiles would pick up 11 red, 11 blue and 11 yellow squares. But there are not that number on the floor, so the tiles can’t cover the floor without overlapping (and then they can’t cover all the squares. I hope that is a bit clearer. Sorry for any confusion!

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