Teaser 2477: [Shamrock in a box]
From The Sunday Times, 14th March 2010 [link]
At the St Patrick’s Day Feis, Pat exhibits his painting “Shamrock in a Box”. This shows a square containing two touching circles of the same diameter (less than a metre). One circle also touches two adjacent sides of the square; the other touches the remaining two sides. For the middle leaf of the shamrock, Pat drew a third circle in the square: it touches each of the other circles, is the largest that will fit in the available space, and its radius is almost exactly a whole number of centimetres, that number being the same as the radius of the larger circles, but with the two digits in reverse order.
What is the radius of the larger circles?
This puzzle was originally published with no title.
[teaser2477]
Jim Randell 9:43 am on 24 July 2025 Permalink |
The layout looks like this:
Suppose the large circles have a radius 1.
The semi-diagonal of the square is: 1 + √2.
And if the smaller circle has a radius f (where 0 < f < 1), then we can also write the length of the semi-diagonal as: f√2 + h.
Where: f + 1 = hypot(h, 1).
And so we have two expressions for h:
We can solve these equations to find the value of f, and then consider the actual radius of the large circle, R (a 2-digit integer, less than 50). And then calculate the radius of the smaller circle r = f . R.
And we are look for cases where r is very close to the reverse of R.
This Python program runs in 61ms. (Internal runtime is 193µs).
from enigma import (Polynomial, sqrt, sq, irange, nrev, printf) r2 = sqrt(2) # "root 2" # we have 2 expressions for h^2, which we can express as polynomials p1 = sq(Polynomial([1 + r2, -r2])) # h^2 = (1 + sqrt(2) - f.sqrt(2))^2 p2 = sq(Polynomial([1, 1])) - 1 # h^2 = (f + 1)^2 - 1 # find real roots of p(f) = p1 - p2 for f in (p1 - p2).roots(domain='F'): if not (0 < f < 1): continue printf("[f = {f}]") # consider 2-digit numbers for R for R in irange(10, 49): # the reverse should be a smaller 2-digit number rR = nrev(R) if rR < 10 or rR >= R: continue # check size of smaller circle is close to rev(R) r = f * R if abs(r - rR) < 0.05: printf("R={R} -> r={r}")Solution: The larger circles have a radius of 32 cm.
And the smaller circles have a radius of 22.998 cm, which is very close to 23 cm.
f is a root of the following quadratic equation:
And this allows us to give a formula for f:
Hence:
LikeLike
Frits 12:49 pm on 24 July 2025 Permalink |
Using Jim’s formulas.
# h = 1 + sqrt(2) - f.sqrt(2) # h^2 = (f + 1)^2 - 1 h1 = lambda f: 1 + (1 - f) * 2**.5 h2 = lambda f: ((f + 1)**2 - 1)**.5 sols = set() for a in range(1, 5): for b in range(1, a): R, r = 10 * a + b, 10 * b + a f = r / R # store difference between 2 calculations for "h" sols.add((abs(h1(f) - h2(f)), R)) if (mn := min(sols))[0] < 0.01: print("answer:", mn[-1])LikeLike