From The Sunday Times, 22nd December 2024 [link] [link]
In Cluedo, one “room” card (from nine possible ones), one “person” card (from six) and one “weapon” card (from six) are placed in a murder bag. The remaining 18 cards are shared out (four or five per player). Players take turns to suggest the contents of the murder bag. If wrong, another player shows the suggester a card, eliminating one possibility. The first person to know the contents of the murder bag will immediately [reveal their solution and] claim victory.
My brothers and I are playing, in the order Michael-John-Mark-Simon. After several completed rounds, we all know the murder was committed in the Study. Michael and I know the murderer was Miss Scarlet with one of four weapons. Mark and Simon know the weapon and have narrowed it down to four people. Being new to Cluedo, we don’t learn from others’ suggestions.
From this point on, what are Michael’s chances of winning (as a fraction in its lowest terms)?
To clarify the wording, the intention is that once a player has deduced the contents of the murder bag, they reveal their solution, and do not have to wait for their next turn.
[teaser3248]
Jim Randell 10:09 am on 14 January 2025 Permalink |
This Python program uses the [[
SubstitutedExpression]] solver from the enigma.py library to generate all possible “downward moving” arrays. And then uses the [[filter_unique()]] function to find solutions that are unique by the required criteria.It runs in 74ms. (Internal runtime is 9ms).
from enigma import (SubstitutedExpression, irange, filter_unique, unpack, chunk, printf) # for a "downward moving" grid the rows and columns are in ascending order # consider the grid: # A B C # D E F # G H I exprs = [ "A < B < C", "D < E < F", "G < H < I", "A < D < G", "B < E < H", "C < F < I", ] # make a solver to find downward moving grids p = SubstitutedExpression( exprs, digits=irange(1, 9), answer="(A, B, C, D, E, F, G, H, I)", ) # look for a non-standard layout, unique by <f> non_standard = lambda x: x != (1, 2, 3, 4, 5, 6, 7, 8, 9) # f = (sum of digits in LH column, central digit parity) f = unpack(lambda A, B, C, D, E, F, G, H, I: (A + D + G, E % 2)) rs = filter_unique(p.answers(verbose=0), f, st=non_standard).unique # output solution(s) for r in rs: printf("{r}", r=list(chunk(r, 3)))Solution: Megan’s downward moving array looks like this:
Of the 42 possible downward moving arrays, this is the only one that is unique by LH column sum (11) and parity of the central digit (even).
(Of course moving from left-to-right and top-to-bottom the numbers are increasing, so maybe this should be considered an “upward moving” array).
LikeLiked by 1 person
Ruud 8:27 am on 16 January 2025 Permalink |
import itertools import collections collect = collections.defaultdict(list) for a in itertools.permutations(range(1, 10)): if ( all(a[row * 3] < a[row * 3 + 1] < a[row * 3 + 2] for row in range(3)) and all(a[col] < a[col + 3] < a[col + 6] for col in range(3)) and a != tuple(range(1, 10)) ): collect[a[0] + a[3] + a[6], a[4] % 2].append(a) for ident, solutions in collect.items(): if len(solutions) == 1: for row in range(3): for col in range(3): print(solutions[0][row * 3 + col], end="") print()LikeLike
GeoffR 9:28 am on 18 January 2025 Permalink |
# A B C # D E F # G H I from itertools import permutations from collections import defaultdict MEG = defaultdict(list) digits = set(range(1, 10)) for p1 in permutations(digits, 6): A, B, C, D, E, F = p1 if A < B < C and D < E < F and \ A < D and B < E and C < F: q1 = digits.difference(p1) for p2 in permutations(q1): G, H, I = p2 if G < H < I: if A < D < G and B < E < H and C < F < I: MEG[(A + D + G, E % 2)].append([A, B, C, D, E, F, G, H, I]) # check E is even for Meghans array as 5th element(E) # ..of standard telephone array is odd i.e. 5 for k, v in MEG.items(): if len(v) == 1 and v[0][4] % 2 == 0: print("Meghans array: ") print(v[0][0], v[0][1], v[0][2]) print(v[0][3], v[0][4], v[0][5]) print(v[0][6], v[0][7], v[0][8]) ''' Meghans array: 1 2 5 3 4 6 7 8 9 '''LikeLike