r/askmath • • 2d ago

Resolved Shortest path across a rectangle. Is the solution wrong???

Post image

I'm CONFIDENT my answer (7√5) is correct. I compared this with some of my friends and they got the exact same thing. But the solution says 15? Obviously, the solution could be wrong, but seeing as this is a question from the official Swiss Mathematical Olympiad, I doubt this is the case. I probably just oversaw some crazy cool solution. Problem is First Round Senior 2026 from here

144 Upvotes

44 comments sorted by

92

u/DJembacz 2d ago

You can pick a different rectangle and get a shorter path. Taking the rectangle with sides 9 & 7+5 gives you the distance 15.

19

u/CerberusTick 2d ago

Oh, great. Solved. Thanks :D

1

u/LordTengil 2d ago

Incidenteally, you have then also foind a pythagorena triangles, with sides 9, 12, 15, as 9^2+12^2 = 15^2. Or if you divide the sides by 3, you get 3,4, and 5. Always gives you right angled triangle.

1

u/Tsqaaalarab 6h ago

Which is usually the case for an Olympiad question. I used to do math contests, and every question had a shortcut. A radical in the answer was usually a hint you did it wrong.

10

u/get_to_ele 2d ago

If you have a rectangular block with edges of lengths a, b, and c (where a < b < c), the shortest path is always sqrt( (a+b)^2 + c^2 )

But going through the process of discovering that answer:

The distance has three local minimums, depending on which pair of rectangles you to choose to walk over so you can determine which path is shortest (6 minimums actually but 3 of them are mirrors of the first 3). I calculate each of the paths first, then choose the shortest.

Shortest path moving over the Top and Right rectangle is the blue path, and on the flattened rectangles, the shortest path is sqrt((9+5)^2 + 7^2 ) =15.652

Shortest path moving over Front and Right rectangle is green paths and on the flattened rectangles, shortest path is sqrt((9+7)^2 + 5^2 )=16.763

Shortest path moving over Top and Back rectangle is yellow paths and on the flattened rectangles, shortest path is sqrt((7+5)^2 + 9^2 )=15

But then I notice the shortest path is the one where the flattened adjacent rectangles are closest to a SQUARE (ie you keep the longest side and add the two shorter sides).

3

u/ZedZeroth 1d ago

Yes, I guess I was thinking the same thing numerically. Small2 + Big2 is bigger than Medium2 + Medium2.

Thinking of it as approaching a square is more elegant though :)

1

u/Her_Lovely_Tentacles 2d ago

What do you mean by "green path" etc? Was there supposed to be another picture?

9

u/get_to_ele 1d ago

Sorry… something happened with my picture upload.

Like I forgot to upload, duh.

0

u/ChurriiMelt 2d ago

you make this stuff sound way easier than it is, lowkey impressive

31

u/FirstRyder 2d ago

You have the general right idea - flatten the box and measure from A to B. But there are two ways to do it. One gives you a side of (9+5) and a side of 7. One gives you a side of 9 and a side of (7+5).

Your way gives 7sqrt(5). The other way gives 15. 15 is smaller. Both are valid paths, but only one is the shortest paths.

12

u/Patsastus 2d ago

There's a third way as well (going across the two nearest surfaces), which gives you a (9+7)x5 triangle, which is worse than either, but just to list all the options.

2

u/LanguageSuitable8538 2d ago

So unfolding the box along the longest edge produces the rectangle that's the closest to a square, and that's the one with the shortest diagonal to traverse... Makes intuitive sense, I guess

1

u/hughperman 2d ago

There are infinite worse options, but you do need to not restrict yourself to unpacking the box just by its edges.

4

u/get_to_ele 2d ago

Patsastus is correct: you either test just 1 using the “advanced” method, or you test 3 because you didn’t know the shortcut, and are testing all 3 local minimums.

(1) you know there is just 1 to test (where you already know to choose the two flattened rectangles that are closest to a square and therefore if the edges a < b < c, path = sqrt((a+b)^2 + c^2 )

OR

(2) you don’t know the trick, and test the minimum of each of the 3 flattened rectangle pairs.

I don’t see a likely scenario where you test two rectangle pairs, but don’t test the third.

1

u/Annual-Advisor-7916 1d ago

Maybe I'm stupid and/or misunderstanding the problem but why isn't it just sqrt(9^2+7^2) + 5?

First go diagonally until you are over B and then go down 5?

4

u/Dekrznator 1d ago

That gives you 16.4. Unfolded route gives 15.6 distance.

1

u/myhedhurts 1d ago

Just a heads up that there’s a different way to fold that yields a 3,4,5 triangle and 15 total units min distance

2

u/Dekrznator 1d ago

Yes ofc.

I was refering to picture he was comenting on.

1

u/Annual-Advisor-7916 1d ago

Man, I feel stupid now. Thanks for clarifying. I totally didn't think about unfolding.

1

u/myhedhurts 1d ago

That will get you there but it covers almost 16 and a half units of distance if you solve your formula. Top comment shows a solution with 15 units of distance. This is the shortest path

2

u/Annual-Advisor-7916 1d ago

Thanks for replying, I totally didn't think about unfolding. Makes sense obviosuly. I guess late night geometry isn't one of my strong suits...

6

u/Cesar2266 1d ago

Jesus, seeing the comments made me go mental! I get the "flattening the box" argument, but can someone explain to me why we can't define a path

f(x) = \sqrt{81 + x2} + \sqrt{25 (7-x)2}

and then try to minimize its derivative? It seems perfectly reasonable to me, but the minimums I could find are ever slightly larger than 15. Anyone got an explanation for this?

4

u/Ylopolo 1d ago edited 1d ago

Assuming it was supposed to be \sqrt(81+x2)+\sqrt(25+(7-x)2) and assuming that you meant 'minimize using its derivative' (idk why would you minimize a derivative itself) then you are taking into account only paths going over 9x7 and 7x5 rectangles (as did OP), forgetting that you can also travel over 9x5 and 7x5 or 9x7 and 9x5, and it is the latter which gives you the shortest of shortest paths. Try minimizing \sqrt(52+x2)+\sqrt(72+(9-x)2) and it should work

5

u/Bob_JediBob 2d ago

You had the right idea unfolding the box to get a straight line. There are 3 faces you can cross first, so you need to find the paths going over all 3 faces and take the shortest. You’ve just taken one of the others.

4

u/jgregson00 2d ago edited 1d ago

I like how you put "confident" in all caps...

2

u/Grrumpy_Pants 1d ago

Right approach, but you have to recognize that there are multiple ways the rectangle can be flattened depending on the faces you use. There are 3 unique ways to flatten the rectangle, one of which produces the result of 15.

Try and draw all three ways the path can be flattened and you should see it from there.

2

u/Snipolimpics 1d ago

In case a visual representation is handy for the answer of 15 (= swrt (5+)7) squard with 9 squared)

