Teaser 2595: Stylish fences
From The Sunday Times, 17th June 2012 [link] [link]
Farmer Giles has a hexagonal field bounded by six straight fences. The six corners lie on a circle of diameter somewhere around 250 metres. At three alternate corners there are stiles. The angles of the hexagon at the corners without stiles are all the same. All six fences are different whole numbers of metres long. I have just walked in a straight line from one of the stiles to another and the distance walked was a whole number of metres.
How many?
[teaser2595]

Jim Randell 8:07 am on 8 January 2025 Permalink |
Suppose the field is:
If the stiles are at A, C, E, then the angles at B, D, F are all equal, which means they are all 120°, and so the lines AC, AE, CE (= paths between stiles) are all equal length and so ACE is an equilateral triangle. (See: [ @wikipedia ]).
If the diameter of the circle is d, then the length of the paths, p, is given by:
And d is around 250, let’s say in the range [245, 255], so the path is in the range [212.176, 220.836], so we can consider path lengths of 212 .. 221.
For a given path length p (= AC) we can look for integer fence lengths (x, y) (= (AB, BC)) that complete the triangle ABC. By the cosine rule in ABC:
which is a quadratic equation in y.
So we can consider values for x and use the equation to find possible corresponding y values.
And we need to find (at least) 3 different (x, y) pairs to complete the hexagon, so that all 6 fences are different lengths.
The following Python program runs in 76ms. (Internal runtime is 7.5ms).
from enigma import (irange, quadratic, sq, sqrt, printf) r43 = sqrt(4, 3) # consider possible path lengths for p in irange(212, 221): # collect possible (x, y) pairs ss = list() for x in irange(1, p - 1): for y in quadratic(1, x, sq(x) - sq(p), domain='Z'): if x < y < p: ss.append((x, y)) # we need (at least) 3 different pairs if len(ss) < 3: continue # output solution printf("p={p} d={d:.3f} -> {ss}", d=p * r43)Solution: The path is 217m long.
There are actually 4 possible (x, y) pairs, and any 3 of them can be used to construct the hexagon:
If the puzzle had specified that the diameter of the circle was “around 400 m”, then we would have been able to give the lengths of the 6 fences:
LikeLike