wu :: forums (http://www.ocf.berkeley.edu/~wwu/cgi-bin/yabb/YaBB.cgi)
riddles >> easy >> Ant on a box
(Message started by: NickH on Sep 22nd, 2002, 12:52pm)

Title: Ant on a box
Post by NickH on Sep 22nd, 2002, 12:52pm
A 12 by 25 by 36 inch box is lying on the floor on one of its 25 by 36 inch faces.  An ant, located at one of the bottom corners of the box, must crawl along the outside of the box to reach the opposite bottom corner.  What is the length of the shortest such path?

Title: Re: NEW PUZZLE -- Ant on a box
Post by william wu on Sep 22nd, 2002, 7:20pm
My answer:


At first I thought 25 + 36 = 61 inches. However, if the ant can crawl under the box, then it can take the hypotenuse trip of 43.83 inches. This shorter route could be feasible if the open side of the box was lying face down. Was that the "trick"? :)

Title: Re: NEW PUZZLE -- Ant on a box
Post by NickH on Sep 23rd, 2002, 1:45am
No, that's not the "trick!"

To clarify: the ant can walk on any of the five faces of the box, except for the bottom face, which is flush in contact with the floor.  It cannot crawl under the box.

Nick

Title: Re: NEW PUZZLE -- Ant on a box
Post by Brett Danaher on Sep 23rd, 2002, 8:09am
61 inches, as William pointed out, was my first thought.  And although the ant cannot travel along the bottom, you can assume that he could take a diagonal across the side of the box such that when he ends up across one side, his height is dx from the ground.  Then he can go across the other side in a diagonal back toward the ground and finally hit the opposite corner.  As dx approaches zero in this equation, his route with approach 61.

But of course, I kept looking for routes that beat that.  So I kept looking for the "shortest distance is a straight line" solution.  Unfortunately, being kept off the ground, there is no true STRAIGHT line.  But I imagined the box being a cardboard box and I unfolded the flops, leaving me with a flattened box.


Code:
 
              _________ C
          ___|_________|____ D
       B |___|_________|____|
           A |_________|

// diagram fixed by moderator; registration allows modification of posts


Uh, sorta like that. Except the point next to the bottom right hand corner of the letter A is, in the three dimensional form of the box, the same as the point next to the bottom right hand corner of B.  The same is true with the bottom left hand corners of C and D.  So the "straight line paths" I was left with were from A to C or D, and from B to C or D.  Of course, two pairs of these are essentially the same route, so I basically just compared A to C and A to D.  Obviously I simply used the pythagorean thereom.  One of those routes was about 60.8 (slightly better than 61) and the other was about 60.6.  I don't remember which was which, haha.  But I submit an answer of approximately 60.6.  

Am I right?

Title: Re: NEW PUZZLE -- Ant on a box
Post by Brett Danaher on Sep 23rd, 2002, 8:11am
My diagram in the last mail changed shape from writing to posting, so the picture doesn't look so good.  Sorry, beyond my control.  It looked write in the text editing box.

      _________ C  
  ___|_________|____ D
B|___|_________|____|
    A|_________|

Title: Re: NEW PUZZLE -- Ant on a box
Post by James Fingas on Sep 23rd, 2002, 8:46am
This is an interesting question. At first, you might think that the ant would never go over the box, and thus the height of the box wouldn't matter (per William's post). However, consider the box as midway between a very-tall box and a flat sheet of paper. Note that the solution for the very tall box is indeed 25 + 36. The solution for the flat sheet of paper is not! Somewhere in between, the solution changes.

I'm pretty sure that Brett's answer is correct here. In practice, however, you probably would spend so long figuring out how to save 0.4 inches of path length that it would be faster just to go around the bottom.

Title: Re: NEW PUZZLE -- Ant on a box
Post by Brett Danaher on Sep 23rd, 2002, 2:13pm
So a very interesting problem here would be to determine this:  given a length and width for the base, at what height does the best solution cross over from going along the bottom (or just barely along the bottom, I should say, since you technically are not allowed to touch the ground in this problem) to going over the top of the box.


Title: Re: NEW PUZZLE -- Ant on a box
Post by Kozo Morimoto on Sep 24th, 2002, 6:05am
Starting with:
go straight up = 12
go diagonally to opposite corner on top = sqrt(25^2+36^2) = 43.8
go straight down = 12
TOTAL  = 67.83

Now let x be the amount of 'corner' that you cut from the edge that equal 25.  So that instead of going straight up to the top surface, you go diagonally to a point somewhere on the edge = 25 so that it divides it into x and 25-x
this diagonal = path1 = p1 = sqrt(12^2+x^2)

now let y be the same but on the edge that equal 36, which would describe the down path from the top
p3 = sqrt(12^2+y^2)

the middle path joing the 2 edge points between p1 and p3 would be
p2 = sqrt((25-x)^2+(36-y)^2)

so
p = (144+x^2)^.5+((25-x)^2+(36-y)^2)^.5+(144+y^2)^.5

when you minimize for p, you get p=60.6053 when x=9.24991, y=15.5675

