Math paradoxes

The phantom traffic jam A jam on a ring road for no reason at all. Can one slow driver help?One calm driver speeds everyone up.

22 cars drive around a ring 230 metres long, with no traffic lights and no narrowing. The drivers were asked to drive steadily, and within a few minutes a jam appears on the ring: cars stand still, and the wave creeps backwards. Now one driver of the 22 changes style: stops chasing the car ahead and drives evenly. Nobody can overtake. What happens to everyone's average speed? Lock in your answer, then take the wheel yourself, run the simulation and read the explanation.

22 cars on a 230 m ring, with no lights and no narrowing, create a jam by themselves within a few minutes. It feels as if a driver who stops chasing the car ahead can only hold everyone up. In fact that driver soaks up the wave: in our model the ring's average speed rises from 13 to 29 km/h and the stops disappear. In a real 2016 experiment, one such car cut fuel use by 40% and raised throughput by 14%.

Make a guess
13 → 29km/h with one calm driver
1.9 → 0stops per car a minute
−40%fuel, the 2016 experiment
The puzzle

A ring where nothing gets in the way, and a jam

Speed, distance and time are enough here. It all began with a real experiment: in 2008 Japanese physicists led by Yuki Sugiyama put 22 cars on a circle and asked the drivers to do nothing special.

  1. 1

    22 cars on a 230-metre circle

    One lane, no lights, no narrowing, no junctions. The drivers were asked to cruise at about 30 km/h and follow the car ahead safely.

  2. 2

    A jam within minutes

    Someone slowed a little, the next driver slowed more, and soon several cars stand still. The jam does not stay put: cars leave it at the front, new ones run into it at the back, and it creeps backwards, against the traffic.

  3. 3

    The jam does not go away by itself

    Every car speeds up and stops, lap after lap. In our model, which repeats the experiment, the average speed falls from 29 to 13 km/h, and each driver stops almost twice a minute.

  4. 4

    The question

    One driver of the 22 changes style. They no longer chase the car ahead: they drive evenly, at the traffic's average speed, and let the gap in front grow and shrink. Nobody can overtake them. What happens to the average speed of all 22 cars?

Intuition says

"A slow driver in a single lane holds up everyone behind"

It would, if they drove slower than the flow. But the calm driver drives at the average speed, just without the jerks. They stop passing braking back, the wave dies on them, and within minutes the whole ring is faster: 29 km/h instead of 13 in our model.

What we assume

  • The drivers in the simulation are a model, not people. Each wants a gap of 1.5 m plus 0.56 seconds of travel, reacts 0.2 seconds late and wobbles on the pedal a little.
  • The model repeats the experiment: smooth driving at 29 km/h, a jam within 3.5–7 minutes.
  • Numbers in rounds 1–4 come from the model. The real experiments are in rounds 4 and 5.
Round 1 · Guess

One driver stopped chasing. What about everyone else?

Right now the ring is jammed: 13 km/h on average. One driver of the 22 starts driving evenly and stops chasing the car ahead. Pick your answer.

After 10 minutes, the average speed of all 22 cars…

A breakdown of your answer will appear here.

Hints

Hard to decide? Open the hints one at a time: the easy one first, then stronger ones.

Next: the solution

Next comes the explanation, with spoilers

The next rounds show what the calm driver does: you take the wheel on the ring yourself, the computer drives 40 half-hour runs, and then comes the explanation. Answer round 1 first, or go on?

You chose to always show all rounds.

Round 2 · Try it yourself

Take the wheel of the blue car and dissolve the jam

The ring is already jammed: red cars stand still, green ones move. The blue car is yours. While it drives "like everyone", the jam lives on. Switch on "Calm" and pick a cruising speed: the car will hold it and ease off by itself when catching up, so it never hits anyone. Find the speed at which the stops disappear, then get the whole ring moving faster.

Your car drives
standing → 15 → 30 km/hyour car
Time runs

Round 3 · Simulation

Half an hour on the ring: 15 minutes as usual, 15 with a calm driver

