Christmas gift

Geometry Level 4

Last Christmas, Patty was very busy embroidering a beautiful hand-made painting for Tony. When she finished, she placed a tiny hook behind the frame so that Tony could hang it on the wall.

Tony is very bad at decorating his house, but he really likes his gift so he wants it to be placed in the best place of the house. He plans to nail two nails on the wall with a rope tied to them, and he wants to have a preview of where the painting will be placed at the end, before he ruins his wall with the holes of misplaced nails.

He has drawn a Cartesian plane on the wall and has chosen two points: ( 3 , 8 ) (-3, 8) and ( 5 , 2 ) (5, 2) , where he pretends to nail each nail, and he plans to use a rope of length 15 15 . Now, he doesn’t know where the tiny hook of his gift will be located.

Please help Tony to visualize his new decoration, calculating where that hook will be. Assume that the painting is heavy enough to keep the rope tense, and the knots to tie it to the nails don’t diminishes the length. Tony’s world is very boring, so friction does not exist.

If the coordinates of the hook are ( x 0 , y 0 ) (x_0, y_0) , report your answer as 1 0 3 ( x 0 + y 0 ) \lfloor 10^3(x_0+y_0) \rfloor .


Source: Programming Contest X - Gran Premio ACM México CA 2017 - Fecha 3


The answer is 1547.

This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try refreshing the page, (b) enabling javascript if it is disabled on your browser and, finally, (c) loading the non-javascript version of this page . We're sorry about the hassle.

3 solutions

David Vreken
Jan 3, 2019

Let p p be the length of the rope between ( 5 , 2 ) (5, 2) and the hook. Since the rope has a length of 15 15 , the length of the rope between ( 3 , 8 ) (-3, 8) and the hook will be 15 p 15 - p .

The locus of points for the hook are then ( x 5 ) 2 + ( y 2 ) 2 = p 2 (x - 5)^2 + (y - 2)^2 = p^2 and ( x + 3 ) 2 + ( y 8 ) 2 = ( 15 p ) 2 (x + 3)^2 + (y - 8)^2 = (15 - p)^2 . Eliminating p p gives the ellipse 644 x 2 3208 x + 756 y 2 7944 y + 384 x y 6661 = 0 644x^2 - 3208x + 756y^2 -7944y + 384xy - 6661 = 0 .

Due to gravity, the hook will fall to the lowest point of this ellipse, which is a y y -value with only one x x -value. Solving the ellipse equation for x x gives x = 802 96 y ± 75 5 ( 4 y 2 + 40 y + 61 ) 322 x = \frac{802 -96y \pm 75\sqrt{5(-4y^2 + 40y + 61)}}{322} , which has one x x -value when 4 y 2 + 40 y + 61 = 0 -4y^2 + 40y + 61 = 0 , or when y = 5 ± 1 2 161 y = 5 \pm \frac{1}{2}\sqrt{161} .

The lower point solves to ( x 0 , y 0 ) = ( 1 + 24 161 161 , 5 1 2 161 ) (x_0, y_0) = (1 + \frac{24}{161}\sqrt{161}, 5 - \frac{1}{2}\sqrt{161}) , which makes 1 0 3 ( x 0 + y 0 ) = 1547 \lfloor 10^3(x_0 + y_0) \rfloor = \boxed{1547} .

Let F 1 = ( 3 , 8 ) \vec{F_1}=(-3,8) and F 2 = ( 5 , 2 ) \vec{F_2}=(5,2) . If we trace all the points where the hook can be keeping tense the rope, we get an ellipse with foci F 1 \vec{F_1} and F 2 \vec{F_2} , and center C = 1 2 ( F 1 + F 2 ) = ( 1 , 5 ) \vec{C} = \dfrac{1}{2}\left(\vec{F_1}+\vec{F_2}\right)=(1,5) , and we just want its lowest point. We will find a parametric form of the ellipse first.

Let a a , b b and c c be the semi-major axis length, semi-minor axis length and semi focal distance, respectively. We see that 2 c = F 2 F 1 = 10 2c=\left\lVert \vec{F_2}-\vec{F_1} \right\rVert = 10 , so c = 5 c=5 . We also have a = 15 2 a=\frac{15}{2} , and b = a 2 c 2 = 5 5 2 b=\sqrt{a^2-c^2}=\frac{5\sqrt{5}}{2} .

The next step is to find an orthonormal basis { e 1 ^ , e 2 ^ } \{\hat{e_1}, \hat{e_2}\} , where e 1 ^ \hat{e_1} is a unit vector in the direction of the major axis and e 2 ^ \hat{e_2} points in the direction of the minor axis. We see that e 1 ^ = F 2 F 1 F 2 F 1 = 1 5 ( 4 , 3 ) \hat{e_1}=\dfrac{\vec{F_2}-\vec{F_1}}{\left\lVert \vec{F_2}-\vec{F_1} \right\rVert}=\dfrac{1}{5}(4,-3) and e 2 ^ = 1 5 ( 3 , 4 ) \hat{e_2}=\dfrac{1}{5}(3,4) .

