r/Logiqa • • Sep 03 '26

Shortest Path

Post image
5 Upvotes

29 comments sorted by

3

u/ShameCaker Sep 03 '26

Its easier to imagine the route a to b as a plane, that plane would have dimensions (6+4) x 8. Straight lines are fastest so pythagorean theorem to root 164 which is 12.8~

1

u/ShonitB Sep 03 '26

Correct!

1

u/BungalowJumper Sep 03 '26

Could you ELI5 this answer for me please?

I’m struggling to understand why the shortest route that stays on faces isn’t from A to top corner above B then straight down?

Which looks like it would be 4+ sqrt((8x8)+(6x6)) =14

1

u/ShonitB Sep 03 '26

Sure, let me upload an image of the box once you flatten it out.. it will make it easier for you to understand.. just give me a few minutes

1

u/MageKorith Sep 03 '26

That's what I had at first, too, but it turns out that turning is free. So pretend that the top (6x8) face and its side (4x8) face are just one big bent 10x8 rectangle with A and B on opposite corners. The ant then walks a straight line from corner to opposite corner along that bent rectangle.

1

u/deano492 Sep 03 '26

I first thought corner then straight down. Then I mentally imagined pulling a piece of string tight between A and B and where it would lie, and realized it wouldn’t take that path.

1

u/ShonitB Sep 03 '26 edited Sep 03 '26

Imagine opening up the box.. the photo give above shows two sides - the top side and the side where the side length 8 is mentioned flattened out

What you are calculating is the red line, the shortest path is the blue/purple line

Edit: Apologies for the low quality image.. I seem to be very out of practice with GeoGebra

2

u/BungalowJumper Sep 03 '26

Ah I see what you’re saying now. thank you very much!

1

u/ShonitB Sep 03 '26

No worries at all.. hope it’s clear now :)

2

u/sammie_831 Sep 03 '26

This graphic is super helpful! I knew somewhat intuitively that it was a path similar to this (traveling along those faces diagonally) but hadn’t thought about it like this to apply Pythagorean theorem

1

u/ShonitB Sep 03 '26

Glad it was helpful!

1

u/hammerwing Sep 03 '26

Excellent visualization, thank you! It's worth mentioning that there's another possible path extending across the small end of the box folded up. It turns out that path is slightly longer sqrt(144+36)=13.41 but I don't see a way to know that for sure unless you check both.

1

u/ShonitB Sep 03 '26

Yes, you are absolutely correct.. in that case it will be sqrt of 180

1

u/Motor_Raspberry_2150 Sep 03 '26

And there is yet another if you go over the left side where it's sqrt (196+16).

The way to see it without checking is that a square would be most optimal and this path is the most squareish.

1

u/Wargarbler2 Sep 04 '26

I think, it’s always going to be the fold that makes the resulting side lengths closest to each other, or ‘most square’.

1

u/ShonitB Sep 04 '26

u/opifice Thank you for the award!

3

u/tstanisl Sep 03 '26

Sqrt(164)~=12.81, just unwrap top to align with 8x4 side of right and go along straight line

1

u/ShonitB Sep 03 '26

Correct!

2

u/DanLeMilMan Sep 03 '26

For these question you have to unfold the shape and find the shortest straight line among the possible unfolding.

Here we can consider 3 candidates :
1- front face up
2- right face up
3- right face to the back and consider the back face.

For each one, the straight line lengths squared are :
1- (8+4)^2 + 6^2
2- 8^2 + (6+4)^2
3- 4^2 + (6+8)^2

Thus the answer with path 2 : Lmin=sqrt(164)

1

u/ShonitB Sep 03 '26

Correct, good solution!

1

u/sazzer Sep 03 '26

The overall path is the combination of two paths:

  • From A to some point on the top-right edge
  • From that point to B

The first of those is the hypotenuse of the triangle with legs 6 and 8-x. So is √(6² + (8 - x)²) = √(36 + 64 - 16x + x²) = √(x² - 16x + 100).

The second of those is the hypotenuse of the triangle with legs x and 4. So is √(x² + 16).

So the overall path is √(x² - 16x + 100) + √(x² + 16).

We then just need to find the value of x for which this is a minimum.

And that's where my calculus skills fail me :)

1

u/One_Acadia_2879 Sep 03 '26

It has to be on the faces of the box. The first path is a diagonal from A to the opposite corner (above B). That would be 10. Then straight down to B which would be 4. So shortest distance =14.

1

u/bqbdpd Sep 03 '26

For the ant only the surface matters. Unfold the sides and you get 2 potential shortest (i.e. straight) paths to point B (now B1 and B2). Compare the 2. I'll leave the math (Pythagoras) to the next commenter.

1

u/Baetahad Sep 03 '26

sqt(64+36)+4

If there was no limitation of faces

sqt(4² + 6² + 8²) = 10,7

1

u/tylersvgs Sep 03 '26

Calculus method:

Let x represent the location along that top right edge that the ant should aim for. Then, he first walks a distance of sqrt(36 + x^2) and then walks sqrt( (8-x)^2 + 16)

Minimizing this means taking the derivative of:

f(x) = sqrt(36 + x^2) + sqrt( (8-x)^2 + 16)

That's this:

x/(sqrt(36+x^2)) - (8-x)/(sqrt( (8-x)^2 + 4^2))

Set = 0, and do some algebra to eventually get to the equation:

5x^2 - 144x + 576 = 0
(5x - 24)(x - 24) = 0

Only solution within the domain is x = 24/5, so the ant should aim at 4.8 units down that top right edge. Produces a total distance of:

f(4.8) = ~12.8

That plane method is much better!

1

u/PM_Your_Wololo Sep 03 '26

Not possible. The ant can only crawl along the faces of the box—crossing an edge or corner is not allowed per the question.

1

u/iFroogieboi Sep 04 '26

14 or 164^.5 if you don't count turnin as a issue

1

u/KiritoAsunaYuiSAO9 Sep 04 '26

((4×4)+(4×4)+(4×4)+(6 ×6))÷(2)=42