# Enigmatic Code

Programming Enigma Puzzles

## Enigma 1167: Christmas lines

From New Scientist #2322, 22nd December 2001 [link]

With the help of my niece and nephew I have designed my own Christmas Card this year. We started with a large rectangular piece of card and then near to the top left-hand corner we drew a red dot and a gold dot representing two baubles. Then I wanted to draw a line through at least one of the baubles to create a triangle in that corner of the card.

Linus suggested we draw the line through the red bauble in the direction which made the line as short as possible. Tynia said to draw the line through the gold bauble in the direction which made the area of the triangle formed as small as possible. As a compromise we decided to draw the line through both baubles.

Luckily this line satisfied both Linus’s and Tynia’s requirement. It was 20 cm long and the triangle formed had an area of 80 cm².

How far apart were the two baubles?

[enigma1167]

### One response to “Enigma 1167: Christmas lines”

1. Jim Randell 16 May 2016 at 7:56 am

Here is an analytical solution:

For the the gold bauble, the minimal area for a triangle with the point (x, y) on its hypotenuse is when the triangle is half of the rectangle through (2x, 2y).

So, for the area of the triangle to be 80, the coordinates of the gold bauble must satisfy:

(2x)(2y)/2 = 80
xy = 40

And the diagonal is from (0, 2y) to (2x, 0) must be of length 20, so:

(2x)² + (2y)² = (20)²
x² + y² = 100

Solving these equations gives us the possible positions of the gold bauble:

(x, y) = (2√5, 4√5) or (4√5, 2√5)

So (taking the first solution), we can suppose the diagonal of the triangle is from (0, 8√5) to (4√5, 0).

For the red bauble, the minimal diagonal for a triangle with the point (a, b) on its hypotenuse is the diagonal of the rectangle through (a + t, (a + t)b / t) where:

t³ = ab²

But these diagonals are the same, so:

a + t = 4√5
(a + t)b / t = 8√5

Solving these two equations:

b = 2t
b³ = 8t³ = 8ab²
b = 8a (as: b ≠ 0)

So (a, b) lies 1/5 of the way along the diagonal, i.e. at ((4/5)√5, (32/5)√5).

The distance between the baubles is then:

d² = |x − a|² + |y − b|²
d² = |2√5 − (4/5)√5|² + |4√5 − (32/5)√5|²
d² = 36/5 + 144/5
d² = 36
d = 6

Solution: The distance between the baubles is 6 cm.

This diagram shows the positions of the gold (orange) bauble, the red bauble, and the line (blue). Along with the circle, x² + y² = 100, and hyperbola, xy = 40, used to determine the possible positions of the gold bauble.

(The diagram is drawn as a standard graph, so it’s as if we are considering the bottom left-hand corner of the card instead of the top left-hand corner).

If the other position of the gold bauble was chosen the x and y axes would be interchanged.