From The Sunday Times, 25th October 1970 [link]
Each of the five families in Admirals Walk comprised three boys; one of the boys in each family had the same christian name as the surname of one of his neighbours, and no boy had the same christian and surname.
The three christian names of Mr. Arnold’s three sons all had the same initial as the surname of Lawrence, who lived opposite to Benjamin Thomas.
Mr. Gordon’s oldest son had a christian name with the same initial as Clement’s surname. Clement’s father played chess with Jasper Lawrence’s father.
Mr. Oliver was Arnold’s father’s business partner. Godfrey had measles. Mr. Oliver’s oldest son had the same christian name as Crispin’s surname, and also the same initial to his christian name as Arnold’s surname. Arnold lived next door to the man whose son Oswald played truant from school with his cousin Hector Lawrence, until Oswald’s brother Walter, a school prefect, caught them.
Gilbert and Oscar had red hair.
Oliver was in Borstal. What was his surname?
When originally published the condition relating to Mr. Oliver’s sons was given as:
Mr. Oliver’s oldest son had the same christian name as Crispin’s surname, and Mr. Oliver’s youngest son had the same initial to his christian name as Arnold’s surname.
However a correction was published with Brain-Teaser 493 stating:
It is regretted that in para. 3, line 7, “youngest” should have read “eldest”. However, as the correct initials of these boys can be proved independently and most solvers gave the correct answer, this answer will stand.”
I have made the correction in the puzzle text above, although instead of just changing “youngest” to “eldest”, as we are already talking about Mr. Oliver’s oldest son, I used “and also”.
This puzzle was originally published with no title.
[teaser491]
Jim Randell 8:37 am on 6 August 2019 Permalink |
This program uses the [[
SubstitutedExpression()]] solver from the enigma.py library to solve the alphametic problem, and an [[Accumulator()]] object to find the smallest solution. It runs in 299ms.Run: [ @replit ]
from enigma import (SubstitutedExpression, Accumulator, sprintf as f, join, printf) # the three words words = ("ABLEST", "STABLE", "TABLES") # the alphametic puzzle ws = join(words, sep=",", enc="()") p = SubstitutedExpression(f("sum({ws}) == 2 * max({ws})"), answer=ws) # look for a minimal solution r = Accumulator(fn=min) # solve the alphametic for ans in p.answers(verbose=0): # find the result of the sum s = max(ans) # and which word is the result i = ans.index(s) r.accumulate_data(s, i) # output the minimal solution printf("{word} = {r.value} [of {r.count} possible sums]", word=words[r.data])Solution: TABLES = 417582.
The corresponding alphametic sum is: ABLEST + STABLE = TABLES.
There are 18 possible solutions to this alphametic.
LikeLike
GeoffR 1:29 pm on 6 August 2019 Permalink |
I tried the three possible addition sums, looking for the smallest total. Two of these sums proved unsatisfiable. The third addition sum gave two possible values for TABLES, the smallest of which agreed with Jim’s solution.
LikeLike
John Crabtree 6:21 pm on 8 August 2019 Permalink |
With TABLES as the sum, ABLE = 999(T-S) – 100S – 10T. This enables the desired solution, as well as all of the possible 18 found by Jim, to be easily found.
LikeLike
Frits 2:36 pm on 27 July 2020 Permalink |
Substituted expression which returns only one solution (minimized on first part of answer):
# The following function has been manually added to enigma.py # # def substituted_expression_minimum(*args, **kw): # if 'verbose' not in kw: kw['verbose'] = 0 # answs = [] # for r in SubstitutedExpression(*args, **kw).solve(): # answs.append(r) # answs.sort(key=lambda x: x[1]) # if len(answs) > 0: # yield answs[0] from enigma import substituted_expression_minimum, printf, irange # the alphametic puzzle p = substituted_expression_minimum(\ [\ # if one element in (X,Y,Z) is sum of 2 others then sum(X,Y,Z) = 2*max(X,Y,Z) # in this way we don't have to specify it is Z=X+Y, Y=X+Z or X=Y+Z "TABLES + ABLEST + STABLE == 2 * max(TABLES, ABLEST, STABLE)",\ "max(TABLES, ABLEST, STABLE) = HIGNUM",\ "not(is_duplicate(TABLES))",\ "not(is_duplicate(ABLEST))",\ "not(is_duplicate(STABLE))"],\ distinct="", # needed for HIGNUM \ answer="HIGNUM, ABLEST, STABLE, TABLES",\ verbose=0) for (_, ans) in p: if ans[1] == ans[0]: printf("ABLEST is the sum with value {ans[1]}") if ans[2] == ans[0]: printf("STABLE is the sum with value {ans[2]}") if ans[3] == ans[0]: printf("TABLES is the sum with value {ans[3]}")LikeLike
Frits 3:12 pm on 27 July 2020 Permalink |
@Jim:
Any idea why I needed the HIGNUM field?
p = substituted_expression_minimum(\ [\ "TABLES + ABLEST + STABLE == 2 * max(TABLES, ABLEST, STABLE)"],\ answer="TABLES + ABLEST + STABLE, ABLEST, STABLE, TABLES",\ verbose=0)Using this setup I got no results (even with distinct=””).
LikeLike
Jim Randell 3:33 pm on 27 July 2020 Permalink |
@Frits: I think you get no answers because you are checking to see when one of the summands is equal to the sum total (which is never).
Try using:
BTW: You don’t need to modify the enigma.py library, you can just define the [[
substituted_expression_minimum]] function in your own program.LikeLike
Frits 2:41 pm on 29 July 2020 Permalink |
@Jim: Thanks for the internal accumulate function
from enigma import SubstitutedExpression, printf # the alphametic puzzle p = SubstitutedExpression( [ # if one element in (X,Y,Z) is sum of 2 others then sum(X,Y,Z) = 2*max(X,Y,Z) # in this way we don't have to specify it is Z=X+Y, Y=X+Z or X=Y+Z "TABLES + ABLEST + STABLE == 2 * max(TABLES, ABLEST, STABLE)", "not(is_duplicate(TABLES))", "not(is_duplicate(ABLEST))", "not(is_duplicate(STABLE))" ], answer="(TABLES + ABLEST + STABLE)/2, ABLEST, STABLE, TABLES", accumulate=min, verbose=0) # solve the puzzle r = p.run() # Print answer lst = ["ABLEST", "STABLE", "TABLES"] cnt = 0 for ans in r.accumulate: if cnt == 0: hghnum = ans else: if ans == hghnum: printf("{lst[cnt-1]} is the sum with value {ans}") cnt += 1LikeLike