Sunday Times Teaser 3032 – Darts Display
by Andrew Skidmore
Published Sunday November 01 2020 (link)
I noticed a dartboard in a sports shop window recently. Three sets of darts were positioned on the board. Each set was grouped as if the darts had been thrown into adjacent numbers (eg, 5, 20, 1) with one dart from each set in a treble. There were no darts in any of the doubles or bulls.
The darts were in nine different numbers but the score for the three sets was the same. If I told you whether the score was odd or even you should be able to work out the score. The clockwise order of numbers on a dartboard is:
20 1 18 4 13 6 10 15 2 17 3 19 7 16 8 11 14 9 12 5
What was the score that all three sets of darts made? [i.e. that made by each set of three darts]
2 Comments
Leave one →
-
Brian Gladman permalink123456789101112131415161718192021222324252627282930313233343536373839from partition_unique import partition_uniquefrom collections import defaultdictfrom itertools import combinations# the clockwise number sequence on the dartboardnbrs = (20, 1, 18, 4, 13, 6, 10, 15, 2, 17,3, 19, 7, 16, 8, 11, 14, 9, 12, 5)# save sets of three darts indexed on their scores2dts = defaultdict(list)for p in range(20):# pick three adjacent darts ...d3 = tuple(nbrs[(p + i) % 20] for i in range(3))# ... and the one that is the triplefor t in range(3):s2dts[sum(d3) + 2 * d3[t]].append((d3, t))# save three sets of three darts that have nine# different darts indexed on their total scoresol = []for s, d3l in s2dts.items():for dt3 in combinations(d3l, 3):# check the 3 dart triples for 9 different dartsif len(set().union(*(d[0] for d in dt3))) == 9:sol.append((s, dt3))# find any solutions that are unique based on the# (even/odd) parity of their scoresfor s, d3t in partition_unique(sol, lambda x: x[0] % 2)[0]:sc3 = []# output the three 'three dart' sets in the solutionfor d3, t in d3t:st = []for i, d in enumerate(d3):st.append(('t' if i == t else '') + str(d))sc3.append('(' + ', '.join(st) + ')')print(f"Score {s}: {', '.join(sc3)}.")
-
GeoffR permalink123456789101112131415161718192021222324252627282930313233343536from collections import defaultdictfrom itertools import combinations# group standard dartboard into three adjacent sectorssectors3 = [ (20, 1, 18), ( 1, 18, 4), (18, 4, 13), ( 4, 13, 6),(13, 6, 10), ( 6, 10, 15), (10, 15, 2), (15, 2, 17),( 2, 17, 3), (17, 3, 19), ( 3, 19, 7), (19, 7, 16),( 7, 16, 8), (16, 8, 11), ( 8, 11, 14), (11, 14, 9),(14, 9, 12), ( 9, 12, 5), (12, 5, 20), ( 5, 20, 1) ]# save the three dart groups indexed on their scoresD = defaultdict(list)for t in sectors3:a, b, c = tsm = sum(t)D[sm + 2 * a] += [t]D[sm + 2 * b] += [t]D[sm + 2 * c] += [t]# create two lists of solutions for even and odd sumsseo = [], []for s, ds in D.items():# choose three triple dart groupsfor d3t in combinations(ds, 3):# check that it involves nine different scoresif len(set().union(*d3t)) == 9:seo[s % 2].append((s, d3t))# look for a list that contains a single solutionfor s in seo:if len(s) == 1:for s, d3t in s:print(f"Score = {s}, darts: {d3t}")