Two runs of the same equation, started one billionth apart, look identical for ten steps and share nothing by step forty. The free Two Starts a Billionth Apart app on x9m8 runs both at once on the logistic map, plots the gap between them on a log scale, and measures how fast that gap grows with a live Lyapunov exponent.
One rule, applied again and again
The logistic map is a single instruction. Take a number x between 0 and 1, return r times x times (1 minus x), then feed the answer back in. MathWorld writes it as a recurrence, x(n+1) = r·x(n)·(1 − x(n)), and notes that it comes from replacing the continuous logistic equation with discrete steps.
The parameter r is capped at 4. A Brown University lecture on the family points out that the rule has its maximum, r/4, at x = 1/2, so for r above 4 the numbers escape the interval. The app’s slider therefore runs from 2.5 to 4.
Nothing random enters. Same r, same start, same sequence, every time. The blue run in the app begins at x = 0.3 and the orange run at 0.300000001. The only difference between them sits in the ninth decimal place.
What a billionth does at r = 3.9
At r = 3.9 the two runs overlap through the opening steps. On the top panel they are drawn as one thick blue line with a thin orange line riding on it, and no eye could separate them.
The bottom panel shows what the eye misses. It plots the gap between the runs on a log scale, so each gridline is a ten-thousandfold jump. The curve starts at 10⁻⁹ and climbs in a nearly straight line, which on a log axis means exponential growth. It reaches 0.1, a tenth of the whole interval, at step 37. From there the gap stops growing, because it cannot exceed the interval itself, and the two runs wander as unrelated sequences.

The pattern has a name in everyday speech. A Cornell computer exercise describes sensitive dependence as the butterfly effect and uses this same map to measure it.
Measuring the growth rate
A handout from Harvard’s Math 118r by O. Knill says the Lyapunov exponent measures the exponential rate at which errors grow. If the exponent is λ, an error ε becomes roughly ε·e^(λn) after n steps.
For a map f the exponent is the long-run average of ln|f′(x)| along the orbit, a definition written out in a paper on chaotic sequences for communications. For the logistic map the slope is r(1 − 2x). Each step stretches a tiny gap by that factor at the current point, and the average of the logarithms is λ.
The app computes it directly: 500 steps are discarded, then 20,000 are averaged. At r = 3.9 and x = 0.3 the readout shows λ = 0.4941. Raising e to that power gives a growth factor of 1.639 per step on average.
That is enough to forecast the divergence. Growing from 10⁻⁹ to 0.1 takes ln(10⁸) ÷ 0.4941 = 37.3 steps. The app measures the first step with a gap above 0.1 and finds 37. The dashed purple line on the lower panel is the same prediction drawn over the data, and the green curve follows it closely until it flattens.
r = 4: the exponent is exactly ln 2
The top of the range is special. In a paper on generalizations of the map, Valérie Poulin and Hugo Touchette write that at r = 4 the exponent equals ln 2 for almost all starting points. Knill’s handout gives the same value as log 2.
The same paper supplies a closed form for r = 4, x(n) = sin²(2ⁿπθ₀), where θ₀ is fixed by the starting point. The angle doubles at every step, which is why the gap doubles at every step. The app agrees: its readout shows λ = 0.6932 and a growth factor of ×2.000.

The arithmetic exposes a hard limit on foresight. Shrink the starting gap a thousandfold, from 10⁻⁹ to 10⁻¹², and the run at r = 4 crosses 0.1 at step 37 as well, about the same step as the 3.9 run above. The prediction is ln(10¹¹) ÷ ln 2 = 36.5. Each thousandfold improvement in the starting measurement buys ln(1000) ÷ 0.6931 ≈ 10 extra steps at r = 4, and about 14 at r = 3.9.
Better instruments help, but only by a fixed number of steps for every thousandfold gain.
The same arithmetic applies inside a computer. Ordinary double-precision numbers carry rounding errors near 10⁻¹⁶, and an error that size at r = 4 grows to 0.1 in about ln(10¹⁵) ÷ ln 2 ≈ 50 steps.
r = 3.5: the gap shrinks
Chaos is not automatic. Move the slider to r = 3.5 and the readout turns negative: λ = −0.8725, a factor of ×0.418 per step. The gap collapses instead of growing, and the two runs settle onto the same repeating cycle.

The Brown lecture lists the points where the repeating cycles double in length: r = 3, then 1 + √6 (about 3.449), then 3.54409, 3.5644 and 3.568759. A separate paper states that each such point turns a stable orbit of period 2ⁿ into a stable orbit of period 2ⁿ⁺¹ (arXiv 2211.11748). Since 3.5 falls between 1 + √6 and 3.54409, the stable cycle there visits four values. The doublings pile up near 3.57, and a review of dynamical systems theory places the accumulation point at 3.56…, beyond which orbits turn chaotic.
The app’s r = 3.57 button parks the slider next to that boundary. Small moves of r in either direction flip the readout between a shrinking gap and a growing one.
Hearing the divergence
The companion video turns the same two runs into sound. Each run plays a note at every step, with pitch set by the value: 220 Hz at x = 0, rising two octaves to 880 Hz at x = 1. The video holds r = 3.9 and the billionth-sized gap, takes 60 steps at four per second, and shows a counter, two dots on a number line, and the gap curve with the Lyapunov prediction laid over it.
In the opening steps both runs sound the same note, so a listener hears one voice. Then the notes begin to drift apart. At step 44 the on-screen labels read G#5 and G5, and at step 60 they read G#5 and F4.
The same idea runs through the other chaos pieces on x9m8. The Lorenz attractor simulator follows a twin trajectory in three dimensions, and the double pendulum simulator measures the exponent in a mechanical system. The earlier Visual Math items, Build a Square Wave From Sine Waves and When Clicks Turn Into a Note, use the same app-plus-video format.
Sources
- MathWorld, Logistic Map
- Brown University, APMA 2210 lecture 1 (logistic maps and period doubling)
- O. Knill, Lyapunov Exponent, Harvard Math 118r handout, 2005
- V. Poulin and H. Touchette, On a generalization of the logistic map (arXiv nlin/0003017)
- Discrete Chaotic Sequence based on Logistic Map in Digital Communications (arXiv 1207.2694)
- Chaos, Lyapunov, and entropy increase, Cornell statistical mechanics exercise hints
- Universal Dynamics of Damped-Driven Systems: The Logistic Map as a Normal Form for Energy Balance (arXiv 2211.11748)
- Geometrical theory of dynamical systems (arXiv math/0111177)