0

u/mutual_im_sure 1d ago

Helpful. Did you immediately go to that solution, or did you have to try a few to see which was shortest?

2

u/Snipolimpics 1d ago

I tried (9+7) bij 5 too as that seemed the fastest from the picture, before finally realising that minimizing the squares would be done by sharing the load as optimally as possible among the two components

2

u/Classic_Department42 2d ago

I thought the same at first. But you can also unfold the box differently  (going along the back wall. This gives you a rectangle of 9x12 which has a length of sqrt (81+144)=sqrt(225)=15  if 15 is smaller than 7 sqrt 5 then it is shorter.

1

u/AlterEgo5695 2d ago

You missed the 3'rd option of the snail moving across the longest edge -- we get

x^2  =  9^2 + (7+5)^2  =  9 * (3^2 + 4^2)  =  9 * 25    =>    |x|  =  15

Since that option is shorter than any other options, it is indeed the shortest path.


Rem.: To prove that, use folding and mirroring to map all paths onto the xy-plane.

1

u/Aquadroids 2d ago

Snail can also take another path by cutting across the top and back faces, which becomes finding the hypotenuse of a right triangle of sides 9 and 7 + 5 = 12. Sqrt(92 + 122 ) = sqrt(225) = 15, which is a little bit shorter than 7sqrt(5).

1

u/supersensei12 1d ago

Choose the way to flatten the box so that the legs are closest in value.

1

u/peepooloveu 1d ago edited 1d ago

I'm a bit confused, how do you guys get anything other than 15? I'm not trying to be a smartass but I only know how to get 15. I assume flattening the box meant unfolding it to make it 2D

2

u/PapaDindon 1d ago

do the same graph but open the box from a different side.

1

u/MoJoSto 1d ago

Here is a model built by claude that might help you visualize it. Bots are pretty great at modeling problems in a way that makes them more understandable:

https://claude.ai/artifact/D37rVWFPWZsRnitBbgj4Zn

1

u/Real-Persimmon2451 1d ago

Since no one has gone through the full picture, I’ll add: imagine you can’t cut 2 of the dashed lines in the picture: 3 pick 2 has 3 possibilities. If you cut 2 of the 3, you’ll see that you can get the 3 2D shapes already discussed here

1

u/dapperdavy 1d ago

You have correctly calculated the length of the line you have drawn.

Now try the same, but path via the vertical face at the back rather than the face on the right.

1

u/PapaDindon 1d ago

Depending of the path, 2 dimensions will be sum and on will be alone. sqrt( (5+7)2 +92 ) sqrt( (5+9)2 +72 ) sqrt( (7+9)2 +52 )

Since the goal is to find the shorter path, the best solution will be the more "Square". 12 and 9 have the smallest difference so it is the shortest.

1

u/zocoworld 1d ago

You assumed this path was the shortest and you calculated it. Your calculus is correct but the answer may be false.

You didnt put the shortest path into equation and solved it.

You should call X Y the coordinates Where the snail crosses the biggest rectangle, put it into 2 equations, and find the lowest lenght.

1

u/CompetitionJunior435 1d ago

There is more than one path to assess. Yours goes across the top (the 9x7 face) and down the small side (the 5x7). The other path to assess is across the large side facing the viewer (9x5 face) and then around the small side (the 7x5 face). The third path is across the top (9x7) then down the back face (9x5 face)

Across the top is sqrt(14^2 + 7^2) = sqrt(196 + 49) = sqrt(245) = 15.65 as you found.

Around the sides is sqrt(16^2 + 5^2) = sqrt (256 + 25) = 16.76

Down the back is sqrt(12^2 + 9^2) = sqrt(144 + 81) = sqrt(225) = 15

1

u/Plutonic_GD 16h ago

If you unfold the two sides that correspond to the point, you can see two rectangles. Easy way to know which part is shorter? Compare the ratios of the sides of each rectangle. You can decide if you want to compare with the greater side above (14/7, 12/9), or the lower side above (7/14, 9/12).

Then pick the rectangle with the ratio closest to 1 (as the one of a square).

1

u/AdhesiveSeaMonkey 1d ago

Other's have mentioned the correct solution. I'm just here to say that I absolutely hate net problems, as I am 100% unable to imagine/picture anything in my head (aphantasia). Creating nets for problems like this takes me forever, and a lot of erasing.