Teaser 3196: Mind the edge
From The Sunday Times, 24th December 2023 [link] [link]
Kate and Lucy play a pub game on an isosceles triangle table top. They take turns to push a penny from the centre of the table top’s base towards the triangle’s apex, 120cm distant, scoring the sum of their distances from the base, or zero if it ever falls off the table.
Each player aims to maximise their distance, avoiding the chance that the penny might fall off the table. Their penny has an equal chance of landing anywhere within an error radius around the aimed point. This radius is proportional to the distance aimed. As a skilled player Lucy’s error ratio is half of Kate’s.
They both expect to score a whole number of cm per push, but to give each an equal chance of winning Kate gets one more push than Lucy. This number of pushes is the largest possible, given the above information.
How many pushes complete a game between the two?
Happy Christmas from S2T2!
For my selection of the more interesting puzzles encountered in 2023 see 2023 in review on Enigmatic Code.
[teaser3196]







Jim Randell 5:15 pm on 22 December 2023 Permalink |
If I understand the puzzle correctly it works like this:
Suppose the integer distances they are aiming for are L and K (where 0 < K < L < 120), and if L has n turns (so K has (n + 1) turns), then we have:
so n is a divisor of K.
And if L’s target circle has radius r(L):
for some constant k.
And K’s circle is given by:
And if θ is half the angle at the apex of the triangle we have:
This Python program finds possible K, L, n values, and looks for maximal n values.
It run in 55ms (and has an internal runtime of 110µs).
from enigma import (Accumulator, irange, div, printf) # find maximum number of goes r = Accumulator(fn=max, collect=1) # consider distance K for K in irange(1, 118): # calculate L L = div(240 * K, 120 + K) if L is None or not (L < 120): continue # calculate n n = div(K, L - K) if n is None: continue # record maximal n printf("[K={K} L={L} n={n}]") r.accumulate_data(n, (K, L)) # output solution n = r.value for (K, L) in r.data: printf("K={K} L={L} n={n} -> {t} turns", t=2 * n + 1)Solution: The total number of turns in the game is 31.
L has 15 turns, and K has 16.
LikeLike
Frits 11:56 am on 25 December 2023 Permalink |
from enigma import divisors # consider the distance for Lucy for L in range(119, 1, -1): # Lucy has n pushes, n = 120 / (120 - L), K = 120L / (240 - L) if (120 - L) not in divisors(120) or (120 * L) % ((240 - L)): continue print(f"answer: {240 // (120 - L) + 1} pushes") break # maximum reachedLikeLike
Jim Randell 9:24 am on 26 December 2023 Permalink |
@Frits: A very compact and efficient approach (only 8 cases are considered).
Here’s a version that prints a bit more information:
from enigma import (irange, div, printf) # find values of n in decreasing order for L in irange(119, 2, step=-1): K = div(120 * L, 240 - L) if K is None: continue n = div(120, 120 - L) if n is None: continue # output solutions printf("L={L} -> K={K} n={n} -> {t} turns", t=2 * n + 1) break # only need largest nLikeLike