Train route

Geometry Level 4

Two villages (points B and C) are to receive a train connection to their neighboring city (point A), as shown in the diagram.

In order to save money when building the train route, only the connection with the shortest rail route is selected.

How many kilometers of rails must be laid? Round the result to the nearest integer.

Note : The railroad does not necessarily have to be built on the 30 km segments indicated in the diagram. A railroad switch can be built to allow a railroad to split into different paths.


The answer is 46.

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.

9 solutions

Markus Michelmann
Dec 11, 2017

The connection vectors b = A B \vec b = \vec{AB} and c = A C \vec c = \vec{AC} between the city and the villages each have the same length b = c = 30 b = c = 30 and an angle α = ( b , c ) = 4 0 \alpha = \angle(\vec b, \vec c) = 40^\circ . The idea is to lay a Y-shaped rail track in-between with a turnout in point P P . Although this route is not optimal for the train service, the construction costs for the track can be minimized. The connection vector to point P P equals r = ( r cos α 2 r sin α 2 ) \vec r = \left( \begin{array}{c} r \cos \frac{\alpha}{2} \\ r \sin \frac{\alpha}{2} \end{array} \right) The total length of the track results l = r + b r + c r = r + 2 b r = r + 2 ( b r cos α 2 ) 2 + r 2 sin 2 α 2 = r + 2 b 2 + r 2 2 r b cos α 2 \begin{aligned} l &= r + |\vec b - \vec r| + |\vec c - \vec r| = r + 2 |\vec b - \vec r| \\ &= r + 2 \sqrt{ (b - r \cos \frac{\alpha}{2})^2 + r^2 \sin^2 \frac{\alpha}{2} } \\ &= r + 2 \sqrt{ b^2 + r^2 - 2 r b \cos \frac{\alpha}{2} } \\ \end{aligned} If we plot the function l ( r ) l(r) , we get a minimum at r 22.3 km r \approx 22.3\,\text{km} and l 46 km l \approx 46\,\text{km} .

Not that I see your solution, I get for what you were asking, but this wasn't remotely clear to me from the wording of the problem.

A Former Brilliant Member - 3 years, 5 months ago

How do we know that the optimal solution is for angle PAB to be 20 degrees?

Fredric Kardon - 3 years, 5 months ago

Log in to reply

Because of symmetry in the configuration.

Tom Verhoeff - 3 years, 5 months ago

I see people mostly working out complicated formulae to minimize in order to find the optimum. But this is a well-known class of problems, the optimum of which has 3 angles of 120° around point P. All you have to do is work out the sides of the 20°-120°-40° triangle.

Jerry Barrington - 3 years, 5 months ago
Arjen Vreugdenhil
Dec 24, 2017

Because the situation is symmetric, choose the origin at point A and run the x x -axis along the angle bisector of C A B \angle CAB . The coordinates of B , C B,C are ( a , ± b ) (a,\pm b) where a = 30 cos 2 0 a = 30\cos 20^\circ and b = 30 sin 2 0 b = 30\sin 20^\circ .

The shortest solution may a involve point P P and three pieces of track A P , B P , C P AP, BP, CP . We don't exclude the possibility that two pieces of track suffice; in that case, we would simply have P = A P = A . Let the coordinates of P = ( x , y ) P = (x,y) . Symmetry suggests y = 0 y = 0 (we can make this more precise later). The amount of rails needed is a function of x x , ( x ) = x + 2 ( a x ) 2 + b 2 . \ell(x) = x + 2\sqrt{(a - x)^2 + b^2}. Minimizing this requires a zero derivative, i.e. 0 = d d x = 1 2 ( a x ) ( a x ) 2 + b 2 . 0 = \frac{d\ell}{dx} = 1 - \frac{2(a - x)}{\sqrt{(a - x)^2 + b^2}}. Multiply by the denominator, separate, and square to find ( a x ) 2 + b 2 = ( 2 ( a x ) ) 2 , (a - x)^2 + b^2 = (2(a-x))^2, 3 ( a x ) 2 = b 2 , 3(a - x)^2 = b^2, x = a b 3 , x = a - \frac{b}{\sqrt 3}, = a + 3 b . \ell = a + \sqrt{3}\:b.

Substitute a = 30 cos 2 0 a = 30\cos 20^\circ and b = 30 sin 2 0 b = 30\sin 20^\circ to conclude 46 \ell \approx \boxed{46} km.


Note that for this optimal solution, A P B = B P C = C P A = 12 0 \angle APB = \angle BPC = \angle CPA = 120^\circ .

I think I have lost track of which variables or side lengths you are using. where does x + 2*sqrt{(a-x)^2 - b^2} come from? more specifically, what do (a) and (b) represent?

Matthew Agona - 3 years, 5 months ago

I did something very similar, but I put the lenght of the rails as a function of the angle APC, it involved a lot of sines and got very hard to diferentiate so I had to resort to computation to find the answer, your way is a lot simpler. Well thought! =D

Diego Leal Petrola Martins - 3 years, 5 months ago

At the end should be L=a+sqrt(3)*b

