So I am back after a long time with an interesting puzzle. The credit for giving this puzzle goes to Sameer and in turn to microsoft for askim him this puzzle in their placement interview. ( By the way, sameer got selected in microsoft ).

**Problem : **There is a circular lake of radius . A duck is there at the center of the lake and a dog at the perimeter. Dog is intelligent and so is duck ( Actually none of them are, but this is added to make sure that reder is intelligent enough not to give any stupid answer ). Dog desperately wants to eat the duck. Now that the duck has finished fishing, it wants to escape. The only way it can escape is to reach the perimeter of the lake and fly away. ( For some unknown reason, this duck can fly very well, but can’t do so when in the water ). Swimming speed of the duck is while dog can run at a speed of . What stretagy/path the duck should follow to guarantee a safe escape??

**Solution : **When sameer asked me this question, my initial thought was to try if duck can escape swimming diagonally opposite to the dog. But alas!! so while duck has to swim , dog has to run which is easy for the dog to accomplish. So it does not work!!

Anyways, we will assume now on that without loss of generality. So the next thing I thought of what if the duck starts moving in the diagonally opposite direction only for some distance . After that, duck again changes the velocity so that the direction will be towards the digonally opposite point from the dog. I imagine that this will lead to some kind of a spiral like path. However, evaporation of integration and differentiation happened years ago from my brain, I could not prove or disprove whether this stretagy would work.

So finally, I came up with the solution from other direction. Look at the figure below.

Distances AB=1/4, AD=AC=1, BC=3/4. What if the duck can be at B while the dog is at D? Duck can now straight away go to C safely. Why? Well, think about it for a moment. BC=3/4, so dog can cover at most distance upto 3 unit of distance in that time. But to catch the duck, dog has to cover . Poor dog!!!

Next thing is to make this situation happen. Notice that when duck circles around the lake at radius 1/4, dog can run along the perimeter with the same angular velocity. For all circles with radius less than 1/4, angular speed of the duck is greater than the dog. So duck chooses to circle around at a radius where, is very very small. Duck now keeps circling around which gives him positive phase difference with respect to dog. When the phase difference becomes 180 degree, at that point duck can straight away go diagonally opposite to the dog and escape. Here, is small enough to exploit the difference of .

It was an interesting exercise going through all that. Thanks to sameer for bringing this to me.

— Saurabh Joshi

April 20, 2009 at 9:42 pm |

Thanks for sharing. I enjoy reading your blog; I visit it from time to time.

Cheers!

October 30, 2009 at 6:21 pm |

Interesting puzzle (as always) !! 🙂

Thanx