Teaser 2521: [The Dudeney Stakes]
From The Sunday Times, 16th January 2011 [link] [link]
In The Dudeney Stakes at the local racecourse, six horses were rather special. A bookie, Isaac Conway, told me how much, in pence, he had taken on each of the six (less than £500 on each). But he translated the totals using a letter-for-digit substitution and the six figures were FIRST, THIRD, FIFTH, SIXTH, NINTH and TENTH, which happened to correspond to their positions in the race! Isaac also told me the total amount taken on the horses finishing first and third equalled that taken on the sixth.
How much did he take on the tenth?
This puzzle was originally published with no title.
[teaser2521]
Jim Randell 8:47 am on 12 June 2025 Permalink |
We can solve this puzzle using the [[
SubstitutedExpression]] solver from the enigma.py library.A straightforward recipe has an internal runtime of 6.9ms. However using the [[
SubstitutedExpression.split_sum]] solver brings this down to 129µs (50× faster).Solution: The amount taken on the tenth horse was: £ 203.29.
The amounts taken (in pence) on each horse are as follows:
LikeLike
Ruud 1:12 pm on 13 June 2025 Permalink |
import istr istr.repr_mode("int") for f, i, r, s, t, h, d, x, n, e in istr.permutations(istr.digits()): p = {1: f | i | r | s | t, 3: t | h | i | r | d, 5: f | i | f | t | h, 6: s | i | x | t | h, 9: n | i | n | t | h, 10: t | e | n | t | h} if p[1] + p[3] == p[6]: if all(amount < 50000 and amount[0] != "0" for amount in p.values()): print(p)LikeLike