Sunday Times Teaser 2521
by DJT Hogg
Published: 15 January 2011 (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?
One Comment
Leave one →
-
Brian Gladman permalink123456789101112131415161718192021222324252627from alphasum import AlphaSumhorses = ('FIRST', 'THIRD', 'FIFTH', 'SIXTH', 'NINTH', 'TENTH')# output a value in pence as pounds and pencefn = lambda x: '\xa3' + str(round(x / 100, 2))# solve the addition sum FIRST + THIRD = SIXTHc = AlphaSum([horses[0], horses[1]], horses[3])for r in c.solve():# find the unused digits and permute them for# the letters E and Na, b = set(range(10)).difference(r.values())for p in ((a, b), (b, a)):r.update(zip('EN', p))# compute all the valuesvalues = [int(c.substitute(r, h)) for h in horses]if all(10000 < x < 50000 for x in values):s = ', '.join([fn(x) for x in values[:-1]])f, s, l = s.rpartition(', ')s = ' and '.join((f, l))fs = '{} bet on the 10th (others: {}).'print(fs.format(fn(values[-1]), s))