The picture is the ring cut open and laid out as a line: the spot on the ring to the right, time downwards. The colour shows how fast the car passing that spot is going. Green is smooth driving, red is a jam where cars stand still. At minute 15 car 0 turns calm. Then the computer repeats the same thing 40 times with different random jerks by the drivers.

car speed: standing → 30 km/h

Look at the red bands in the first half: the lower, the further left, so over time the jam shifts backwards while the cars move forwards. In the model it creeps at about 13 km/h, in Sugiyama's experiment at about 20. After minute 15 the bands fade, and 8–9 minutes later the ring is moving smoothly.

40 runs: speed before and after

Average speed
…
Stops per car a minute
…
Recovery after the switch
…

Once you answer, the simulation code appears here so you can run it yourself.

Check it yourself in code

The same simulation, short and with no libraries. Run the JavaScript in your browser console (F12) or in Node; the Python needs only the standard library.

JavaScript
// A 230 m ring with 22 cars, as in Sugiyama's 2008 experiment. Ordinary drivers for 15 minutes, then car 0 turns calm.
const RING = 230, CARS = 22, CAR = 4, DT = 0.1;   // metres, seconds

// an ordinary driver (the IDM model): acceleration, m/s²; it wants a gap of 1.5 m + 0.56 s of travel
function human(v, vAhead, gap) {
  const want = 1.5 + Math.max(0, 0.56 * v + v * (v - vAhead) / 3.1);
  return 1.2 * (1 - (v / 13.9) ** 4 - (want / Math.max(gap, 0.1)) ** 2);
}
// a calm driver: holds a cruising speed and eases off early and gently when catching up
function calm(v, vAhead, gap, cruise) {
  const c = Math.min(vAhead - v, 0), x1 = 4.5 + c * c / 3, x2 = 5.25 + c * c / 2, x3 = 6 + c * c;
  const w = Math.min(Math.max(vAhead, 0), cruise);
  const aim = gap <= x1 ? 0 : gap <= x2 ? w * (gap - x1) / (x2 - x1) : gap <= x3 ? w + (cruise - w) * (gap - x2) / (x3 - x2) : cruise;
  return Math.max(-3, Math.min(1.2, 0.6 * (aim - v)));
}
const gauss = () => Math.sqrt(-2 * Math.log(1 - Math.random())) * Math.cos(2 * Math.PI * Math.random());

function run() {
  let x = Array.from({ length: CARS }, (_, i) => i * RING / CARS + Math.random() * 0.6 - 0.3);
  let v = Array(CARS).fill(8.13);                  // everyone starts evenly at 29 km/h
  const seen = [[x, v], [x, v]];                   // drivers react to what was 0.2 s ago
  const lastMin = Array(600).fill(8.13);           // car 0's speed over the last minute
  const rep = { before: [0, 0, 0], after: [0, 0, 0] };
  for (let step = 0; step < 30 * 600; step++) {    // 30 minutes in 0.1 s steps
    seen.push([x, v]);
    const [xo, vo] = seen.shift();
    const acc = x.map((_, i) => {
      const j = (i + 1) % CARS;
      if (i === 0 && step >= 15 * 600) {
        const cruise = lastMin.reduce((s, q) => s + q, 0) / 600 + 0.3;   // the last minute's average + 1 km/h
        return calm(v[0], v[1], (x[1] - x[0] + RING) % RING - CAR, cruise);
      }
      return human(vo[i], vo[j], (xo[j] - xo[i] + RING) % RING - CAR) + 0.2 * gauss();
    });
    const nv = v.map((q, i) => Math.max(0, q + acc[i] * DT));
    const prev = v;
    x = x.map((q, i) => (q + (v[i] + nv[i]) / 2 * DT) % RING);
    v = nv;
    lastMin.shift(); lastMin.push(v[0]);
    const minute = Math.floor(step / 600);
    if ([12, 13, 14, 27, 28, 29].includes(minute)) {   // measure 3 minutes before the switch and the last 3
      const r = rep[minute > 15 ? 'after' : 'before'];
      r[0] += v.reduce((s, q) => s + q, 0) / CARS; r[1]++;
      r[2] += v.filter((q, i) => q < 0.3 && prev[i] >= 0.3).length;
    }
  }
  return ['before', 'after'].map(k => [rep[k][0] / rep[k][1] * 3.6, rep[k][2] / CARS / 3]);
}

