Wolfram Rules With Excel (VBA)

Stephen Wolfram is famous for many reasons. One of those reasons are his Wolfram Rules looking at cellular automata.

One dimensional cellular automata are defined by very simple rules. Each cell is given a value of 1 or 0 depending on the values contained by the three neighbouring cells above (the cell directly above, the cell one up and to the left, and the cell one up and to the right).

Looking at Rule 30 above, all 8 possible combinations of cell values make up the top row (the ‘neighbouring cells’),and the rule “30” sets the value of the cells below. In binary, 30 is represented by 00011110. This means that with rule 30, if the three cells above a child cell are all 1’s, the child cell will be a 0. If the cell up and to the left and the cell directly above are 0, and the cell up and to the right is a 1, the child cell will be a 1.

Starting with a single cell at the top (generation zero), the state of the cells below can be set for each subsequent generation. As you move down through the generations, patterns of 1’s and 0’s are formed which can be visualised, as shown below.

Naturally, I wrote some VBA in Excel to reproduce these Wolfram Rules patterns. Click on the images below to view the VBA used clearly.

With the function above, it is possible to generate any of the Wolfram Rules, and in much greater depth than usually pictured. Click on images to see in full size.

Above is Wolfram Rule 30 – famous for its chaotic nature and for its use in random number generators.

Wolfram Rule 90, pictured above, is another famous image.

Wolfram Rule 110 is above. Only half a triangle is generated this time.

Going 500 generations deep with Rule 110 shows that there are patterns formed which appear to be chaotic, but the majority of the cells have order. According to Wikipedia (https://en.wikipedia.org/wiki/Rule_110), “Rule 110, like the Game of Life, exhibits what Wolfram calls “Class 4 behavior”, which is neither completely stable nor completely chaotic. Localized structures appear and interact in complex ways“.

Rule 62 is pictured below. Similarly interesting, and also not very useful.

Stephen Wolfram’s weighty 1200pp book published in 2002, A New Kind of Science, goes into great detail on cellular automata and thankfully as he and his giant brain are worth $2-3 Billion, it is available online free of charge here: https://www.wolframscience.com/nks/.