Three ants

This puzzle is asked during interview by Microsoft while electing the people for their company. Now many companies ask this puzzle while recruiting the students.  This puzzle somewhat mathematical oriented. This interview puzzle is famously known as “Three Ants on Triangle” puzzle. People who know the concepts of probability can easily solve this puzzle.

Puzzle Question:    

Three ants are sitting at the three corners of an equilateral triangle. Each ant starts randomly picks a direction and starts to move along the edge of the triangle. What is the probability that none of the ants collide?



The ants can only avoid a collision if they all decide to move in the same direction (either clockwise or anti-clockwise). If the ants do not pick the same direction, there will definitely be a collision. Each ant has the option to either move clockwise or anti-clockwise. There is a one in two chance that an ant decides to pick a particular direction. Using simple probability calculations, we can determine the probability of no collision.

P(No collision) = P(All ants go in a clockwise direction) + P( All ants go in an anti-clockwise direction) = 0.5 * 0.5 * 0.5 + 0.5 * 0.5 * 0.5 = 0.25