Mattia Mariantoni - 3 years, 4 months ago
David Vreken
Dec 23, 2017

Since A B C \triangle ABC is an isosceles triangle, the minimum amount of track would form a Y-shape as shown below, where A D AD bisects A \angle A .

The total amount of track would be T = b + 2 a T = b + 2a , where a = 30 sin 20 ° sin x a = \frac{30 \sin 20°}{\sin x} and b = 30 sin ( 160 ° x ) sin x b = \frac{30 \sin (160° - x)}{\sin x} according to the law of sines, so T = 30 sin ( 160 ° x ) + 60 sin 20 ° sin x T = \frac{30 \sin (160° - x) + 60 \sin 20°}{\sin x} .

The minimum amount of track would be when T = 0 T’ = 0 , or when

( sin x ) ( 30 cos ( 160 ° x ) ( 1 ) ) ( 30 sin ( 160 ° x ) + 60 sin 20 ° ) cos x sin 2 x = 0 \frac{(\sin x) (30 \cos (160° - x) (-1)) - (30 \sin (160° - x) + 60 \sin 20°) \cos x}{\sin^2 x} = 0

30 sin x cos ( 160 ° x ) 30 sin ( 160 ° x ) cos x 60 sin 20 ° cos x = 0 -30 \sin x \cos (160° - x) - 30 \sin (160° - x) \cos x - 60 \sin 20° \cos x = 0

30 ( sin x cos ( 160 ° x ) + sin ( 160 ° x ) cos x ) 60 sin 20 ° cos x = 0 -30 (\sin x \cos (160° - x) + \sin (160° - x) \cos x) - 60 \sin 20° \cos x = 0

30 sin ( x + 160 ° x ) 60 sin 20 ° cos x = 0 -30 \sin (x + 160° - x) - 60 \sin 20° \cos x = 0

30 sin 160 ° 60 sin 20 ° cos x = 0 -30 \sin 160° - 60 \sin 20° \cos x = 0

30 sin ( 180 ° 20 ° ) 60 sin 20 ° cos x = 0 -30 \sin (180° - 20°) - 60 \sin 20° \cos x = 0

30 sin 20 ° 60 sin 20 ° cos x = 0 -30 \sin 20° - 60 \sin 20° \cos x = 0

60 sin 20 ° cos x = 30 sin 20 ° -60 \sin 20° \cos x = 30 \sin 20°

cos x = 1 2 \cos x = -\frac{1}{2}

x = 120 ° x = 120°

The minimum amount of track is therefore T = 30 sin ( 160 ° 120 ° ) + 60 sin 20 ° sin 120 ° 46 T = \frac{30 \sin (160° - 120°) + 60 \sin 20°}{\sin 120°} \approx \boxed{46} .

Yk Ge
Dec 27, 2017

The problem is basically asking for a point which has minimum total distance to A B and C. That's the Fermat Point of triangle. Denote it as P. It has three 120° angles when connected to the three vertexes (can be proved geometrically or physically). Triangle BAC being isosceles simplifies the calculation. By Law of Sines, we have sin120/30=sin20/PB=sin40/PA. So PA~=22.3 , PB~=11.8 , and hence total length of railway shall be PA+2PB ~=46 2017.12.27

Chan Tin Ping
Dec 26, 2017

There exist a point P P such that A P + B P + C P AP+BP+CP achieve it's minimum value. We are finding the minimum value of A P + B P + C P AP+BP+CP . Rotate triangle A B C ABC and point P P with 60 ° 60° degree counterclockwise by centre A A . Let the new image is triangle A B C AB'C' and point P P' .

Note that A P = A P AP=AP' and P A P = 60 ° \angle PAP'=60° , so P P = A P PP'=AP . Besides that, B P = B P B'P'=BP . Hence, we can conclude that A P + B P + C P = P P + B P + C P AP+BP+CP=PP'+B'P'+CP . P P + B P + C P PP'+B'P'+CP achieve its minimum value when B C B'C is a straight line, or B A C B'AC is a triangle.

Hence, the required length is 3 0 2 + 3 0 2 2 × 3 0 2 × cos ( 60 ° + 40 ° ) = 45.96 \sqrt{30^2+30^2-2\times 30^2 \times \cos(60°+40°)}=45.96 . Hence, the answer is 46 \large 46 .

Zach Bian
Dec 28, 2017

For people like me who are bad at geometry:

 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
56
57
58
59
60
from math import *

def rad(angleD):
    return angleD*pi/180

def varAndPrint(variable):
    try:
        for k,v in globals().items():
            if(v == variable):
                print(k,v)
    except:
        for k,v in locals().items():
            if(v == variable):
                print(k,v)

# Begin:
'''
Half the length from B to C
'''
bc_half = 30*sin(rad(20))
'''
The altitude of the triangle from A. It's an isoceles triangle so it's gonna be a track
along the altitude plus two symmetric tracks shooting off of this track to B and C.
'''
altA = 30*cos(rad(20))

# The function we want to zero out:
def solveMe(rA, rB):
    try:
        return abs(asin((altA-rA)/rB) - rad(70) + asin(rA * sin(rad(20))/rB))
    except:
        return inf
