Out of Order, Chaos

iteration of kx2-1


In his book Does God Play Dice?, mathematician Ian Stewart describes how iteration of a very simple equation can produce an extremely complex chaotic output . (See the notes for an explanation of what iteration means).

For example, if you iterate x2-1, with a starting value of x0=0.54321 (try this in the applet by entering k=1 and then hitting the Enter key), you get a cyclic output that oscillates regularly between 0 and -1. However if you do the same thing with 2x2-1 (in the applet, enter k=2 and then hit the Enter key), you'll find that the resulting output doesn't seem to follow any kind of pattern, and in fact looks random. You can use the < and > buttons to explore how the output continues to the right and left, and see for yourself that it never seems to settle down into any kind of regular behaviour.

chaos exploration applet - requires java enabled browser

Another interesting thing to try with 2x2-1 is to change the starting value of x ever so slightly, say by setting it to 0.543211 instead of 0.54321. You'll see that a tiny change in the starting value produces a completely different output.

Ian Stewart suggests many other fascinating possibilities. If you put k=1.4 you get a complicated cycle through thirty two different values. Chaos sets in around k=1.5. After that, it seems that the bigger you make k, the more chaotic things get... or do they? At k=1.74 you see well-developed chaos, but k=1.75 unexpectedly settles down into an orderly cycle.

Out of chaos emerges pattern. The two are inextricably related. Go to the applet and see for yourself.


This applet iterates kx2-1 for any choice of k and starting value of x. Type your chosen values into the text boxes, then hit the Enter key or click the Iterate button to plot the graph.

The graph and list display the results of 300 iterations starting from the show from value. To see the next 300 iterations just click the > button, and conversely click < to view the previous 300 iterations. You can also type in your choice of show from value.

Clicking on an item in the result list highlights the corresponding point on the graph and, conversely, clicking on a point of the graph will select the corresponding item in the list. Use the Up and Down arrow keys to scroll through the values in the result list, higlighting the corresponding point on the graph each time.


stewart book

This applet implements an exercise suggested in the book: Does God Play Dice? The New Mathematics of Chaos - by Ian Stewart.

More Applets:

Other mathematical applets you might like to try on this site are Conway's Game of Life - the classic simulation with something extra (the cells gradually change colour as they grow older). And for another, less frequently implemented cellular automaton, check out Langton's Ant .


Iteration means doing the same thing over and over again. Suppose you want to iterate the operation x2. You have to start somewhere, so you might choose an initial value: x0= 2. Plug this value into the original equation and you get: 22 = 4 . Let this answer be your new value of x : x1= 4. Plug the new value of x back into the equation to get the next answer: x2= 42 = 16 . Continue plugging the answers back into the equation and you'll get:
x3= 162 = 256
x4= 2562 = 65536
x5= 655362 = 4294967296
... and so on. Clearly this particular iteration is going to shoot off toward infinity pretty quickly, but there are others which do more interesting things. Go back to the Description to read about them.