Teaser 2856: Solid jellometry
From The Sunday Times, 18th June 2017 [link] [link]
As a wedding gift, Granny Lucci gave us a set of five jelly moulds, which was odd in many ways. The base of each mould was a different regular polygon (including a triangle) with each side an odd number of centimetres in length. Each polygon had the same length perimeter, an odd two figure number of centimetres.
The sides of the moulds were vertical and the heights of the moulds were all the same odd number of centimetres. The volumes of the moulds were all between one and two litres.
What was the height of the moulds?
[teaser2856]
Jim Randell 9:55 am on 5 May 2022 Permalink |
This Python program run in 56ms (internal run time is 476µs).
Run: [ @replit ]
from math import (pi, tan) from enigma import (fdiv, irange, divisors, divf, divc, subsets, diff, intersect, printf) # area of a regular polygon with <n> sides and perimeter <p> def area(n, p): a = fdiv(pi, n) return fdiv(p * p, 4 * n * tan(a)) # consider odd values for p = perimeter for p in irange(11, 99, step=2): # look for divisors of p (excluding 1) ds = list(d for d in divisors(p) if d > 1) # it must have at least 5 divisors, one of which is 3 if not (len(ds) > 4 and 3 in ds): continue # consider possible odd heights for each divisor ps = dict() for n in ds: a = area(n, p) hs = list(h for h in irange(divc(1000, a), divf(2000, a)) if h % 2 == 1) if hs: ps[n] = hs # the smallest prism is triangular if 3 not in ps: continue # choose the 4 prisms with more than 3 sides for ns in subsets(diff(sorted(ps.keys()), [3]), size=4, fn=list): # add in the triangular prism ns.insert(0, 3) # find common heights for h in intersect(ps[n] for n in ns): # output solution printf("perimeter = {p}, height = {h}") for n in ns: printf(" {n} sides -> side = {x}; vol = {v:.2f}", x=(p // n), v=area(n, p) * h) printf()Solution: The moulds are 11 cm high.
Each of the five moulds has a base with a perimeter of 45 cm.
LikeLike
Hugh+Casement 3:28 pm on 5 May 2022 Permalink |
There are only four values for the perimeter with enough divisors to give five different polygons.
Of those, only 45 cm (and height 11 cm) results in all the volumes being between 1 and 2 litres.
The polygons have sides 3, 5, 9, 15, and 45 sides.
LikeLike