Sunday Times Teaser 3008 – Three-Fruit Fractions
by Stephen Hogg
Published Sunday May 17 2020 (link)
The owner of the old curiosity shop repaired an antique mechanical fruit machine having three wheels of identical size and format. Afterwards each wheel was independently fair, just as when new. Each wheel’s rim had several equal-sized zones, each making a two-figure whole number of degrees angle around the rim. Each wheel had just one zone showing a cherry, with other fruits displayed having each a different single-figure number (other than one) of zone repetitions.
Inside the machine were printed all the fair chances (as fractions) of getting three of the same fruit symbol in one go. Each of these fractions had a top number equal to 1 and, of their bottom numbers, more than one was odd.
What was the bottom number of the chance for three cherries?
-
Brian Gladman permalink1234567891011121314151617181920212223242526272829303132from itertools import combinations# consider the possible number of zonesfor ang in range(10, 100):zones, r = divmod(360, ang)if not r:# the number of zones for each fruit (a single digit)# must be a divisor of the number of zones to ensure# that the resulting fraction has a numerator of onezc = ()for d in range(2, zones):q, r = divmod(zones, d)if not r and q < 10:zc = (q,) + zc# find combinations of possible zone countsfor n in range(1, len(zc) + 1):for zs in combinations(zc, n):# add the single zone for the cherryzt = (1,) + zs# the sum of the zone repetitions must equal# the total number of zonesif sum(zt) == zones:# find the denominatorsdn = tuple(zones // z for z in zt)# of which more than one must be oddif sum(1 for d in dn if d & 1) > 1:print(f"Odds for Cherries: 1/{dn[0] ** 3} [zones/denoms = {zt}/{dn}]")