for (let n = 1; n <= 3; n++) {
  const [b, a] = run();
  console.log(`Run ${n}: all ordinary ${b[0].toFixed(1)} km/h, ${b[1].toFixed(1)} stops per car a minute; ` +
    `one calm ${a[0].toFixed(1)} km/h, ${a[1].toFixed(1)} stops`);
}
Python
# A 230 m ring with 22 cars, as in Sugiyama's 2008 experiment. Ordinary drivers for 15 minutes, then car 0 turns calm.
import math
import random

RING, CARS, CAR, DT = 230.0, 22, 4.0, 0.1   # metres, seconds


def human(v, v_ahead, gap):               # an ordinary driver (the IDM model): acceleration, m/s²
    want = 1.5 + max(0.0, 0.56 * v + v * (v - v_ahead) / 3.1)  # the gap it wants: 1.5 m + 0.56 s of travel
    return 1.2 * (1 - (v / 13.9) ** 4 - (want / max(gap, 0.1)) ** 2)


def calm(v, v_ahead, gap, cruise):        # a calm driver: holds a cruising speed and eases off early and gently when catching up
    closing = min(v_ahead - v, 0.0)
    x1, x2, x3 = 4.5 + closing**2 / 3, 5.25 + closing**2 / 2, 6 + closing**2
    w = min(max(v_ahead, 0.0), cruise)
    if gap <= x1: aim = 0.0
    elif gap <= x2: aim = w * (gap - x1) / (x2 - x1)
    elif gap <= x3: aim = w + (cruise - w) * (gap - x2) / (x3 - x2)
    else: aim = cruise
    return max(-3.0, min(1.2, 0.6 * (aim - v)))


def run(seed):
    rnd = random.Random(seed)
    x = [i * RING / CARS + rnd.uniform(-0.3, 0.3) for i in range(CARS)]
    v = [8.13] * CARS                     # everyone starts evenly at 29 km/h
    seen = [(x[:], v[:])] * 2             # drivers react to what was 0.2 s ago
    last_min = [8.13] * 600               # car 0's speed over the last minute
    report = {}
    for step in range(30 * 600):          # 30 minutes in 0.1 s steps
        seen.append((x[:], v[:]))
        xo, vo = seen.pop(0)
        acc = []
        for i in range(CARS):
            j = (i + 1) % CARS
            if i == 0 and step >= 15 * 600:
                cruise = sum(last_min) / 600 + 0.3   # the last minute's average + 1 km/h
                acc.append(calm(v[0], v[1], (x[1] - x[0]) % RING - CAR, cruise))
            else:
                acc.append(human(vo[i], vo[j], (xo[j] - xo[i]) % RING - CAR) + 0.2 * rnd.gauss(0, 1))
        for i in range(CARS):
            nv = max(0.0, v[i] + acc[i] * DT)
            x[i] = (x[i] + (v[i] + nv) / 2 * DT) % RING
            v[i] = nv
        last_min = last_min[1:] + [v[0]]
        minute = step // 600
        if minute in (12, 13, 14, 27, 28, 29):   # measure 3 minutes before the switch and the last 3
            key = "after" if minute > 15 else "before"
            s, n, st = report.get(key, (0.0, 0, 0))
            report[key] = (s + sum(v) / CARS, n + 1, st + sum(1 for i in range(CARS) if v[i] < 0.3 <= v_prev[i]))
        v_prev = v[:]
    return {k: (s / n * 3.6, st / CARS / 3) for k, (s, n, st) in report.items()}


for seed in range(1, 4):
    r = run(seed)
    print(f"Run {seed}: all ordinary {r['before'][0]:.1f} km/h, {r['before'][1]:.1f} stops per car a minute; "
          f"one calm {r['after'][0]:.1f} km/h, {r['after'][1]:.1f} stops")
Round 4 · Explanations

A jam is a wave of overreactions, and a gap is its shock absorber

