From The Sunday Times, 1st November 1981 [link]
A familiar letters-for-digits problem is to take a correct addition sum such as:
1 + 1 = 2
and write it in words so:
ONE + ONE = TWO
The problem is to assign numbers from 0 to 9 to the letters so that we get a correct addition sum, e.g. E = 6, N = 3, O = 2, T = 4, W = 7 gives:
236 + 236 = 472
Two rules to be kept are that the left hand digit of any number is not zero, and different letters are assigned different numbers.
Some addition sums clearly have no solution. e.g.:
ONE + THREE = FOUR
In the Kudali Language the words for 1, 2, 3, 4 are AA, BA, EB, DE, although not necessarily in that order. Now all the addition sums:
1 + 1 = 2
1 + 2 = 3
1 + 3 = 4
2 + 2 = 4
1 + 4 = 2 + 3
when written in Kudali, give letters-for-digits problems each of which has at least one solution.
What are the Kudali words for 1, 2, 3, 4, in that order?
This puzzle is included in the books Microteasers (1986) and The Sunday Times Book of Brainteasers (1994).
[teaser1005]
Jim Randell 10:47 am on 11 May 2023 Permalink |
See also: Teaser 1688, Teaser 2533.
We can solve this puzzle using the [[
SubstitutedExpression]] solver from the enigma.py library.The following run file executes in 66ms. (Internal runtime of the generated program is 80µs).
Run: [ @replit ]
Solution: SUNDAY = 469528.
LikeLike
GeoffR 12:09 pm on 11 May 2023 Permalink |
LikeLike
GeoffR 1:47 pm on 11 May 2023 Permalink |
from itertools import permutations digits = {1, 2, 3, 4, 5, 6, 7, 8, 9} for p1 in permutations(range(1, 10), 4): T, E, A, S = p1 if S != T + E:continue if T != E + A:continue # find 5 remaining digits q1 = digits.difference(p1) for p2 in permutations(q1): U, D, R, Y, N = p2 if U != A + S:continue if D != S + E:continue if R % 2 != 1:continue # TEASER is odd if Y != E + R:continue SUNDAY = 100000*S + 10000*U + 1000*N + 100*D + 10*A + Y print('SUNDAY = ', SUNDAY)LikeLike