The logistic map

One rule: replace x by r·x·(1 − x). Start anywhere between 0 and 1 and repeat. For small r the value settles down. Push r past 3 and it starts to flip between two values, then four, then eight, and past about 3.57 it is mostly chaotic: a typical start never settles down, and two nearby starts soon part company. Mostly, not always. The left picture is a cobweb. Start at x₀ on the bottom axis and go up to the curve: that height is the next x. Go across to the diagonal line, which carries the height back to the bottom axis. Repeat: up, across, up, across. The first step is drawn in blue. The right picture is the same numbers in order.

Mission. Predict first: does bigger r always mean more chaotic? Then press 3.83, leave x₀ where it is, and read the "Long run" line.

Answer

No. At r = 3.83, well past 3.57, almost every start calms down onto an attracting 3-cycle, 0.1561, 0.5047, 0.9574: a periodic window inside the chaos. Change x₀ and it still lands there. Now compare: at r = 3.9 or 4 run x₀ = 0.2 and then 0.201 and look at the time series after thirty steps. That sensitivity to the start is what chaos means, and the bifurcation diagram shows where each kind of behaviour lives.

Try

What's going on

The rule x → r·x·(1 − x) was meant to model a population: next year's size is proportional to this year's (the r·x part) but shrinks as the habitat fills up (the 1 − x part). It is about the simplest nonlinear rule you can write down, and it contains a universe.

For r below 1 everything dies out. Between 1 and 3 the population settles at the fixed point x* = 1 − 1/r, where the curve crosses the diagonal. At r = 3 that point stops attracting and a 2-cycle takes over; at about 3.449 it becomes a 4-cycle, at 3.544 an 8-cycle, and the doublings pile up ever faster until about r = 3.5699. Beyond that, for most values of r, the behaviour is chaotic: a typical start never settles into a cycle, and two starts that differ in the third decimal place end up nowhere near each other. Try x₀ = 0.2 and 0.201 at r = 4 and compare the time series after thirty steps. That sensitivity, not the failure to repeat, is the mark of chaos. A few special starts do repeat even here: at r = 3.9, x₀ = 29/39 is an exact fixed point, but a repelling one, so the slightest rounding throws you off it and the computer cannot hold it.

The bifurcation diagram plots, for each r across the bottom, every value the sequence keeps visiting after it has settled. The fork-shaped doublings are easy to see. So are the periodic windows: pale gaps in the chaos where a cycle attracts again. The widest sits at r ≈ 3.83, where the 3-cycle 0.1561, 0.5047, 0.9574 catches almost every start, and zooming in shows it has its own cascade of doublings (3, 6, 12, …) on the way back into chaos. So bigger r does not simply mean more chaotic. The ratio of successive gaps between doublings approaches 4.669…, Feigenbaum's constant, and the astonishing fact is that this same number appears for almost any hump-shaped rule, not just this one.

Sheet: The logistic map and chaos. Related demo: the Mandelbrot set, which is the same idea with complex numbers.