Sunday, January 15, 2012

Insect in 3D

Problem: An ant crawls from one corner of a room to the diametrically opposite corner
 along the shortest possible path. If the dimensions of the room are
 3 x 4 x 5, what distance does the ant cover?

4 comments:

  1. If the room’s dimensions are a x b x c, then the length of the shortest path is min(sqrt((a+b)^2 + c^2),sqrt((a+c)^2 + b^2),sqrt((c+b)^2 + a^2)).

    ReplyDelete
  2. This comment has been removed by the author.

    ReplyDelete
  3. i feel the diametricaly opposite means the farthest vertex, which in case of cube of side A will be A√3. But as the ant will not be able to fly, so it will follow only surface. Thus it should be (A√2+A)
    So here should not it be min of
    sqrt(i^2+j^2)+k
    where (i,j,k) ∈ (a,b,c) and i≠j≠k
    i.e. traversing along a diagonal on 1 side and taking an edge to reach the farthest vertex.

    ReplyDelete
  4. Will get back to you on this Abhinav .

    ReplyDelete