Tagged: by: Alfred Moritz Toggle Comment Threads | Keyboard Shortcuts

  • Unknown's avatar

    Jim Randell 9:04 am on 28 April 2026 Permalink | Reply
    Tags: by: Alfred Moritz   

    Brainteaser 1049: A question of colour 

    From The Sunday Times, 5th September 1982 [link]

    A frame at snooker, as every player — and every watcher of “Pot Black” — will know, consists of fifteen red balls, worth one point each, and six “colours”: yellow = 2, green = 3, brown = 4, blue = 5, pink = 6 and black = 7.

    The reds must all be potted first: after each red the player chooses a single colour to pot (immediately replaced on the table) before addressing the next red. Any miss (or potting of the wrong colour) causes the other player to have his turn. After the last red has been potted, with an attempt at a colour, all the colours are on the table, and they must be potted in ascending order of value.

    The game ends when all the colours have been potted, or earlier if the current player has reached a score that cannot be equalled or exceeded by his opponent. For our present purposes, there are no penalty points or snookers.

    Unlike the champions we see on television, Arthur and Bertie recently played a frame which was as  undistinguished in quality (though neither actually incurred any penalty points) as it was remarkable in other ways. Each of them potted the same number of balls; the scores were level immediately before Bertie potted the last of the reds; and the winner — Arthur by a single point —was not decided until the table was finally cleared. They then discovered that Arthur’s score was the lowest possible for such a close win.

    What was Arthur’s score? Which player potted each of the final six “colours” (e.g. B, B, B, B, B, A).

    This puzzle is included in the book The Sunday Times Book of Brainteasers (1994).

    [teaser1049]

     
    • Jim Randell's avatar

      Jim Randell 9:04 am on 28 April 2026 Permalink | Reply

      We are looking for the lowest possible scores.

      The scores are level with 1 red remaining. So 14 of the reds have been potted. For the lowest possible scores the associated colours must have been missed. So each player has potted 7 reds (and no colours) for a total score of 7.

      The remaining balls are: the final red, a possible additional colour, and the 6 colours in order.

      So, if the table is cleared and each player pots the same number of balls: B pots the final red, and a colour, to put him on 8 + x points (and has now potted 9 balls). So of the 6 remaining colours B pots 2 and A pots 4.

      This Python program examines possible ends to the match.

      It runs in 70ms. (Internal runtime is 143µs).

      from enigma import (Enumerator, printf)
      
      colours = [2, 3, 4, 5, 6, 7]
      
      # play the remaining colours
      def play(A, B, cols, As=[], Bs=[]):
        # are we done?
        if not cols:
          yield (A, B, cols, As, Bs)
        else:
          rest = sum(cols)
          # has someone won?
          if A > B + rest or B > A + rest:
            yield (A, B, cols, As, Bs)
          else:
            # someone pots the next colour
            x = cols[0]
            yield from play(A + x, B, cols[1:], As + [x], Bs)
            yield from play(A, B + x, cols[1:], As, Bs + [x])
      
      # solve the puzzle, where B pots the final red with colour <x>
      def solve(x):
        for (A, B, cols, As, Bs) in play(7, 8 + x, colours):
          # A wins by 1 point
          if not (A == B + 1): continue
          # the table is cleared
          if cols: continue
          # A and B potted the same number of balls
          if not (len(As) == 4 and len(Bs) == 2): continue
          # return the final scores and colours potted
          yield (A, B, As, Bs)
      
      # choose a colour for A to pot with the final red
      for x in colours:
        ss = Enumerator(solve(x))
        for (A, B, As, Bs) in ss:
          # output solution
          printf("A pots colours {As}; total = {A} pts")
          printf("B pots final red + {x}; pots colours {Bs}; total = {B} pts")
          printf()
        # we only need the smallest solution
        if ss.count > 0: break
      

      Solution: Arthur’s score was 23. The final six colours were potted as: A, A, A, B, B, A.

      The match started with A and B each potting 7 reds and no colours, and then:

      → A=7, B=7, [1 red remaining]
      B pots the final red and the green (3)
      → A=7, B=11, [27 points remaining]
      A pots the yellow (2)
      → A=9, B=11, [25 points remaining]
      A pots the green (3)
      → A=12, B=11, [22 points remaining]
      A pots the brown (4)
      → A=16, B=11, [18 points remaining]
      B pots the blue (5)
      → A=16, B=16, [13 points remaining]
      B pots the pink (6)
      → A=16, B=22, [7 points remaining]
      A pots the black (7)
      → A=23, B=22 [final scores]

      B has potted 7 + 2 + 2 = 11 balls. And A has potted 7 + 4 = 11 balls.

      Like

  • Unknown's avatar

    Jim Randell 9:07 am on 21 October 2021 Permalink | Reply
    Tags: by: Alfred Moritz   

    Brain-Teaser 882: Another magic class 

    From The Sunday Times, 2nd July 1978 [link]

    This puzzle concerns a class of twenty-five pupils whose first names happen to have different initials (and none begins with X). The teacher makes them sit in alphabetical order in five neat rows of five with Arthur sitting to the left of Barry and in front of Freda.

    When their homework was returned (marked, as usual, out of a maximum of 25 without using fractional marks) they found that each pupil had a different mark and that, surprisingly enough, the total of marks in each row of five, each column of five and each diagonal of five was identical.

    Yvonne came top, followed by Harry and Jane in that order. Ursula scored more marks than Zena, and Richard was beaten by Charles. Victor had twice as many marks as George, and Ivor had four times as many as Freda. Susan beat Michael by the same margin by which Michael beat George (who, incidentally, scored an odd number of marks). This was also the margin by which Walter beat his left-hand neighbour and by which his right-hand neighbour beat him.

    Kenneth beat Olga. By how many marks?

    This puzzle is included in the book The Sunday Times Book of Brain-Teasers: Book 1 (1980). The puzzle text above is taken from the book.

    [teaser882]

     
    • Jim Randell's avatar

      Jim Randell 9:08 am on 21 October 2021 Permalink | Reply

      We can use the [[ SubstitutedExpression ]] solver from the enigma.py library to solve this puzzle.

      The following run file executes in 73ms.

      Run: [ @replit ]

      #! python3 -m enigma -rr
      
      SubstitutedExpression
      
      # values are 0 to 25, so let's use base 26
      --base=26
      
      # X is the unused value, so: k = (tri(25) - X) / 5, tri(25) = 325
      # so X is a multiple of 5
      "X % 5 == 0"
      
      # each row/column/diagonal sums to the magic constant
      "5 * (A + B + C + D + E) + X == 325"
      "5 * (F + G + H + I + J) + X == 325"
      "5 * (K + L + M + N + O) + X == 325"
      "5 * (P + Q + R + S + T) + X == 325"
      "5 * (U + V + W + Y + Z) + X == 325"
      
      "5 * (A + F + K + P + U) + X == 325"
      "5 * (B + G + L + Q + V) + X == 325"
      "5 * (C + H + M + R + W) + X == 325"
      "5 * (D + I + N + S + Y) + X == 325"
      "5 * (E + J + O + T + Z) + X == 325"
      
      "5 * (A + G + M + S + Z) + X == 325"
      "5 * (E + I + M + Q + U) + X == 325"
      
      # Y is the highest mark
      "(25 if X != 25 else 24) = Y"
      
      # H is the second highest mark
      "(Y - 1 if X != Y - 1 else Y - 2) = H"
      
      # J is the third highest mark
      "(H - 1 if X != H - 1 else H - 2) = J"
      
      # Y beat W by the same margin that W beat V
      "Y - W == W - V"
      
      # and this is the same margin that S beat M and M beat G
      "S - M == Y - W"
      "M - G == Y - W"
      
      # V = 2G, G's score was odd
      "2 * G = V"
      "G % 2 == 1"
      
      # I = 4F
      "4 * F = I"
      
      # U beat Z, C beat R, K beat O
      "U > Z"
      "C > R"
      "K > O"
      
      # [optional]
      --template=""
      --denest
      

      Solution: Kenneth beat Olga by 16 marks.

      The complete layout is:

      [A 21] [B 14] [C  7] [D  0] [E 18]
      [F  2] [G  5] [H 23] [I  8] [J 22]
      [K 20] [L 15] [M 12] [N  9] [O  4]
      [P 11] [Q 16] [R  1] [S 19] [T 13]
      [U  6] [V 10] [W 17] [Y 24] [Z  3]
      [X 25]

      So the marks awarded were 0-24, no-one scored 25.

      Like

    • Frits's avatar

      Frits 12:54 pm on 22 October 2021 Permalink | Reply

       
      # Y + V = 2 * W  \
      # Y = 24 or 25    > V is even so Y is also even
      # V = 2G         /
      #
      # (X, Y, H, J) = (25, 24, 23, 22)
      # W = 17
      #
      # F + G + I = 15 \   G + 5 * F = 15
      # G is odd        >  so G = 5, F = 2, I = 8
      # 4 * F = I      /
      #
      # V = 10 (2 * G)
      # center M = 60 / 12
      # S = 19 (S - M == Y - W)
      #
      # C + H + M + R + W = 60 \  C + R = 8
      #                         >
      # C > R                  /  so only option R = 1, C = 7
      #
      # A + G + M + S + Z = 60 \  A + Z = 24  so Z > 2
      # U > Z                   >
      # U + V + W + Y + Z = 60 /  U + Z = 9 only option Z = 3, U = 6, A = 21
      #
      # D + I + N + S + Y = 60 --> D + N = 9, only options (D, N): (0, 9) or (9, 0)
      #
      # only candidates for 4 are O and T -- > O + T = y + 4  (y is O or T)
      # E + J + O + T + Z = 60 --> E + O + T = 35 --> E + y = 31 --> E > 10
      #
      # B + G + L + Q + V = 60 \  B + L + Q = 45 so B > 6 and also B > 10
      #                         >
      # A + B + C + D + E = 60 /  B + D + E = 32
      #
      # minimal(B + E) = 24 --> D <= 8 --> D = 0 and N = 9
      #
      # E + O + T = 35 \
      #                 > Q = O + T - 1 = y + 3
      # E + Q = 34     /
      #
      # B + E = 32, only options (B, E, Q): (14, 18, 16) or (18, 14, 20)
      # last option implies y = 17 which is not possible
      # so B = 14, E = 18, Q = 16, L = 15
      #
      # A + F + K + P + U = 60 --> K + P = 31
      # only options (K, P): (20, 11) or (11, 20)
      #
      # K + L + M + N + O = 60 --> K + O = 24 with K > O
      # only option (K, O): (20, 4)
      # K = 20, O = 4, T = 13, P = 11 
      

      Like

c
Compose new post
j
Next post/Next comment
k
Previous post/Previous comment
r
Reply
e
Edit
o
Show/Hide comments
t
Go to top
l
Go to login
h
Show/Hide help
shift + esc
Cancel
Design a site like this with WordPress.com
Get started