Teaser 3178: Drying boards
From The Sunday Times, 20th August 2023 [link] [link]
Chef Ignacio liked to prop his two identical thin rectangular chopping boards against the shelf at the end of his counter to dry. He placed the top of the first one flush with the shelf corner and rested the second on the first, as shown in the diagram. To aid drying, he positioned the second to maximise the air volume in the bounded region below it. The length of each board is an even number of cm (less than 26cm). The distance between the bases of the two boards was a whole number of mm.
What is this distance?
It seems that the setter intends that the height of the shelf above the counter is an exact (but not specified) number of mm. Without this requirement we can find multiple potential solutions.
[teaser3178]

Jim Randell 5:30 pm on 18 August 2023 Permalink |
I am assuming the distance between the bases of the boards is the separation between the edges that touch the counter top.
At the moment I don’t understand how we can work out a unique answer without knowing more information, say, the height of the shelf above the surface of the counter, or the angle of one of the boards.
Solution: [See my comment below]
LikeLike
Jim Randell 8:26 am on 19 August 2023 Permalink |
I have now found a single solution using the additional assumption that the height of the shelf above the counter is an exact whole number of millimetres. It seems it is likely this is what the setter intended.
If the first board makes an angle θ with the surface (0° < θ < 90°), then the maximum cross-sectional area under the second board is achieved when it makes an angle θ/2 with the surface (and the bounded area is an isosceles triangle).
With the length of the board and the height of the shelf we can calculate the angle θ, and hence θ/2. Then cos(θ/2) is the ratio of half the board length to the required separation.
I used the half-angle formula:
This Python program runs in 56ms. (Internal runtime is 1.7ms).
Run: [ @replit ]
from enigma import (Rational, irange, is_square_q, div, as_int, printf) Q = Rational() # solve for a board of length x (mm) for x in irange(20, 240, step=20): # and a shelf of height h (mm) for h in irange(1, x - 1): # separation between the boards on the counter = y (mm) d = is_square_q(x * x - h * h) if d is None: continue q = is_square_q(Q(d + x, 2 * x)) if q is None: continue y = Q(x, 2 * q) # check for integer value y = as_int(y, include="+", default=None) if y is None: continue # output solution printf("x={x} h={h} -> y={y}")Solution: The boards are 125 mm apart.
The boards are 200 mm in length (x = 200), and the shelf is height 192 mm above the counter top (h = 192).
So the first board makes a (56, 192, 200) = 8× (7, 24, 25) right-angled triangle.
And we have:
And we calculate cos(θ/2) as:
And the required separation is:
If the height of the shelf h is unconstrained, then we can find an appropriate value to give any (reasonable) answer we choose.
For a board of length x and a required separation distance y, we calculate the angle of θ (between 0° and 90°) as:
Then the required height h for this scenario is given by:
For example:
LikeLike
Frits 12:29 pm on 19 August 2023 Permalink |
I had to make two assumptions, not one, to get to the same answer.
Luckily my initial derived rule for maximal air volume remains true.
from enigma import Rational Q = Rational() M = 26 # length of each board in cm is smaller than M # air volume in the bounded region is maximal if line perpendicular to # the 2nd board splits the 2nd board in half (isoceles triangle) # board length in mm for b in range(20, 10 * M, 20): # assume shelf height is a whole number of mm for h in range(1, b): # assume the distance from corner to 1st board touching # the counter <a> is a whole number of mm a = (b**2 - h**2)**(1/2) if not (a == (a := int(a))): continue # using cosine half-angle formula the following must be true d2 = Q(b**2 + a * b, 2 + 4 * Q(a, b) + Q(2 * a**2, b**2)) if d2.denominator != 1: continue # distance <d> must be a whole number of mm if (d := d2.numerator**(1/2)) != int(d): continue print("answer:", int(d), "mm")LikeLike
Frits 10:12 pm on 19 August 2023 Permalink |
line 17 is not really necessary.
LikeLike
Jim Randell 1:04 pm on 19 August 2023 Permalink |
For a shorter/faster program we can use [[
pythagorean_triples()]] from the enigma.py library (and a bit of analysis).This Python program has an internal runtime of 316µs.
Run: [ @replit ]
from enigma import (pythagorean_triples, div, is_square, printf) # generate pythagorean triples for the first board (in mm) for (a, b, x) in pythagorean_triples(240): if x % 20 != 0: continue for (d, h) in [(a, b), (b, a)]: # calculate the separation of the boards (in mm) y = is_square(div(x**3, 2 * (d + x))) if y is None: continue # output solution (in mm) printf("x={x} h={h} -> y={y}")Analysis:
Using the identity:
we have:
hence:
And x and y are integers, hence d is also an integer, so (d, h, x) is a Pythagorean triple.
LikeLiked by 1 person