Intuition sees a jam as a thing: something sits on the road and blocks it. But nothing blocks the ring. A jam is a motion, not an obstacle: it is made of how each driver answers the braking ahead.

In plain wordspictures, analogies, small numbers

“In plain words” is hidden on all puzzles.

A chain of overreactions

One driver barely slowed, and 80 cars later someone is standing still

A column on a straight road, everyone doing 29 km/h. The first driver drops to 22 km/h for two seconds and speeds up again. Each next driver sees it late and brakes a little harder than needed: it feels safer. "A little" is very little here: the car 20 places behind the first drops to 20 km/h, 40 places behind to 16, 60 behind to 10, and 80 behind is standing still. Nobody did anything wrong, yet the braking grew from car to car.

On a ring of 22 cars, eighty cars is less than four laps. The wave comes back to the same drivers and grows every time, which is why the jam appears within a few minutes.

This is the core of the puzzle, though not the whole story: how exactly the calm driver breaks the chain is in the next card.

The gap as a shock absorber

The car ahead jerks, the calm driver doesn't: the gap swallows the difference

the car ahead the calm driver the gap between them, m

The first four minutes after the switch. The car ahead still stops and dashes, while the calm driver holds a speed close to the . When it brakes, the gap shrinks; when it speeds up, the gap grows. The calm driver does not repeat the jerks, so the cars behind see smooth motion and drive smoothly too. The wave reaches the calm driver and goes no further.

Why slower is faster

A car standing still carries nobody

In the jam cars stand still 45% of the time, and the rest of the time they speed up and dash to the next jam. Leaving a jam happens one by one: each driver waits for the car ahead to move, and time is lost on that. So the average speed drops to 13 km/h, although on the free stretches cars go much faster.

The calm driver does not go faster than the flow either. They just never stop, and because of them nobody else stops. Eight minutes of smooth driving give more than any dash.

A wave, not a thing

The cars go forwards, the jam creeps backwards

A jam is made of different cars every moment: the front ones leave, the rear ones arrive. So the jam itself moves backwards, like a Mexican wave in a stadium: people only stand up and sit down in their seats, yet the wave runs around. On motorways such waves creep backwards at about 15 km/h and can live for hours.

That is why the jam you stood in often has no visible cause: the crash or narrowing that started it was passed an hour ago, or there never was one.

Rigoroustables, charts, formulas

“Rigorous” is hidden on all puzzles.

A table

What one driver in 22 changed

Averages over the 40 runs from round 3: three minutes before the switch and the last three minutes. Look at the gaps. The calm driver keeps a slightly larger gap on average than the others, while the others are a little tighter than in the smooth flow before the jam. There is as much room on the ring as before; only the way it is used has changed.

For formula lovers

Flow, the driver model and the stability limit

How many cars a minute pass a point on the ring: density (cars per metre) times average speed. So stops hit the flow directly.

q=ρ·v¯=22230 m·v¯

The IDM driver model (Treiber, Hennecke, Helbing, 2000): acceleration falls as the speed v approaches the wanted v₀ or the gap s approaches the wanted s*. Δv is how much faster you go than the car ahead.

dvdt=a[1−(vv0)4−(s*s)2],s*=s0+vT+vΔv2ab

The simplest model with the same effect (Bando and co-authors, 1995): a driver reaches for the "comfortable" speed V(h) for their gap h with sensitivity a. Smooth flow is unstable when the comfortable speed changes with the gap too steeply compared with how fast the driver adjusts:

dvdt=a[V(h)−v],a jam if V′(h)>a2

