From The Sunday Times, 1st February 1970 [link]
Every week we field a village darts team of 3 men, one from each of our pubs (Plough, Queen’s Head, and Roebuck). Altogether we can call on 14 players (whose names, luckily, start respectively with the first 14 letters of the alphabet): five of them frequent the Plough, six the Queen’s Head and seven the Roebuck, the apparent discrepancy is explained by the thirsts of Ernie, Fred, Len and Mark, all of whom are “two-pub men” and are thus eligible to represent either of their haunts.
For over three years we have picked a different team each week and have just exhausted all 162 possible combinations. The last two teams were:
Joe, Nigel, Charlie
Charlie, Fred, Harry
For the next seven weeks we are waiving the one-man-per-pub rule and have picked teams which have not so far played together. The are:
Ernie, Len, Mark
Ian, Fred, Alan
Joe, Fred, George
Len, Mark, Keith
Fred, Keith, Nigel
Ernie, Len, Nigel
Ian, Joe, and one other to be picked from a hat on the night.
Which darts players frequent the Roebuck?
This puzzle was originally published with no title.
[teaser455]
Jim Randell 6:52 am on 11 March 2019 Permalink |
Here’s a solution using the [[
SubstitutedDivision()]] and [[filter_unique()]] functions from the enigma.py library.This program runs in 63ms. (Internal runtime is 7.2ms).
Run: [ @replit ]
from enigma import (SubstitutedDivision, filter_unique, printf) # the division sum p = SubstitutedDivision( "????1 / ?? = 1???", [ "?? - ?? = ?1", "?1? - 1?? = ??", "??? - ??? = 11", "111 - 111 = 0" ], digits=(0, 2, 3, 4, 5, 6, 7, 8, 9), verbose="T", # show candidate solutions ) # find solutions unique by the number of digits involved f = lambda s: len(set(s.s.values())) g = lambda s: (s.a, s.b) ss = filter_unique(p.solve(), f, g).unique # output solutions for s in ss: printf("SOLUTION: {s.a} / {s.b} = {s.c} [{n} digits]", n=f(s))Solution: The two original numbers were 37 and 58571.
The diagram can describe 3 possible divisions:
The first and third of these have 8 different digits in the long division sum, the second one uses 9 different digits and so gives the solution.
Although the puzzle states that the erased digits are not 1 (and the program ensures this), there are no further solutions to the more general problem where the erased digits may be 1. We can see this by adding [[
1]] in the [[digits]] specification on line 7 (or just removing that line completely to allow any digit to be used).LikeLike
GeoffR 7:16 pm on 14 March 2019 Permalink |
This solution found the same three possible solutions
However, only the solution 58571 / 37 = 1583 had a unique number of digits erased by the setter, as the other two solutions had the same number of digits erased. The two digit number is therefore 37 and the five digit number is 58571.
% A Solution in MiniZinc include "globals.mzn"; % w c d e 1 5 8 3 % --------- ---------- % a b)f g h i w 3 7)5 8 5 7 1 % a b 3 7 % --- --- % m 1 h 2 1 5 % w p q 1 8 5 % ----- ----- % r s i 3 0 7 % t u v 2 9 6 % ----- ----- % 1 1 1 1 1 1 % 1 1 1 1 1 1 % ===== ===== int: w == 1; var 0..9: a; var 0..9: b; var 0..9: c; var 0..9: d; var 0..9 :e; var 0..9: f; var 0..9: g; var 0..9: h; var 0..9: i; var 0..9: j; var 0..9: k; var 0..9: m; var 0..9: p; var 0..9: q; var 0..9: r; var 0..9: s; var 0..9: t; var 0..9: u; var 0..9: v; constraint a > 0 /\ j > 0 /\ m > 0 /\ r > 0 /\ t > 0; var 10..99: ab = 10*a + b; var 1000..1999: wcde = 1000*1 + c*100 + d*10 + e; var 10000..99999: fghiw = 10000*f + 1000*g + 100*h + 10*i + w; var 10..99: jk = 10*j + k; var 100..999: m1h = 100*m + 10^1 + h; var 100..199: wpq = 100*1 + 10*p + q; var 100..999: rsi = 100*r + 10*s + i; var 100..999: tuv = 100*t + 10*u + v; var 10..99: rs = 10*r + s; var 10..99: m1 = 10*m + 1; var 10..99: fg = 10*f + g; constraint ab * wcde == fghiw; constraint fg - ab == m1; constraint c * ab = wpq /\ m1h - wpq == rs; constraint d * ab == tuv /\ rsi - tuv == 11; constraint e * ab == 111; % variables used in programme - all erased by setter (but not including w = 1) var set of int: s1 = {a, b, c, d, e, f, g, h, i, m, p, q, r, s, t, u, v}; solve satisfy; output [ show(fghiw) ++ " / " ++ show (ab) ++ " = " ++ show(wcde) ++ ", digit set used (exc w=1) = " ++ show(s1) ++ "\n" ++ "\n[a, b, c, d, e, f, g, h, i, m, p, q, r, s, t, u, v ] " ++ "\n" ++ show ( [a, b, c, d, e, f, g, h, i, m, p, q, r, s, t, u, v ] )]; % excludes w = 1 % 58201 / 37 = 1573, digit set used (exc w=1) = {0,2,3,5,7,8,9} % 7 no. digit variables used, not inc 1 % [a, b, c, d, e, f, g, h, i, m, p, q, r, s, t, u, v ] % [3, 7, 5, 7, 3, 5, 8, 2, 0, 2, 8, 5, 2, 7, 2, 5, 9] % % time elapsed: 0.02 s % ---------- % 58571 / 37 = 1583, digit set used (exc w=1) = {0,2,3,5,6,7,8,9} - ANSWER % 8 no. digit variables used, not inc 1 % [a, b, c, d, e, f, g, h, i, m, p, q, r, s, t, u, v ] % [3, 7, 5, 8, 3, 5, 8, 5, 7, 2, 8, 5, 3, 0, 2, 9, 6] % % time elapsed: 0.02 s % ---------- % 58941 / 37 = 1593, digit set used (exc w=1) = {2,3,4,5,7,8,9} % 7 no. digit variables used, not inc 1 % [a, b, c, d, e, f, g, h, i, m, p, q, r, s, t, u, v ] % [3, 7, 5, 9, 3, 5, 8, 9, 4, 2, 8, 5, 3, 4, 3, 3, 3] % % time elapsed: 0.02 s % ---------- % ========== % Finished in 232msecLikeLike
elbaz haviv 1:10 pm on 30 August 2023 Permalink |
1593 x 37 and 1573 x 37 also fit the puzzle
LikeLike
Jim Randell 1:35 pm on 30 August 2023 Permalink |
As noted above these 2 candidate solutions are eliminated as they both have 7 different digits erased. The remaining candidate has 8 different erased digits, and so provides the required answer to the puzzle.
LikeLike
elbaz haviv 4:18 pm on 30 August 2023 Permalink |
ok later I noticed that but I don’t find
an edit future to correct my self.
anyway Thank you.
LikeLike