Botanica Mathematica

a textile taxonomy of mathematical plant forms

Chaotic knitting


In mathematics, a chaotic system is one which has clear rules on what to do from one time step to the next, but where the outcome is unpredictable because it is so sensitive to the starting conditions.  Amazingly, we can make up a very simple knitting pattern which is complete chaos…

Let me give you the general idea before I get into specifics. There are two colours. You start with a row consisting of the colours chosen in a random order. Then in subsequent rows, the colour of a stitch depends on the colours of the three stitches below it. (That is, the one directly below and the ones either side of that stitch.) If you’re at an edge stitch, you need to look at the stitches at the other end of the row – imagine they wrap around in a circle.

The specific rule I chose is the following. Let W=white yarn, O=orange yarn.

Stitch pattern below New stitch colour

This is called ‘Rule 30’ and you can read more about it on Wikipedia.Not all rules are chaotic, but this one is. If you change the colour of even just one stitch in the starting row, you’ll get a completely different pattern.

Here’s the pattern I made:

cellular automata knitting - rule 30The first thing you’ll notice is all the triangles that appear. That was unexpected. There are also some straight lines on the right. But it’s all very random.

This way of creating patterns is known mathematically as a “one dimensional binary cellular automaton”. It is one-dimensional because it only relies on the stitches immediately below it, and not all the other ones around it. Wikipedia has a lot of information about more general cellular automata if you are interested!

One of the amazing things about Rule 30 is that it appears in nature too. There is a particular species of sea snail, called Conus textile, which shows up a very similar pattern on its shell.

Conus textile shellNotice the triangles appearing as well as regions of straight lines. Amazing!

Try experimenting with different rules, different colours or even different numbers of colours and show us what you find! (I recommend coding up the pattern in Excel if you can – it makes it much easier to knit. If you’d like a copy of my spreadsheet, send me an email at

4 thoughts on “Chaotic knitting

  1. To be a little bit more accessible than Excel, I’ve made a Rule 30 spreadsheet in Google Drive:
    If you make a copy of it, you can edit the top row to see how it affects the pattern produced.

  2. Brilliant – thanks! In my spreadsheet I actually got Excel’s random number generator to make the top row, so it was truly random. I then spent a long time looking through different patterns to see which one was visually appealing. 🙂

  3. Hi Haggis! I love your Rule 30 textile, which is a better illustration than I’ve ever seen of knitting patterns’ dependence on mathematical formulas and math’s potential to create striking, unique images under strictly defined conditions.

    I’m wondering if you’d be interested in joining, the website I work for. It’s an online community where people who make cool things can share them and teach each other skills. I think our users would get a huge kick out of seeing a familiar process demonstrate a principle that’s not just relevant to knitters. All you’d have to do is register and upload a picture, which only takes a couple of minutes, but it would be especially exciting if you could give a brief overview of the technique. You’re also welcome to upload other craft projects if you have any you feel like sharing.

    If you have any thoughts or questions, feel free to email me at And if you decide to join, let me know so I can check out your projects!

  4. Reblogged this on Through The Looking Glass and commented:
    An interesting way to knit!

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s