Butterfly effect simulator · Chaos theory
Chaos Twins
Start two points a trillionth of a turn apart on a circle and double both positions again and again: the gap between them doubles every step, so after 37 steps they are more than a tenth of a turn apart, and after about 40 they go their own ways. That is the butterfly effect, sensitive dependence on initial conditions, in its simplest form, computed here with exact math instead of rounded computer numbers.
- Step
- Twin A
- Twin B
- Gap
- Split
- Formula
- Plain floats
Share
The link reopens this start, this gap and this step.
How it works
Double it, keep the fraction, repeat
1. The rule
Take a number between 0 and 1 and think of it as a spot on a circle, where 0 and 1 are the same point. Double it and keep only the part after the decimal point. 0.369 becomes 0.738, then 1.476, kept as 0.476, then 0.952, then 0.904. This is the doubling map, one of the simplest chaotic systems there is. On the circle, each step doubles the angle.
2. Two twins
Twin A starts at your number. Twin B starts ε further on, a trillionth of a turn unless you pick another gap. Both follow the same rule, so the gap between them doubles too, exactly, wherever they start. After n steps it is 2ⁿ × ε, until that grows past half a turn and wraps around the circle. From then on the twins are no closer than two strangers. The chart under the circle shows the gap on a log scale: a straight line that climbs by log₁₀ 2, about 0.301, every step, then scatters anywhere below half a turn.
3. Why the start decides everything
Write the position in binary, as ones and zeros, and doubling moves every digit one place left and drops the one that passes the point. Each step reads out one more binary digit of the start. A trillionth is about 2⁻⁴⁰, so the twins share roughly their first 40 binary digits. Once those are used up, their futures come from digits where they differ. Nothing is random, and still no one can predict step 100 without knowing the start to about 30 decimal places.
4. Why exact math
Ordinary computer numbers, 64-bit floats, keep 53 binary digits. Doubling pushes them out one per step, and when they run out the point sits on exactly 0 for good. As plain floats, 0.369 lands on 0 at step 52. So this page stores each position as a whole number N that stands for N ÷ 10⁴⁰. Doubling becomes 2N, minus 10⁴⁰ when that passes a full turn. The bottom number never changes, so nothing is ever rounded, at step 150 or at step one million. Press Plain floats to see the other version.
The weather model that started it
In 1961 Edward Lorenz was running a small weather model on a computer at MIT. To repeat a run, he started it partway through and typed in a number from the printout, 0.506, instead of the 0.506127 the computer held. The new run followed the old one at first, then drifted until the two had nothing in common. A difference of about one part in ten thousand had grown into a different weather. In 1972 he gave a talk called Predictability: Does the Flap of a Butterfly’s Wings in Brazil Set Off a Tornado in Texas? and the name stuck.
Where 3 6 9 comes in
Doubling is the rule behind the vortex loop. On a 9 hour clock, 1 doubles to 2, 4, 8, then 16, which is 7, then 14, which is 5, then 10, which is 1: the loop 1 2 4 8 7 5. On this circle, a twin that starts at exactly 1/9 of a turn walks 1/9, 2/9, 4/9, 8/9, 7/9, 5/9 and back forever. The vortex is the doubling map seen at the ninths.
Real vs legend
What is math and what is story
| Claim | Status |
|---|---|
| The doubling map, x to 2x keeping the part after the point, is chaotic: a tiny difference in the start doubles every step. | Real |
| The gap between the twins is exactly 2ⁿ × ε, wrapped around the circle, wherever they start. | Real |
| In 1961 Edward Lorenz restarted a weather model with 0.506 in place of 0.506127, and the new run ended up completely different. | Real |
| The name butterfly effect comes from Lorenz’s 1972 talk, Predictability: Does the Flap of a Butterfly’s Wings in Brazil Set Off a Tornado in Texas? | Real |
| Weather forecasts lose their skill after about one to two weeks, because small errors in the starting data grow. | Real |
| Plain 64-bit floats run out of digits: under repeated doubling every start falls to exactly 0, 0.369 at step 52. | Real |
| On a 9 hour clock, doubling makes the loop 1 2 4 8 7 5. | Real |
| A butterfly’s wings can be traced as the cause of a particular tornado. | Legend |
| Chaos means randomness. | Legend |
| One small choice secretly fixes your whole destiny, the pop butterfly effect. | No source |
Questions
Butterfly effect FAQ
What is the butterfly effect?
It is the popular name for sensitive dependence on initial conditions: in some systems a tiny change at the start grows until it changes everything. Edward Lorenz found it in a weather model in 1961, and the name comes from the title of his 1972 talk, Predictability: Does the Flap of a Butterfly’s Wings in Brazil Set Off a Tornado in Texas? The twins in this tool are about the simplest example there is.
Why do the twins split at step 37?
The gap between them doubles every step, exactly. It starts at a trillionth, 10⁻¹², so after n steps it is 2ⁿ × 10⁻¹². After 36 steps that is 0.069 of a turn and after 37 it is 0.137, so step 37 is the first time they are more than a tenth of a turn apart. The rule is log₂(0.1 ÷ ε), rounded up. By step 40 the doubled gap would be about 1.1 turns, because 2⁴⁰ is about 1.1 trillion, so it has wrapped around the circle and the twins go their own ways.
Is chaos the same as randomness?
No. Every step follows one fixed rule, double and keep the part after the point, and the same start always gives the same path. What chaos takes away is prediction. Each step uses up one binary digit of the start, so to know where a twin is after 100 steps you need its start to about 30 decimal places.
Why does this tool use exact math instead of normal computer numbers?
Ordinary computer numbers, 64-bit floats, hold 53 binary digits, and each doubling pushes one of them out. When they run out the point lands on exactly 0 and stays there. As plain floats, 0.369 falls to 0 at step 52 and 0.369 + 10⁻¹² at step 53. This tool stores each position as a whole number over 10⁴⁰ and doubles that, which stays exact at every step. Press Plain floats to watch the collapse.
Did a butterfly ever cause a tornado?
Nobody can trace a tornado back to one butterfly, and that was not Lorenz’s point. He meant that the atmosphere grows tiny differences, far too small and too many to measure, and that this puts a limit on forecasting. It is why weather forecasts lose their skill after about one to two weeks.
What does doubling have to do with 3 6 9?
It is the same rule. On a 9 hour clock, doubling 1 gives 2, 4, 8, then 16, which is 7, then 14, which is 5, then 10, which is 1 again: the loop 1 2 4 8 7 5. Start a twin at exactly 1/9 of a turn and the doubling map walks 1/9, 2/9, 4/9, 8/9, 7/9, 5/9 and back. The chip near 1/9 starts within 10⁻³⁰ of it, and the twin follows that loop for about 100 steps before the tiny difference takes over.
Put this tool on your site
Embed the twins
Teachers and bloggers can drop the simulator into any page. Paste this code where you want it to appear.