Teaser 2809: This and that
From The Sunday Times, 24th July 2016 [link] [link]
I have written down a list of eleven numbers and then consistently replaced digits by letters, with different letters for different digits. In this way the list becomes:
SO
DO
WHAT
NOW
ADD
AND
SEND
IN
THIS
AND
THATThe grand total of these eleven numbers is a four-figure number.
Numerically, what is THIS + THAT?
[teaser2809]
Jim Randell 10:19 am on 5 August 2021 Permalink |
We can find the answer using the [[
SubstitutedExpression]] solver from the enigma.py library.The following run file executes in 893ms:
Run: [ @replit ]
Solution: THIS + THAT = 2123.
The result of the sum is 9998.
To gain a bit more speed we can use the technique implemented in [[
SubstitutedExpression.split_sum()]], splitting the sum into separate columns with carries between. (See: Teaser 2792).Except here we may have to deal with multi digit carries (as there are 11 summands — although with a bit of analysis we can see that single digit carries would be sufficient in this case).
The following run-file executes in 226ms.
LikeLike
Frits 4:41 pm on 5 August 2021 Permalink |
To gain more speed in the first program you can also add:
“W + S + 2 * T < 10"
For more on this puzzle see:
[https://brg.me.uk/?page_id=4022]
LikeLike
Jim Randell 5:32 pm on 5 August 2021 Permalink |
Adding a second level of truncation (without worrying about the exact values of the carries) brings the run time down to 80ms. And there is no need for a third level.
Run: [ @replit ]
LikeLike
GeoffR 12:29 pm on 5 August 2021 Permalink |
LikeLike