### Random Post

### Recent Posts

### Recent Comments

### Archives

### Categories

- article (11)
- enigma (1,115)
- misc (2)
- project euler (2)
- puzzle (29)
- site news (43)
- tantalizer (29)
- teaser (3)

### Site Stats

- 166,357 hits

Programming Enigma Puzzles

5 May 2015

Posted by on **From New Scientist #1425, 11th October 1984** [link]

Uncle Pinkle has moved house, and he is installing a new triphonic audio-system on his garden lawn. This system consists simply of three transmitters

A,BandC, each of which is to be exactlyMyards from the others.Uncle Pinkle will sit at a point

X, carefully chosen so that the distancesXA,XBandXCare exact whole numbers of yards.

X must not be in a direct line with any pair of transmitters. [*]The total

XA+XB+XCis to be as small as possible.Uncle Pinkle asks me to specify

M, and the distancesXA,XBandXC, to meet his requirements.Can you help please?

(If you find yourself using a calculator, let alone a computer, you are getting much too big. The rule in italics [*] is not as big a handicap as you may be thinking).

[enigma278]

Advertisements

%d bloggers like this:

I think the setter is expecting us to assume that

Mshould be a positive integer, otherwise we can just placeXat the centre of an equilateral triangle and makeAX=BX=CX= 1, andM= √3 to give us a minimum possible total distance of 3.This program uses a result that I found on the Wikipedia page for Equilateral Triangles [ http://en.wikipedia.org/wiki/Equilateral_triangle ], namely, that for any point in the plane,

X, with distancesa,b,cto the verticesA,B,Cof an equilateral triangle of sides, we have:Which keeps things nicely in the integers.

This Python program runs in 64ms.

Solution:M=7;XA=3,XB=5,XC=8 (sum = 16).The question implies that a calculator is not necessary, but I think this method would be a bit tedious without machine assistance, so maybe there is a neater way.

The first solution I can find where

Xisinternalto the triangle is at:M=112;XA=57,XB=65,XC=73 (sum = 195).Along similar lines to Brian’s program, we find that given

(a, b, c)we can arrive at the following quadratic equation inM²:where:

So for increasing totals

t = a+b+cwe can then find solutions forM²using the standard quadratic formula, and look for cases whereM²is a perfect square.Here’s my program modified to do this. It’s a bit messier than my first program, but runs faster and produces the same output for

tup to 1000.Continuing with the interesting solutions line,

M=57,XA=65,XB=73,XC=112 (sum=250) is the first solution where each of the distances to the vertices is greater than the sides of the equilateral triangle.Via [ http://mathworld.wolfram.com/RationalDistanceProblem.html ] I found that Richard K. Guy in

Unsolved Problems in Number Theory, p181, “D19: Rational distances from the corners of a square”, mentions that:If I modify my program to look for positions within the triangle, the smallest I find is M = 13, with (7, 7, 9) and the smallest with different distances is M = 19 with (7, 13, 14).

I don’t think either of those work. I tried running your program without the early termination condition and the first solution it found with

Xinternal to the triangle was the same as I gave above.Yes, you are right. I missed an indent level in my modification and, the two solutions I quoted were close enough to correct to appear right when I drew them 😦

Could it be that the setter of the puzzle was thinking of one of these solutions,

also involving the numbers 3, 5, 7, 8?

m = 3. i.e. A and B are at (±1.5, 0), C at (0, 1.5√3)

X is at (±4, -2.5√3). Distances a, b, c are 5, 7, 8.

m = 5. i.e. A and B are at (±2.5, 0), C at (0, 2.5√3)

X is at (±4, -1.5√3). Distances a, b, c are 3, 7, 8.

Neither very intuitive; nor is the sum a + b + c minimum.

I reckon to have found further solutions:

m = 7. i.e. A and B are at (±3.5, 0), C at (0, 3.5√3)

X is at (±7.5, -4√3). Distances a, b, c are 8, 13, 15.

m = 8. i.e. A and B are at (±4, 0), C at (0, 4√3)

X is at (±7.5, -3.5√3). Distances a, b, c are 7, 13, 15.

m = 13. Distances a, b, c are 7, 8, 15

(but the coordinates of X are no neater than in your solution).

And many more with larger numbers.

I think I’ll stick with good old indoor stereo.

@Hugh: Apart from the last one all the solutions you mention have X in line with one of the sides of the equilateral triangle ABC, which the setter disallows with the constraint marked [*].

In general, for a solution (M, a, b, c) all the permutations of it will be potential solutions, in that they satisfy the equation that identifies X as a point in the plane with integer distances from the vertices of an integer sided equilateral triangle (the defining equation is symmetric in each of the parameters, so the order of the numbers doesn’t matter), but additionally we need to check that X is not in line with one of the sides of the triangle in order for it to be a solution to the puzzle.

There are certainly many candidate solutions, where (M, a, b, c) are all positive integers, and X is not in line with any of the sides of the equilateral triangle (if you stop my program from ending when it finds the first solution (by sum a+b+c) it keeps generating them, for a+b+c≤1000 it finds 339 solutions).

The smallest

Mwith multiple different solutions seems to beM=43, e.g.:Oh, sorry! Didn’t notice the alignment (trying hard not to use a calculator, you see).

I could have mentioned that in your solution the coordinates of X are (±8/7, -15/14√3).

[wonder whether that displays as intended]

Did I work that out using only pencil and paper? You must be joking.

Belated insight:

Initially we ignore the ‘not in line’ restriction and place X somewhere on side AB, so that a + b = m. cos 60° = 0.5, so the cosine rule reduces to c² = m² + a² – ma.

Because b = m – a, that’s equivalent to c² = m² + b² – mb.

If we find an all-integer solution we can then swap m and a (or m and b), placing X on an extension of AB, because cos 120° = -0.5.

The setter of the puzzle apparently assumed that we would know that you can also swap m and c, putting X outside the triangle and not in line with any side — or inside, as Jim found works with certain larger numbers. Hence the statement that we wouldn’t need a calculator.

I found solutions (the last number in each group is the final m):

8, 3, 5, 7; 15, 7, 8, 13; 21, 5, 16, 19; 35, 11, 24, 21; 40, 7, 33, 37; 48, 13, 35, 43

and a good few more, as well as multiples of those. Can’t detect any pattern.

I was looking to see if the sequence of possible values of

Moccurred in OEIS, and I found A050931.And it’s certainly true that you can generate (by hand) a lot of possible solutions using:

And we can do this in

a+b+corder, by considering increasing values forc = a+b.The first solution that pops out is the 12th candidate tried:

which is the answer to the puzzle.

The nature of the solutions requires:

Which means that none of the triangles XAB, XAC, XBC can be degenerate.

Maybe this is how the setter was expecting us to solve the puzzle.

However this method doesn’t produce all possible solutions as we won’t find, for example, any solution points internal to the triangle. For example,

M=112, a=57, b=65, c=73. Indeed none of the permutations of this solution will be found by this method as none of numbers is the sum of two of the others.