This is the classical puzzle asked in microsoft interview
A duck, pursued by a fox, escapes to the center of a perfectly circular pond. The fox cannot swim, and the duck cannot take flight from the water. The fox is four times faster than the duck. Assuming the fox and duck pursue optimum strategies, is it possible for the duck to reach the edge of the pond and fly away without being eaten? If so, how?
From the speed of the fox it is obvious that duck cannot simply swim to the opposite side of the fox to escape.
Fox can travel 4r in the time duck covers r distance. Since fox have to travel half of the circumference Pi*r and Pi*r < 4r
So how could the duck make life most difficult for the fox? If the duck just tries to swim along a radius, the fox could just sit along that radius and the duck would continue to be trapped.
At a distance of r/4 from the center of the pond, the circumference of the pond is exactly four times the circumference of the duck’s path.
Let the duck rotate around the pond in a circle of radius r/4. Now fox and duck will take exact same time to make a full circle. Now reduce the radius the duck is circling by a very small amount (Delta). Now the Fox will lag behind, he cannot stay at a position as well.
Say, the duck circles the pond at a distance r/4 – e, where e is an infinitesimal amount. So as the duck continues to swim along this radius, it would slowly gain some distance over the fox. Once the duck is able to gain 180 degrees over the fox, the duck would have to cover a distance of 3r/4 + e to reach the edge of the pond. In the meanwhile, the fox would have to cover half the circumference of the pond (i.e the 180 degrees). At that point,
(pi * r ) > 4 * (3r/4 + e)
So time taken to travel 3r/4 is quicker than 3.14*r at four times the speed.(0.14*r distance is left)
The duck would be able to make it to land and fly away.