Today we’re going to continue our examination of 1 dimensional Wolfram Elementary Cellular Automata by examining Rule 1 (00000001) and manually step through a few cycles or generations.
We will create a 1D grid with a length of 24 + 1 (17) so that we have a center value equal distance from both ends, we will assign all cells the off state except for the center cell which we will turn on.
We will call this our “initial seed” value. Wolfram CA rules are usually demonstrated with some version of this seed, though it is important to remember that the length can be as long as you want, both shorter or longer and the cell states can be set however you need them to begin.
Before proceeding review the neighborhood because it is now important to understand this:
The Wolfram Neighborhood
Lets look at Rule 1(00000001) and get started computing new cell states.
If you imagine the rule 1 table above as an “array” then the first row represents the “keys” and below I will refer to R8 or R6 or other keys by these names as shortcuts that are referring to the neighborhood patterns on the second row, example R3 refers to a neighborhood pattern of a left cell of 1, a center value of 0 and a right value of 1… got it?
Just to be sure that you are able to follow along consult the center values in the initial seed, its a 1 and to its left is a 0 and to it’s right is also a 0, therefore on the center position in the “new seed” we will apply R6 which means the new center value would be a 0 Still with me? Good! 😉
Only one more thing to talk about before we get to computing and that is how to handle the edge cells which are the first cell $seed and the last cell of the seed $seed . Because there is no $seed[-1] and $seed there are two options for handling this scenario. A lot of people simply say those positions are 0’s (or 1’s depending on the case) but I like the second option which is to wrap around and grab the value at the other end of the seed. This methodology allows the patterns to wrap rather than stop when an edge is encountered however depending on your use needs you may want to wrap or use a hard value, neither way is technically correct.
So now that we are on the same page lets start figuring out what rules to use to compute the new seed.
We can replace the rules with their values and then figure out what rules to use next:
And if we replace the rules with the rule values you can see we are back where we started:
This pattern will repeat over and over again until we decide to stop, here’s 14 more generations to demonstrate:
The Finished Rule 1 Image
This isn’t always the case however, lets look at a different rule that will give us many more interesting neighborhood patterns, Rule 26 (00011010)!
Notice that we reset the seed to what we started with so that we can illustrate the differences in the rules. Nothing prevents us from using the output of Rule 1 (or any rule) as the input seed for another rule, in fact you can get some very interesting results by doing that!
Notice also that because the seed is the same as before, if we fill in the cell rules they are same neighborhood patterns that we used before, what’s different this time is the values the patterns are mapped to.
If we replace the neighborhood pattern with the rule value we get a completely different result than we got with Rule 1 before! While we’re at it lets also fill out the next set of rules too:
Once again we replace the cell rule with the rule value and we have a completely different grid, we also figure out the next row’s rule patterns:
OK lets now convert those rules to values to see what we get:
Here’s 12 more generations, there is a pattern but its not quite like the pattern that Rule 1 gave us:
The Finished Rule 26 Image
I was going to start looking at code with you today but it’s getting late and this post is already fairly long so come back tomorrow and we will FINALLY dig into the code 😛 have a great evening everyone!
Please Fund, Subscribe, Like, Share & Comment:
I will see you all in my next post!