New Scientist Enigma 598 – Break-Down
by Mark Bryant
From New Scientist #1752, 19th January 1991
In Susan Denham’s Enigma last week she related details of an unusual frame of snooker (and she reminded readers of the basic rules). Reading that teaser reminded me of a frame which I once saw between the two great players Dean and Verger.
Dean had a break; Verger followed this with a break of 1 point fewer; Dean followed this with a break of 1 point fewer; Verger followed this with a break of 1 point fewer; and so on, up to and including the final clearance.
In any one break no colour (apart from the red) was potted more than once. Dean never potted the blue. Each player potted the black twice as many times as his opponent potted the yellow. The brown was potted more times than the green.
How many times (in total) did the winner pot each of the colours? (Red, Yellow, Green, Brown, Blue, Pink, Black).
-
Brian Gladman permalink1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859from itertools import count# generate breaks of <v> points with <r> reds# and next colour <cx> if no reds remaindef make_break(v, nr, cx, seq=()):# is the sequence is complete?if v == 0:yield nr, cx, seq# can we add another red?elif v == 1:if nr:yield nr - 1, cx, seq + (1,)# if some reds remainelif nr:# add a red and a non-red colour not already potted (replaced)for c in range(2 if not seq else seq[-1] + 1, min(v - 1, 7) + 1):yield from make_break(v - c - 1, nr - 1, cx, seq + (1, c))# otherwise pot the final non-red colours in sequence (not replaced)elif cx <= min(v, 7):yield from make_break(v - cx, nr, cx + 1, seq + (cx,))# make sequences of breaks with successive break points# decreasing by one using <r> remaining reds and next# colour <cx> when no reds remaindef make_breaks(v, r, cx, seq=()):if r == 0 and cx == 8:yield seqelse:for rr, cc, s in make_break(v, r, cx):yield from make_breaks(v - 1, rr, cc, seq + (s,))# consider the points in Dean's opening breakfor sb in count(2):# for possible sequences of breaksfor bs in make_breaks(sb, 15, 2):# Dean and Verger's sequences of potsdp = tuple(x for y in bs[::2] for x in y)vp = tuple(x for y in bs[1::2] for x in y)bp = dp + vp# Dean pots no bluesif dp.count(5):continue# they each pot twice as many blacks as their# opponent pots yellowsif dp.count(7) != 2 * vp.count(2):continueif vp.count(7) != 2 * dp.count(2):continue# more browns were potted than greensif bp.count(3) >= bp.count(4):continue# the colours potted for Dean and Vergerdc = tuple(dp.count(c) for c in range(1, 8))vc = tuple(vp.count(c) for c in range(1, 8))print(f"Dean: score {sum(dp)}, colours {dc}\n"f"Verger: score {sum(vp)}, colours {vc}\n{bs}")exit()