Jason Cawley
Wolfram Science Group
Phoenix, AZ USA
Registered: Aug 2003
Posts: 712 |
Not a problem, it is why we are here.
OK, I'll take Tomasso's favorite rule first, it is one I like.
ArrayPlot is a built in Mathematica function that accepts a data array and returns a color shaded plot (by default, in grey level colors). It is wrapped around the CellularAutomaton evolution to display the results, and plays no further part here. I might, incidentally, add my favorite color scheme for 3 color CAs at the end, between the last two closing braces -
, ColorRules -> {0 -> Yellow, 1 -> Red, 2 -> Black}
But that is purely aesthetic.
The CellularAutomaton function call has 3 major parts, each can have subparts (and in this case does). The first is the rule specification - which CA from which family to run. The second is the initial condition - what pattern of colors or site values appears on the first row, that the rule operates on for the rest of the evolution. The third is a generalized number of steps to run the rule for - where by generalized, I mean it can also include options about what part of the result to return.
The rule specification in Tomasso's favorite rule is this part -
{13723198, {3, {3, 1, 3}}},
The first piece is the rule number, and specifies exactly which rule to use out of the whole family. The second piece gives the rule family, here an outer totalistic, 3 color, 1 dimensional, range 1 rule. How does {3, {3,1,3}} say all that?
The first 3 is the number of colors. The next bit, the list {3,1,3} is called the kernel, and gives the weights to be assigned to each cell in the rule's neighborhood. Since the kernel is a 1 dimensional list, it is a one dimensional rule. A 2D rule would have a matrix there instead. Since the kernel is 3 elements long, the rule is range 1 - the middle one is the center cell weight, and the others are 1 away on each side. If it were a range 2 rule, the list would need to be 5 elements long.
OK, but why are the elements themselves {3,1,3}? That pattern, where the outside elements are the same value as the number of colors, and the center cell is a 1, is the pattern that gives an outer totalistic rule. It is saying, take the left element and multiple it by 3, the center element and multiple it by 1, the right element multiplied by 3, add them all up. That number is the case of the rule table to use. Well, since both sides are 3, they are interchangable - a 2 on the right or on the left has to act the same, since each will add 6 to the case to use. The middle cell will matter independently, because the "outer total" will always be divisible by 3 - 0, or 3, or 6, or 9, or 12. The case being used "mod 3", will always be the value of the center cell.
If you wanted a totalistic rule, you would have a kernel of {1,1,1} instead. Or if you wanted a general rule, with all possible arrangements treated differently, you could use {9,3,1} (with each entry the number of colors raised to a different integer power - the "1" being 3^0).
That is a lot of internal minutae about how that rule specification manages to say "this is an outer totalistic 3 color range 1 rule". Doron's rule is the same pattern, just a smaller rule number.
OK, now on to the next bit, the initial condition. That is the part that in Tomasso's favorite case reads -
{{1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1}, 1},
It has two parts - first a list with (in this case) 0s and 1s in it - it could have 2s as well, since this is a 3 color rule, but his specific initial condition doesn't happen to start with any 2s in it. And then that ", 1}" at the end. That says, "embed the previous list in a sea of "1"s, repeated. In other words, the initial condition is all 1s outside of the specified list, and is a mix of 1s and 0s inside.
In Doron's initial condition, there are 2s as well, but it is a shorter list. That just means he starts from a narrower pattern. You can go as short as the simplest possible "seed" - {{1},0} means a single "1" surrounded by 0s. You can also have a repeating pattern rather than a single color as a background e.g. you could put Tomasso's list on a background of {0,1,2,1,0} repeating "blocks" instead of a background of 1s, by having the initial condition read -
{{1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1}, 0,1,2,1,0},
OK, last bit. It is the part that reads {100, All}. That means "run this rule from the specified initial condition for 100 time steps, and show me every cell that could have been affected by the evolution, whether it was or not."
So, the part you specifically asked about - why is Tomasso's initial condition wider than Doron's - is just, he picked that one. Any list will work there; each possible list you'd put in would be the same rule, but started off from a different pattern.
I hope this helps.
Report this post to a moderator | IP: Logged
|