Apple Interview Question
SDE1sCountry: United States
Each ant has 2 directions to choose (clockwise and counter clockwise), so there are 2^3=8 cases. Only 2 cases will not get collision (all clockwise, or counterclockwise). So the possibility of collision is 2/8.
if they are moving in either clockwise or anticlockwise simultaneously with same speed then they will collide at the incenter of equilateral triangle.
Probability that they do not collide: 1/4
- Murali Mohan January 31, 2014If all go in the same direction.. they will collide if they all move with unequal speeds.