Real World Maths Busters

The Maths Behind Everyday Life

The story, the formula and a worked example — see exactly where this maths shows up in the world around you.

Back to all stories
Nature & Science 4 min read

How Ants Find the Shortest Path

Pheromone feedback loops.

Ants lay pheromone trails. Shorter paths get more traffic per unit time, so pheromone builds up faster on them — a positive feedback loop that converges on the optimum.

Pheromone reinforcement

Probability of choosing a path ∝ pheromone level.

Pi=τiα∑jτjαP_i = \frac{\tau_i^\alpha}{\sum_j \tau_j^\alpha}

Two paths: 10 m and 15 m, α = 2

  1. 1

    Ant speed

    1 m/min

  2. 2

    Short path cycle

    20 min round trip → 3 trips/hr

  3. 3

    Long path cycle

    30 min → 2 trips/hr

  4. 4

    Pheromone ratio

    3:2 → P(short) = 9/13 = 69%

Answer

69% of ants choose the short path, reinforcing it further

The formula behind it

Probability

P=favourabletotalP = \frac{\text{favourable}}{\text{total}}
See the full formula, variables and more examples

The takeaway

Ant colony optimisation algorithms in computer science are directly inspired by this.

Back to all stories