Title: Re: NEW PUZZLE -- Ant on a box
Post by wowbagger on Sep 24th, 2002, 6:37am
Denoting the dimensions of the box as v, w, and h and considering v and w as given parameters, I arrive at the following formula for the value h_0 at which the length of the two paths ("over the top" vs. "round the bend") are equal:

h_0 = sqrt( (s/2)^2 + p ) - s/2  (for w > 2v/3, see below)

where  s = v+w, p = v*w

I arrived at this result using the route from A to D in the  diagram given in a previous post. This route is shorter than the one from A to C as long as h < |v-w|.
Does h_0 satisfy this? - It depends!
Say v > w, then for w > 2v/3 we have h_0 < v-w and h_0 is the value we sought. In the special case v=36, w=25 we find
h_0 = 12.28

If however v>w and w < 2v/3, h_0 is only an upper bound, the correct answer has to use the route over the top from A to C resulting in

h_0 = sqrt ( (w/2)^2 + p/2 ) - w/2  (for w < 2v/3)

where p = v*w

An interesting example is v = 36, w = 20. Now we have for
route A -> D: h_0 = 10.78...
route A -> C: h_0 = 11.44...
So if h = 11, it's really important to take right straight line - which is the left one in the diagram.

Confused? Why not get your bearings by figuring out the angle from the ground at which the ant should start its way over the top (depending on v, w, and h)?

Additional question:
Say the two routes over the top are equal in length and the one from A to D has you initially heading for the midpoint of the (longest) edge. Is that route advantageous to going along the bottom?

Title: Re: NEW PUZZLE -- Ant on a box
Post by Brett Danaher on Sep 24th, 2002, 8:05am
That was a great explanation there, and very perceptive to have different formulas depending on the relative lengths of AC and AD.  

Fun problem.  Now someone go solve my rumor spreading problem in "medium" for me.

Title: Re: NEW PUZZLE -- Ant on a box
Post by Andrew on Oct 25th, 2002, 8:19pm
Id just like to point out that the path B to D is actually even shorter 55.9

B to D and A to C are not the same.  It's hard to explain without drawing you the diagonals but the angle you go at is different because of the different length sides.

Title: Re: NEW PUZZLE -- Ant on a box
Post by william wu on Oct 27th, 2002, 2:56pm

on 09/23/02 at 01:45:39, NickH wrote:
No, that's not the "trick!"

To clarify: the ant can walk on any of the five faces of the box, except for the bottom face, which is flush in contact with the floor.  It cannot crawl under the box.

Nick


I guess I wasn't thinking "outside the box" ;)

Title: Re: NEW PUZZLE -- Ant on a box
Post by wowbagger on Oct 28th, 2002, 3:57am

on 10/25/02 at 20:19:10, Andrew wrote:
Id just like to point out that the path B to D is actually even shorter 55.9

B to D and A to C are not the same.  It's hard to explain without drawing you the diagonals but the angle you go at is different because of the different length sides.

Sorry, I don't see how you get a length of l = 55.9 for the path from B to D. I'd say

l^2 = (36+2*12)^2 + 25^2 = 60^2 + 25^2 = 4225
l = 65 > 60.605...

Everyone agrees that the lengths of the paths from B to D and from A to C are generally different, I think. However, if you add the two pieces of "height" of the box to the longer side (path B->D), you'll always have a longer distance compared to adding them to the shorter side (path A->C). Hope that's comprehensible without another drawing.

Title: Re: NEW PUZZLE -- Ant on a box
Post by James Fingas on Oct 28th, 2002, 5:58am
wowbagger,

What I think you're missing is that you can add the 12 inches to the 25 and 36 sides in any combination. Therefore any of the following are valid ways to get over the box:

Adding both to the 36 side, we get your answer:
I2 = (36 + 12*2)2 + 252

Better, we can add them both to the 25 side:
I2 = (36)2 + (25 + 12*2)2

The best answer--add one to each side:
I2 = (36 + 12)2 + (25 + 12)2

Title: Re: NEW PUZZLE -- Ant on a box
Post by wowbagger on Oct 28th, 2002, 6:50am
Thanks James, but I already thought of these possibilities. See my first post in this thread where I explicitly compared the paths AC and AD.
My goal was to convince Andrew that the path BD must be longer than AC (if A is at the end of the longer side).

on 10/28/02 at 05:58:24, James Fingas wrote:
The best answer--add one to each side:
I2 = (36 + 12)2 + (25 + 12)2

That's only true for our original values for length and width of the box. In case you didn't muddle through all of my analysis trying to find the "critical" height:

on 09/24/02 at 06:37:28, wowbagger wrote:
Denoting the dimensions of the box as v, w, and h and considering v and w as given parameters, I arrive at the following formula for the value h_0 at which the length of the two paths ("over the top" vs. "round the bend") are equal: [...] If however v>w and w < 2v/3, h_0 is only an upper bound, the correct answer has to use the route over the top from A to C resulting in
h_0 = sqrt ( (w/2)^2 + p/2 ) - w/2  (for w < 2v/3)
where p = v*w




Powered by YaBB 1 Gold - SP 1.4!
Forum software copyright © 2000-2004 Yet another Bulletin Board