The calm driver in the simulation is the FollowerStopper rule from the 2016 experiment: it holds a cruising speed (the last minute's average plus 1 km/h) and starts easing off gently, the earlier the faster it is catching up with the car ahead. The code for both drivers is in round 3.

Deepergeneralisations, theory, history

“Deeper” is hidden on all puzzles.

Traffic as a fluid

Why the wave goes backwards: kinematic wave theory

In 1955 James Lighthill and Gerald Whitham, and Paul Richards in 1956, described traffic on a long road as a flowing fluid: cars do not vanish, and the flow depends on the density. While cars are few, more cars give more flow. Past a certain density each extra car lowers the flow. On that "dense" branch changes of density run backwards, against the traffic, and that is exactly how jams behave.

The theory explains where a wave goes and how fast, but not where it comes from out of nothing. For that you need models of individual drivers with a delay, like the one in this puzzle.

From model to experiment

Physicists predicted the causeless jam 13 years before the proof

In 1992 Kai Nagel and Michael Schreckenberg built a model of four rules: speed up, don't crash, sometimes slow down at random, move. The third rule is enough for jams to appear on a road with no obstacles. In 1995 Masako Bando and co-authors showed the same in a continuous-time model.

Proving it with real cars took until 2008: Sugiyama, a co-author of the 1995 model, and colleagues took 22 cars and a 230 m circle. A five-car jam moved backwards at about 20 km/h, as on real motorways. With 23 cars a jam formed too.

Round 5 · Going further

How many cars the ring can take, the bullwhip in supply chains, and what to do on the road

One calm driver does not always save the ring: past some density nothing helps. And the chain of overreactions lives not only on roads: orders between a shop and a factory swing in the same way.

The maths

Add cars to the ring

if everyone drove smoothly all ordinary one calm

The maths

A density threshold and a window for the miracle

While cars are few, the gaps are large, jerks die out by themselves, and the ring runs smoothly with no help. The flow grows with each car up to 18–20 cars. Beyond that the smooth flow in the model becomes unstable: a jam forms and the flow drops by more than half.

The calm driver brings smooth flow back only in a narrow window above the threshold: fully at 22 cars, partly at 24–28. With 30 cars or more there is not enough room in the gaps to swallow the waves, and the ring is jammed with or without them.

A real experiment confirmed it. In 2013 Tadaki and co-authors drove 10 to 40 cars around a 314 m circuit inside the Nagoya Dome. Up to 25 cars traffic flowed freely; from 30 it went stop-and-go, and again the jam crept backwards at about 20 km/h. The threshold came out at 0.08–0.09 cars per metre. In our model it lies between 20 and 22 cars on 230 m, about 0.09.

The logic

The same chain in a supply chain

The logic

The bullwhip effect: +10% at the shop, +94% at the factory

Shoppers buy 100 packs a week, and from week 6 they buy 110. The shop sees the rise and orders extra: its forecast went up, and goods take two weeks to arrive, so it tops up stock as well. It orders 117.5. The distributor now sees 117.5 and does the same: 131. The warehouse orders 154, the factory makes 194. And once stocks are full, the factory gets only 33. Each link behaves sensibly, yet passes on exaggerated braking and acceleration, just like drivers in a column.

The cures are the same as on the road too: see real demand, not just your neighbour's orders; shorten the "reaction time" between links; keep a buffer instead of chasing every swing.

In practice

What to do on the road and what roads already do

  • Don't chase. A gap to the car ahead that grows and shrinks is not lost time but a shock absorber. A dash forward ends in braking that travels back along the column. The engineer William Beaty made this idea popular back in 1998: "sometimes one driver can vastly improve traffic".
  • Don't slow down needlessly on uphills and in dips. NEXCO East, an operator of Japanese expressways, counts that about 70% of the jams on its network come from cars bunching up, and about 60% of those spots are uphills and sags: drivers lose speed without noticing, and the wave starts by itself.
  • Merge like a zip. When a lane ends, drive it to the end and merge in turns. The Minnesota Department of Transportation says this cuts the length of the backup by as much as 40%. In Germany the traffic code requires it (StVO, § 7).
  • Variable speed limits. In 1995 signs that lower the limit ahead of jams were switched on along a section of London's M25 orbital. In the first year injury accidents fell by 30%. These are early figures over a short period, but the idea is the same: even out speeds before a wave has time to grow.
  • Shock-absorber cars. In summer 2016 in Tucson, Arizona, on a 260 m ring with 21–22 cars, one car with automated speed control (a human steered) running the FollowerStopper rule cut the spread of speeds by 81%, fuel use by 42.5%, harsh braking from 8.58 to 0.12 events per car per kilometre, and raised throughput by 14%. In November 2022 the CIRCLES consortium put 100 cars with custom adaptive cruise control on the I-24 near Nashville: early estimates point to 15–20% energy savings around those cars.
Bonus · At work

Where this shows up at work

Real situations from marketing, analytics, product and business where the same maths applies. Only known data, research and plain calculations you can check.

Operations and supply chain

Nappies that rock the factory

The situation
Procter & Gamble looked at orders for Pampers nappies. Babies use them at an almost steady rate, and store sales swing little. Yet distributors' orders swung more, and orders for raw materials from suppliers swung more still. Hewlett-Packard saw the same with printers: moderate swings in a big reseller's sales and much bigger ones in its orders.
The trap
Each link sees only its neighbour's orders, not real demand, and reacts late, like a driver in a column. A small rise in sales turns into a wave of orders that grows from link to link: the bullwhip effect. In the simple model from round 5 a 10% rise in demand gives the factory +94%, then a slump to a third of normal.
How to plan for it
Share shelf sales data with suppliers, not just orders; shorten the time between order and delivery; don't build stock on every spike. It is the calm driver again: watch the flow, not the bumper ahead.

Source: Lee, Padmanabhan, Whang, "The Bullwhip Effect in Supply Chains", Sloan Management Review, 1997

Management and training

The Beer Game: costs ten times what they need be

The situation
MIT has played the Beer Game since the 1960s: four players, a shop, a wholesaler, a distributor and a brewery, pass orders to each other with delays. Customer demand changes only once, by a small fixed step.
The trap
John Sterman (1989) found that teams of managers spend on average ten times the optimum, and the brewery's peak orders are more than double the shop's peak orders. Players ignore the goods already on the way and order more, like a driver who keeps accelerating because the gap has not shrunk yet.
How to plan for it
Before every decision count everything already in the pipeline, and respond to the trend, not the last week. The Beer Game is good team training: in an hour you see honest, sensible decisions create a phantom jam in orders.

Source: Sterman, "Modeling Managerial Behavior: Misperceptions of Feedback in a Dynamic Decision Making Experiment", Management Science, 1989; the game's page at MIT

Bonus · Fun facts

Things to tell your friends

1934

Traffic was first studied with a camera

Bruce Greenshields measured the speed and density of cars from photographs of the road and, in a 1934 report, proposed the first formula: the denser, the slower, along a straight line. Traffic flow science began there.

1955

A jam as a shock wave

James Lighthill, an expert in aerodynamics and jet engine noise, applied to roads, with Gerald Whitham, the same mathematics as to waves in fluids. Paul Richards gave his 1956 paper a blunt title: "Shock waves on the highway".

4

Four rules and chance

The Nagel–Schreckenberg model (1992) splits the road into cells and speed into whole numbers from 0 to 5. There are only four rules, and one of them is to slow down at random. Without it there are no jams on an empty road; with it they appear by themselves.

2008

A camera in the middle of the circle

Sugiyama's experiment was filmed by a 360-degree camera set in the middle of the circle. A 5-car jam crept backwards at about 20 km/h, while the cars outside it drove at about 40 km/h.

15 км/год

Jams have their own speed

On German autobahns stop-and-go waves creep against the traffic at 15 ± 5 km/h and are 2.5–5 km long. Their speed hardly depends on the exits and junctions they pass: a fully developed jam lives a life of its own.

100

The biggest shock-absorber experiment

From 14 to 18 November 2022, 100 cars with a special cruise control drove the I-24 near Nashville to damp waves in ordinary morning traffic. The road was fitted with hundreds of cameras that tracked every car.

Discussion

What do you think?

Share your own explanation, an objection or a variant of the puzzle. You need a GitHub account to comment.

Is “School maths” the right level for this puzzle?

Thank you! This helps set the levels right.

Newsletter

New puzzles, explanations and discussions

I keep adding new puzzles, new ways to explain them and write-ups of the discussions they start. Leave your email and I'll write when something new is out. No spam, one-click unsubscribe.

The sign-up form will appear here soon.