A Brain-Teaser: [Boxes and ladders]
From The Sunday Times, 12th April 1957 [link]
A schoolmaster set a problem of the following type to each of four pupils:
“A ladder of length ___ rests squarely, and more steeply than, 45 degrees, against a (vertical) wall, with its foot on the (horizontal) ground distant ___ from the base of the wall. A cubical box fits flush into the angle of the wall and the ground, and just touches the ladder. What is the length of side of the box?”
and he filled in the gaps in the problem as set out with Integral numbers of inches such that the answer would also be an integral number of inches.
To each pupil, however, he gave different values for the length of ladder (all less than 150 ft.) and for the distance of its foot from the base of the wall. The answers submitted to him by the four pupils were all the same, and all were correct.
What were the four different pairs of values he gave to his pupils, and what was the common answer implied by them?
This is one of the occasional Holiday Brain Teasers published in The Sunday Times prior to the start of numbered Teasers in 1961. A prize of £5 was offered.
This puzzle was originally published with no title.
[teaser-1957-04-12] [teaser-unnumbered]
Jim Randell 9:08 am on 7 November 2021 Permalink |
The distance along the ground, x, the height up the wall, y, and the length of the ladder, z, form a Pythagorean Triple (x, y, z).
And the side of the cube, k, is then given by:
The following Python program runs in 48ms.
Run: [ @replit ]
from enigma import (pythagorean_triples, div, group, unpack, printf) # generate (x, y, z, k) solutions def generate(Z): for (x, y, z) in pythagorean_triples(Z): k = div(x * y, x + y) if k is not None: yield (x, y, z, k) # collect (x, y, z, k) solutions by the value of k # z < 150 ft = 1800 in d = group(generate(1799), by=unpack(lambda x, y, z, k: k)) # look for k values with 4 (or more) solutions for (k, vs) in d.items(): if len(vs) < 4: continue printf("k={k} [{n} triangles]", n=len(vs)) for (x, y, z, k) in vs: printf(" x={x} y={y} z={z}") printf()Solution: The (length, distance) pairs given to the students were (in inches): (1189, 820), (1225, 735), (1547, 595), (1739, 564). The common answer was 420 inches.
LikeLike
GeoffR 11:01 am on 10 November 2021 Permalink |
Using the pythagorean_triples function from enigma.py, this function uses x < y < z, so there is no need to check the ladder angle is greater than 45 degrees, as y is always greater than x.
Let cube side = c and ladder angle with ground = A
Let y = p + c and x = c + q
Tan A = p / c = c / q, so (y – c) / c = c /(x – c)
This simplifies to c = (y * x) / (y + x)
from enigma import pythagorean_triples from collections import defaultdict BT1 = defaultdict(list) for x, y, z in pythagorean_triples(1799): # find integer value of cube side q, r = divmod(x * y, x + y) if q > 0 and r == 0: BT1[q] += [(x, y, z)] for k, v in BT1.items(): # Looking for four sets of values for (x, y, z) if len(v) > 3: print(f"Cube side = {k}") print(f"Triangles: {v}")LikeLike
John Crabtree 3:57 pm on 11 November 2021 Permalink |
I think that this brain teaser is very hard to tackle manually. Hugh ApSimon presents a parameter method for generating the primitive solutions in his book “Mathematical Byways in Ayling, Beeling and Ceiling” which was published in 1984. See Chapter 2 on pages 7-12. Chapter 1 on pages 3-6 is a lead in.
LikeLike