Brain-Teaser 186: [Adrian Winder’s problem]
From The Sunday Times, 15th November 1964 [link]
A is 73 feet from a straight river, and B is on the same side of the river but not so far from it. M and N are the (distinct) points on the river nearest to A and B respectively. The lengths of AB, MN, and BN are whole numbers of feet.
A man walks from A to B via the river, taking the shortest possible route, and this is also whole number of feet.
How far does the man walk, and what is the direct distance from A to B?
This puzzle was originally published with no title.
This puzzle is included in the book Sunday Times Brain Teasers (1974).
The puzzle is included as a postscript to the puzzles in the book, and the following text appears in the foreword:
Perhaps the most outstanding example of teasing is Brain Teaser 186, of 15th November 1964, which was based on a deceptively simple diagram by an undergraduate, Adrian Winder, who died in a road accident just before his puzzle was published. Few correct answers were submitted; within the year there were 250 requests for the full solution; and still, from time to time, yet another reader concedes defeat and begs to be relieved of his misery.
Mr Winder’s problem, with his solution, is published as a fitting postscript to this collection.
— Anthony French
This brings the total number of puzzles available on S2T2 to 550, but this is less than 20% of the Brain Teaser puzzles published in The Sunday Times.
[teaser186]

Jim Randell 9:14 am on 16 September 2021 Permalink |
The direct route (h = AB) and the indirect route (z = AB′ = z1 + z2) are the hypotenuses of right-angled triangles (AXB and AXB′ respectively):
For a given value of x we can determine values for h, d and z by looking at the divisors of x²:
This Python program runs in 51ms. (Internal run time is 1.3ms).
Run: [ @replit ]
from enigma import (irange, divisors_pairs, div, is_square, printf) for x in irange(1, 72): for (a, b) in divisors_pairs(x * x): h = div(a + b, 2) d = div(b - a, 2) if not (h and d): continue t = 146 - x z = is_square(t * t + d * d) if not z: continue printf("x={x}; h={h} d={d} z={z}")Solution: The man walks 169 ft between A and B. The direct distance is 123 ft.
B is 46 ft from the river (BN = 46). And M and N are 120 ft apart (MN = 120).
LikeLike
Frits 11:32 am on 16 September 2021 Permalink |
This Python program runs in 75ms (with PyPy).
from enigma import SubstitutedExpression, is_square # h^2 = x^2 + d^2 d < 2592 ((72^2 - 1) / 2) # z^2 = (146 – x)^2 + d^2 # the alphametic puzzle p = SubstitutedExpression([ "DE < 26", "0 < XY < 73", "is_square(XY**2 + DEFG**2) = HIJK", "is_square((146 - XY)**2 + DEFG**2) = ZABC", "DEFG > 0", ], answer="(ZABC, HIJK)", distinct="", # allow symbols with same values d2i=dict([(k, "D") for k in range(3, 10)]), verbose=256, ) # print answers for (_, ans) in p.solve(verbose=0): print(f"The man walks {ans[0]} ft between A and B. " f"The direct distance is {ans[1]} ft.")LikeLike
Frits 12:34 pm on 16 September 2021 Permalink |
This Python program runs in 4ms.
from enigma import pythagorean_triples, is_square # h^2 = x^2 + d^2 h < 2593 ((72^2 + 1) / 2) # z^2 = (146 – x)^2 + d^2 # x < 73 for (p, q, h) in pythagorean_triples(2592): if p > 72: continue if q > 72: # (x, d) must be (p, q) z = is_square((146 - p)**2 + q**2) else: # (x, d) can be (p, q) or (q, p) z = is_square((146 - p)**2 + q**2) if not z: z = is_square((146 - q)**2 + p**2) if z: print(f"The man walks {z} ft between A and B. " f"The direct distance is {h} ft.")LikeLike
Jim Randell 1:58 pm on 16 September 2021 Permalink |
Here’s a version that only uses the list of Pythagorean triples (and doesn’t use [[
is_square()]]).from enigma import (pythagorean_triples, ordered, printf) # we can show: # # d <= (x^2 - 1) / 2 # # and max x = 72, so: # # d < 2592 # # hence: # # z^2 <= 145^2 + 2592^2 # z < 2597 # find pythagorean triples, map: (a, b) -> c triples = dict(((a, b), c) for (a, b, c) in pythagorean_triples(2597)) # consider triples for ((a, b), c) in triples.items(): if a > 72: continue # consider x=a, d=b, h=c z = triples.get(ordered(b, 146 - a)) if z: printf("x={a}; h={c} d={b} z={z}") if b < 73: # consider x=b, d=a, h=c z = triples.get(ordered(a, 146 - b)) if z: printf("x={b}; h={c} d={a} z={z}")Although it is not quite as fast as my original program.
LikeLike
John Crabtree 2:52 pm on 22 September 2021 Permalink |
In theory there should be a way to solve brain teasers manually. Today I take this to mean without the use of computers or programable calculators. When this teaser was published in 1964, handheld calculators were some way off.
Putting h = d + m and z = d + n, and then
d = (x^2 – m^2)/(2m) = ((146 – x)^2 – n^2)/(2n) with n > m
where if x is odd, m and n are odd, and if x ix even, m and n are even.
Effectively, this is a way of finding Pythagorean triples with a common shorter side.
Then for each value of x, one can look for values of m and n which give the same value of d. I did this with the aid of a calculator. I could have done it by hand with a table of squares, but it would have been tedious. The ratio of n/m is approximately (146 – x)^2/x^2. One can use this to reduce the number of calculations. The results took up two and half sides of paper. I found x = 27, m = 3, n = 49, which gave d = 120. The solution = d + n = 169.
In summary, this is very challenging but accessible teaser. If Brian Gladman’s table of Pythagorean triples sorted by shorter sides went to 140, it would be very straightforward.
LikeLike
John Crabtree 5:02 pm on 22 September 2021 Permalink |
The man walks d + n = 169 feet. The direct distance is d + m = 123 feet.
LikeLike