Sunday Times Teaser 2989 – Pot Luck
by Andrew Skidmore
Published January 5 2020 (link)
Liam had a bag of snooker balls containing 6 colours (not red) and up to 15 red balls. He drew out balls at random, the first being a red. Without replacing this he drew another ball; it was a colour. He replaced this and drew another ball. This was a red (not replaced), and he was able to follow this by drawing another colour. The probability of achieving a red/colour/red/colour sequence was one in a certain whole number.
After replacing all the balls, Liam was able to “pot” all the balls. This involved “potting” (ie, drawing) red/colour/red/colour…red/colour (always replacing the colours but not the reds), then “potting” the six colours (not replaced) in their correct sequence. Strangely, the probability of doing this was also one in a whole number.
What are the two whole numbers?
-
Brian Gladman permalink123456789101112131415161718192021222324252627282930313233from math import factorial# starting with r reds (and 6 non-reds):## 1st red probability = r / (r + 6)# 1st non-red probability = 6 / (r + 5)# 2nd red probability = (r - 1) / (r + 5)# 2nd non-red probability = 6 / (r + 4)for r in range(2, 16):# compute the top and bottom of the# cumulative probability as a fraction# after two reds and two non-redst = 36 * r * (r - 1)b = (r + 6) * (r + 5) ** 2 * (r + 4)p, s = divmod(b, t)# the odds must be 1 over an integerif not s:# now continue until all balls are pottedx = r - 2while x:t *= 6 * xb *= (x + 6) * (x + 5)x -= 1# now add the probability of potting the# colours in the right orderb *= factorial(6)# these odds must also be 1 over an integerq, s = divmod(b, t)if not s:print(f"{r} reds -> odds 1/{p} and 1/{q:,}.")