From The Sunday Times, 17th February 1980 [link]
Last summer, for a pleasant holiday pastime with mathematical connections, I took up the job of operating our local cricket scoreboard at matches.
This scoreboard is the envy of all the other teams in the league. It shows:
– the two batsmen identified by their numbers in the batting order, with their individual totals;
– the score (i.e. the number of runs and the wickets fallen);
– the number of overs bowled;
– the number of extras;
– the score of the last man out.
During one match, while the two batsmen were in full flight, our team declared their innings closed at the end of an over, with wickets to spare. Exhausted after a busy day, I examined the board and was amazed to see that all of the numbers recorded on it used only two different digits between them.
I noted that the total was the only three-figure number; that there were four two-figure numbers; and that two single-figure numbers appeared twice. I also observed that the score of the last man out was a factor of the total, and the division of the latter by the former still resulted in a single figure number on the board.
I was pleased to see that all the batsmen on the board reached double figures.
What was the final score, i.e. how many runs for how many wickets?
How many extras were there?
[In cricket, the batsmen are numbered from 1 upwards as they come in to bat. The world record is 77 runs in one over. The match itself was perfectly normal — no-one retired hurt etc. Ed.]
This puzzle is included in the book The Sunday Times Book of Brainteasers (1994). The puzzle text above is taken from the book.
[teaser917]
Jim Randell 4:54 pm on 25 August 2023 Permalink |
A bit more straightforward than the last couple of puzzles.
This Python program runs in 52ms. (Internal runtime is 457µs).
from enigma import (subsets, multiset, multiply, ediv, printf) # required distribution of values dist = multiset.from_dict({ 6: 5, 5: 4, 4: 2, 3: 4, 2: 5 }) # find the common sum <k> for the 4 children k = ediv(dist.sum(), 4) # generate possible scores def scores(dist, k): # no value occurs more than 2 times m = multiset.from_pairs((k, min(2, v)) for (k, v) in dist.items()) # look for scores from 5 dice, with the required sum for ss in subsets(sorted(m), size=5, select='uC'): if sum(ss) == k: yield ss # consider 4-sets of scores for ss in subsets(scores(dist, k), size=4): # look for required distribution if multiset.from_seq(*ss) == dist: printf("sum = {k} -> scores = {ss}") # find the set with the max product ans = max(ss, key=multiply) # output solution printf("ans = {ans}")Solution: Liam’s scores were: 3, 3, 4, 5, 5.
Each child on Liam’s table threw 5 dice with a sum of 20:
LikeLiked by 1 person
Frits 9:25 pm on 25 August 2023 Permalink |
from enigma import SubstitutedExpression # (A, B, C, D, E), (F, G, H, I, J), (K, L, M, N, O), (P, Q, R ,S, T) # are four rows of frequencies (0-2) # the alphametic puzzle p = SubstitutedExpression( [ # check first 3 scores of 5 throws "5 - A - B - C - D = E", "2 * A + 3 * B + 4 * C + 5 * D + 6 * E == 20", "F >= A", "5 - F - G - H - I = J", "2 * F + 3 * G + 4 * H + 5 * I + 6 * J == 20", "K >= F", "5 - K - L - M - N = O", "2 * K + 3 * L + 4 * M + 5 * N + 6 * O == 20", # fill up to target frequency "5 - A - F - K = P", "P >= K", "4 - B - G - L = Q", "2 - C - H - M = R", "4 - D - I - N = S", "5 - E - J - O = T", "2 * P + 3 * Q + 4 * R + 5 * S + 6 * T == 20", # different throws, avoid duplicates "sorted(set(@rows)) == @rows", ], answer="[(multiply(i**y for i, y in enumerate(x, 2) if y), x) \ for x in @rows]", base=3, d2i="", macro=dict([("rows", "[(A, B, C, D, E), (F, G, H, I, J), \ (K, L, M, N, O), (P, Q, R ,S, T)]")]), distinct="", digits=range(0, 3), reorder=0, verbose=0, # use 256 to see the generated code ) # print answers for ans in p.answers(): nums = [[i] * y for i, y in enumerate(ans[0][1], 2) if y] print(f"answer: {sorted(y for x in nums for y in x)}")LikeLike