Tuesday, 26 January 2010


Think of a number. If it's even, halve it, if it's odd, triple it and add one. Now do this with the new number. Eventually you'll reach one. It takes eight goes starting from the number 6: 6 is even, so halve it, to get 3. 3 is odd, so triple it and add one, to get 10. And so on, through 5, 16, 8, 4, 2 to 1.

What's odd about this game is that it's hard to predict before you start how many goes a number will take before it gets to one. In fact the quickest way to find out for a given number is to actually do it -- there's no shortcut. Some small numbers take suprisingly many goes. Here's n excel plot of starting numbers along the bottom with the goes up the side, up to a starting number of 10,000.

Monday, 25 January 2010





Okay so I've been sitting playing with my home-grown Cellular Automata program all night. Again. The patterns it creates are more than just pretty. To me they're a tantalising clue, to some very significant fact about the world, which is beyond my intellect to grasp. I've been playing with 1D CA's ever since I saw them in Scientific American in the 1980's. They drove poor old Stephen Wolfram quite barmy. He's tried to create a new kind of science based on CA (well, basically) . But I know what's really happened. They drove him mad.

For me they exemplify the idea of emergence -- from simple laws come fascinating richness and complexity.

The images here are static, but when I play with my program the CA are dynamic, and unfold before my eyes. In spite of the many hundreds of hours I've spent looking at many thousands of them I'm still amazed at their variety.

The rules are amazingly simple: Basically this:

Write a table of twenty-seven digits. This is your rule table.
1 1 1 1 1 1 0 7 4 2 8 2 4 3 5 1 0 6 2 5 0 1 0 4 3 5 2 0

Now write a random row of digits, as many as you have pixels on your screen.

3 5 6 9 9 2 0 8 8....

Take them three at a time and add them up

3 + 5 + 6 = 14

Then use that sum to look up the rule table to see what number to put below the middle of the three numbers : In this case it's 5 (the table starts at is 0, not 1).

3 5 6 1 9 2 0 8 8....
5

Then do this for all the numbers...

5 + 6 + 1 = 12...

3 5 6 1 9 2 0 8 8....
5 4....

To display it on a screen, you colour all the numbers with a different pixel colour. And I "wrap" the pixels round, so that the whole row always gets filled. My program adds some nice gradients too.

The effect is to create very organic forms. You can't easily tell from the rules whether you'll get a pattern that dies out, or turns into "noise", or, as in the case of the screenshots, hovers perfectly between order and chaos.