Menu

Earn Premium with Referrals

Invite your friends and earn Premium rewards through our referral program.

See how it works and start inviting friends.

Ants on a Triangle
INTERVIEWPUZZLE

Ants on a Triangle

Use symmetry and probability to determine the likelihood of ants moving around a triangle without colliding.

Ants on a Triangle

The Puzzle: Three ants are sitting at the three corners of an equilateral triangle. Each ant randomly chooses a direction and starts moving along the edge of the triangle. What is the probability that none of the ants collide?

1. The Logic

Each ant has 2 choices of direction (Clockwise or Counter-Clockwise).

  • Since there are 3 ants, there are 23=82^3 = 8 total possible combinations of directions.

2. Avoiding Collision

The ants will not collide only in two scenarios:

  1. All three move Clockwise. (e.g., A->B, B->C, C->A)
  2. All three move Counter-Clockwise.

3. The Math

  • Number of non-colliding outcomes = 2.
  • Total outcomes = 8.
  • Probability = 2/8 = 1/4 (or 25%).

Interview-Focused Questions

Q: What is the probability for nn ants on an nn-sided polygon?

A: The total outcomes would be 2n2^n. The non-colliding outcomes are still only 2 (all clockwise or all counter-clockwise). So the probability is 2/2n2/2^n.

Q: Why do the ants collide if even one moves differently?

A: Imagine an equilateral triangle. If two ants start moving towards each other on the same edge, they collide. If all move in one circle, they just follow each other forever. Any change in that circle creates a “head-on” meeting on at least one edge.

Key Takeaway

This puzzle is a test of Combinatorics. It’s about counting the “favourable” outcomes vs the “total” outcomes.

My Private Notes

Notes are auto-saved locally to this device.