'''
O(n**2) solution. n being the number of datapoints along the altitude of A.
rA is how long the main track is. We iterate through possible values and minimize rB
rB is length of one of the branch tracks
I made a little optimization on the search space of rB using the triangle inequality
'''
minTracks = 70
rA = 0
while rA < altA:
    rB = bc_half
    bestRB = -1
    minSol = 30
    while rB < altA-rA+bc_half:
        cache = solveMe(rA,rB)
        if cache < minSol:
            minSol = cache
            bestRB = rB
        rB += .05

    cache = rA+bestRB*2
    if cache < minTracks:
        minTracks = cache

    rA += .05

varAndPrint(minTracks)
minTracks = round(minTracks)
varAndPrint(minTracks)

Yields:

1
2
minTracks 45.92120859954035
minTracks 46

Denis Husadzic
Dec 26, 2017

Using basic trigonometry, we can find out that our points A , B , C A,B,C can be placed in coordinate system in the following way:

where a = 30 sin ( 2 0 ) , b = 30 cos ( 2 0 ) a = 30\sin(20^\circ), b = 30\cos(20^\circ) .

The blue lines are rails to be built, so we want to minimize their total length, which corresponds to minimizing the function f ( x , y ) = ( x a ) 2 + y 2 + ( x + a ) 2 + y 2 + x 2 + ( y b ) 2 f(x,y) = \sqrt{(x - a)^2 + y^2} + \sqrt{(x + a)^2 + y^2} + \sqrt{ x^2 + (y - b)^2} .

Now, this would be extremely tedious to minimize by hand. Luckily, such a point P P is a known center of a triangle - Fermat point . Following the construction given at Wikipedia, it is obvious that minimum of f f occurs when x = 0 x= 0 , so we can simplify the problem to minimizing g ( y ) = f ( 0 , y ) = 2 y 2 + a 2 + ( y b ) 2 g(y) = f(0,y) = 2\sqrt{y^2+a^2}+\sqrt{(y-b)^2} . Furthermore, it is obvious that minimum should occur for y [ 0 , b ] y\in [0,b] , and thus g g simplifies to h ( y ) = 2 y 2 + a 2 + ( b y ) h(y) = 2\sqrt{y^2+a^2}+(b-y) . Taking derivative gives us h ( y ) = 2 y y 2 + a 2 1 h'(y) = \frac{2y}{\sqrt{y^2+a^2}} - 1 and solving h ( y ) = 0 h'(y) = 0 gives us y = a 3 y = \frac a{\sqrt 3} . Thus, the minimum distance is h ( a / 3 ) 45.9627 46. h(a/\sqrt 3) \approx 45.9627 \approx 46.

Will van Noordt
Dec 28, 2017

Let X X be a set of points, where, for i { 1 , 2 , . . . , n } , x i X i\in \{1,2,...,n\}, x_i \in X . Let ( x , y ) (x,y) be the location of the rail switch. We wish to minimize the total distance D = d i = ( x x i ) 2 + ( y y i ) 2 D = \sum d_i = \sum \sqrt{(x-x_i)^2 + (y-y_i)^2}

For the sake of ease, we minimize the sum of squares of distances, D s D_s :

D s = ( x x i ) 2 + ( y y i ) 2 D_s = \sum (x-x_i)^2+(y-y_i)^2

We differentiate with respect to x x :

x D s = 2 ( x x i ) = 0 \partial_xD_s = 2\sum (x-x_i) = 0

Solving for x x , we see that x = 1 n x i = x ˉ x = \frac{1}{n}\sum x_i = \bar{x} . Similar analysis shows that y = y ˉ y=\bar{y} . Computing these values gives us ( x ˉ , y ˉ ) = ( 17.66 , 6.428 ) (\bar{x},\bar{y})=(17.66,6.428) . The total length of track is now simply the sum of the distances from this point to the points ( 0 , 0 ) (0,0) , ( 30 , 0 ) (30,0) , and ( 30 cos 40 , 30 s i n 40 ) (30\cos40,30sin40) , which yields approximately 46 km.

Note that this can be generlized to higher dimensions for larger sets of points.

Satvik Golechha
Dec 26, 2017

By the triangle inequality, and the fact that the shortest distance between any two points is the straight line distance, we can say that the shortest rail will be consumed when a point in the triangle will have minimum sum of distances with the points A, B and C.

Every isolated system tends to acquire a minimum potential energy state.

Now, let us keep the triangle on a table, and poke holes at the points where A, B, and C lie. Now, we take three strings (length quite long), and join one end inside the triangle, and the other coming down from the holes, and we attach a mass M M to all three. Leaving them isolated, they rearrange such that the sum of heights of the three masses from ground is minimized, because the gravitational potential energy is m g h mgh .

This point minimizes our rail route, as the length of the strings was the same. Now, at the junction,vector sum of three equal forces is null, which means they are at 12 0 120^{\circ} to each other.

With this information, we can easily calculate the distances by Sine Rule.

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...