is one state and
is another. To differentiate easily between different states, each cell is given a number:
And this can be translated to binary as:
Making each state a binary number:
From this it follows that there are eight possible states, from 000 to 111, in a one-dimensional CA. Since there are eight possible states, then any rule must take into account each state. And, since there are only two possible outcomes, 1 or 0, the sta te can be written in shorthand as an eight digit binary number. Therefore, the rules range from 000000000 to 111111111, or 0 to 511. In a two-dimensional CA, the prior state for a given cell looks like this:
Following the same idea as in one dimension, then the state can be numbered as:
This time, there are 29=512 possible states making there 2512 total possible CA's. Each rule can, in the same way as before, be written as a binary number. However, C doesn't like 512 digit integers, so rather than use a number, I use d an array. Finally, I currently just randomly select a rule rather than accepting user input. This can be changed easily enough, but a truly practical system would be difficult to design.
The program that iterates the cellular automata turns the state into a binary number. For example:
is equal to 0*20 + 1*21 + 0*22 + 1*23 + 0*24 + 1*25 + 1*26 + 1*27 + 1*28 = 2 + 8 + 32 + 64 + 128 + 256 = 490. So the program would check element 490 of the rule array and assign its value to the next value of the CA.
This creates the two-dimensional array displayed in three-dimensions. A true three-dimensional CA is more difficult, mainly because the rules would need to be incredibly complex (227 states, and that many digits in a rule number). An easier w ay to do this is following the rules of the "Game of Life."
1. A living cell lives if it is surrounded by 2 or 3 living cells.
2. A dead cell grows if it is surrounded by 3 living cells.
3. In any other case, the cell dies.
Although it takes more rules, I found it better to describe it by four rules rather than three in order to make the transition to three dimensions easier. So, the new rules can be summarized as follows.
A given cell is alive in the next iteration if:1. The cell is alive and:
a) It has more than 1 neighbor2. The cell is dead and:
b) It has less than 4 neighbors
a) It has more than 2 neighbors
b) It has less than 3 neighbors
With these, yiu can define a two dimensional CA with four rules as opposed to 512. The downside is that the precision of the CA has been severely reduced. In three dimensions, however, this becomes a necessity. Remember that there are nine neighbors in two dimensions, making 29=512 states and that many rules for each cellular automaton. In three dimensions, there are 27 neighbors, making 227=134,217,728 states and that many rules necessary. Making an array that size, while it may be possible, would be wildly impractical. Meanwhile, the Game of Life in three dimensions can use the same 4 rules, with changes made to deal with the increased space.
Here is some other information on my project:
Here is a narrative of my project and my work on it.
2. Wolfram, Stephen. "A New Kind of Science." Lecture at University of Illinois, Urbana-Champaign on October 14, 2002.
3. EcVA group, SantaFe Institute. "Evolving Cellular Automata With Genetic Algorithms." http://www.santafe.edu/projects/evca/Projects/evca.html
4. Eck, David J. "Cellular Automata and the Edge of Chaos." http://math.hws.edu/xJava/CA/
Thanks for help on the code to Chris Appuhn for helping me with illiSkel. Of course, thanks to the programmers of illiSkel, George Francis, Stuart Levy, Glenn Chappell, and Chris Hartman. Finally thanks again to Professor Francis for all the help he gave me.
Back to the main page.