Then, we are ready to write the parametric form of the ellipse: r ( t ) = C + e 1 ^ a cos ( t ) + e 2 ^ b sin ( t ) = ( 1 , 5 ) + 3 2 ( 4 , 3 ) cos ( t ) + 5 2 ( 3 , 4 ) sin ( t ) \vec{r}(t) = \vec{C} + \hat{e_1}a\cos(t) + \hat{e_2}b\sin(t) = (1,5) + \dfrac{3}{2}(4,-3)\cos(t) + \dfrac{\sqrt{5}}{2}(3,4)\sin(t) , where 0 t 2 π 0 \leq t \leq 2\pi .

In the lowest and highest points of the ellipse, for some value of t = t 0 t=t_0 , we have that the y y -component of r ( t 0 ) \vec{r}'(t_0) is zero. In this case r ( t ) = 3 2 ( 4 , 3 ) sin ( t ) + 5 2 ( 3 , 4 ) cos ( t ) \vec{r}'(t)=\dfrac{3}{2}(-4,3)\sin(t) + \dfrac{\sqrt{5}}{2}(3,4)\cos(t) , so we have to solve 9 2 sin ( t 0 ) + 2 5 cos ( t 0 ) = 0 \dfrac{9}{2}\sin(t_0)+2\sqrt{5}\cos(t_0)=0 , which gives tan ( t 0 ) = 4 5 9 \tan(t_0)=-\dfrac{4\sqrt{5}}{9} .

We want to find cos ( t 0 ) \cos(t_0) and sin ( t 0 ) \sin(t_0) , and we get two values for each of them: cos ( t 0 ) = ± 9 161 \cos(t_0) = \pm \dfrac{9}{\sqrt{161}} and sin ( t 0 ) = 4 5 161 \sin(t_0) = \mp\dfrac{4\sqrt{5}}{\sqrt{161}} .

Finally, we get two points: r ( t 0 ) = ( 1 , 5 ) ± ( 48 , 161 ) 2 161 \vec{r}(t_0)=(1,5) \pm \dfrac{(48,-161)}{2\sqrt{161}} . The lowest one has the least value of the y y -coordinate, and that is ( x 0 , y 0 ) = ( 1 + 24 161 , 5 161 2 ) ( 2.89146 , 1.34428 ) (x_0,y_0)=\left(1+\dfrac{24}{\sqrt{161}},5-\dfrac{\sqrt{161}}{2}\right) \approx (2.89146,-1.34428) , making the answer 1547 \boxed{1547} .

Steven Chase
Dec 28, 2018

The coordinates of the painting hook are H = ( x 0 , y 0 ) \vec{H} = (x_0,y_0) . Call the nail points P \vec{P} and Q \vec{Q} . We know that the sum of the lengths of the hook to P \vec{P} and the hook to Q \vec{Q} must be 15 15 . We also know that the tension in the rope is uniform, and that the sum of the horizontal forces must be zero. Therefore, the unit vector from H \vec{H} to P \vec{P} must have an equal and opposite x x component relative to the the unit vector from H \vec{H} to Q \vec{Q} . Mathematically, the solution criteria are:

P H + Q H = 15 P x H x P H + Q x H x Q H = 0 |\vec{P} - \vec{H}| + |\vec{Q} - \vec{H}| = 15 \\ \frac{P_x - H_x}{|\vec{P} - \vec{H}|} + \frac{Q_x - H_x}{|\vec{Q} - \vec{H}|} = 0

Solving results in ( x 0 , y 0 ) ( 2.8915 , 1.3443 ) (x_0,y_0) \approx (2.8915,-1.3443)

Here is the code for a hill-climbing solution (since the question is from a programming contest):

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
import math
import random

Px = -3.0
Py = 8.0

Qx = 5.0
Qy = 2.0

x0 = -5.0 + 10.0 * random.random()
y0 = -5.0 + 10.0 * random.random()

delta = 0.001

minres = 99999999.0

########################################################################################

for j in range(0,2*10**6):

    x0m = x0 + delta * (-1.0 + 2.0 * random.random())
    y0m = y0 + delta * (-1.0 + 2.0 * random.random())

    DP = math.hypot(x0m-Px,y0m-Py)
    DQ = math.hypot(x0m-Qx,y0m-Qy)

    D = DP + DQ

    uPx = (Px - x0m) / DP
    uQx = (Qx - x0m) / DQ

    res1 = math.fabs(D - 15.0)
    res2 = math.fabs(uPx + uQx)

    res = res1 + res2 

    if res < minres:
        minres = res

        x0 = x0m
        y0 = y0m


########################################################################################

if minres < 0.001:

    print minres
    print ""
    print x0
    print y0
    print ""
    print math.floor(1000.0*(x0+y0))
    print "###########################"
    print ""

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...