[3d Question About page 182 and 173] - A New Kind of Science: The NKS Forum

A New Kind of Science: The NKS Forum

Pages:1



3d Question About page 182 and 173

(Click here to view the original thread with full colors/images)



Posted by: Stephane

Hi Everybody,

I'm trying to experiment some 3d CA.

From the page 182 Examples of the Book.
NKSDisplay[182,
{{1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1}, {{{1}}}, 21, 10}, Heading -> False];


I tried to reduce those numbers :
1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 0 , to 12 numbers like this:
1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1

But I have trouble with it. :)

I got this Error message :
NKS::argg: The argument {1, 0, 1, 0, 1, 0, 1, 0, 1, 0, \[LeftSkeleton]2\
\[RightSkeleton]} is not a properly
formed list of 1's and 0's with length 14.

How can I change what is call "lenght 14" ?

I should say I m new with NKS.
What is the meaning and the relationship of code 450 ( Rule !?) describe on page 173 and the above argument ?

I didn't find so many details to change those above arguments in the help file.

I hope somebody can help me because NKS is amazing.

thank you in advance.

Stephane



Posted by: Jason Cawley

Ok, first understand that the evolution shown on page 182 is a true 3D CA, meaning its state at each time step is already a 3D shape in space. That is why you see a sequence of 3D shapes. The CAs on page 173 are 2D spatial patterns at each time step. On the facing page, 172, you see a 3D image, because a 2D CA plus its time dimension (running "downward") gives 3 dimensions all told.

Next, the CA rules being used in both places are what are called "outer totalistic" rules. That means we don't care exactly where 1s occur in the neighborhood of each cell, in the form of the rule - just how many are 1s. That is the "totalistic" - it means, we total the count of neighboring 1s, to get the case of our rule table to look up.

They are called outer totalistic rules, because they also depend on the value of the center cell, which is not just thrown into the "outer total" but matters, independently. A rule in which the center cell is treated like all the others and just thrown into the total count of 1s, is called a "totalistic" rule, simply - no "outer".

Suppose we take a simple case, like the simple 1D CAs, with a neighborhood of one cell on either side, plus the center cell. Then a totalistic rule would only have these possible cases - 3 1s, 2 1s, 1 1, or no 1s. There would be 4 possible cases, only. 1 1 on the left, 1 1 on the right, 1 1 in the middle - all have to act exactly the same. They have the same rule table entry, not several.

Now instead, consider an outer totalistic rule, still 1D and nearest neigbors. That means the right and left cell are lumped together in a total, and the center cell matters on its own. How many rule table entries are there? The outer total can be 2, or 1, or 0. The center cell can be 1 or 0. That gives 6 cases all told -

outer total 2 and center cell 1
outer total 2 and center cell 0
outer total 1 and center cell 1
outer total 1 and center cell 0
outer total 0 and center cell 1
outer total 0 and center cell 0

OK? Now, in each of those cases were are going to make the new center cell, something. What? A 0 or a 1. Put those after the cases, and now treat them like 6 digits of a binary number. That is the rule number. There are 2^6 = 64 of them, from rule 0 to rule 63. For instance, consider rule 62. The digits of 62 in base 2 are -

IntegerDigits[62,2,6] 

{1,1,1,1,1,0}


- since 2^5 + 2^4 + 2^3 + 2^2 + 2^1 = 32+16+8+4+2 = 62.
So the rule table for rule 62 would be -

outer total 2 and center cell 1 -> 1
outer total 2 and center cell 0 -> 1
outer total 1 and center cell 1 -> 1
outer total 1 and center cell 0 -> 1
outer total 0 and center cell 1 -> 1
outer total 0 and center cell 0 -> 0

With those rules, a white background is left unchanged, while any bit of black grows on either side by one cell per step.

That tells us how we go from a rule number to a rule table, for an outer totalistic rule. But the somewhat tricky bit is, the number of digits in our rule depends on the size of the neighborhood of cells that count. And when we increase the number of dimensions, there are more cells at the same distance away, because there are more directions to measure off that distance.

In a typical 2D outer totalistic rule, there are 4 outer total cells and the center cell. Up, down, right and left, and where you start. The outer total cells get tossed into a sum. There are 4 of them. A sum of 4 0s or 1s can end up as any value from 0 to 4 - which is 5 values. And then there is still the center cell, which can be 1 or 0 independently. So we get 10 cases in our rule table. And there are therefore 2^10 = 1024 rules of this kind.

That is the source of the rules you see on page 173. They are outer totalistic 2D rules with any of four neighbors plus the center cell mattering.

Now, go to page 182 and we are doing the same thing, but now in 3 dimensions rather than 2. What happens to the size of our rule table? Well, what are the neighboring cells in three dimensions? Up and down, right and left, as before - plus "out of the page" and "down into the page". So this time, there are 6 cells in our outer total. 6 0s or 1s can add up to anything between 0 and 6 - 7 cases. The center cell also matters. 14 cases. To specify one of these rules, therefore, we have to fill in the whole rule table, by saying what the rule is to do in each of the 14 possible cases it might encounter. They are -

outer total 6 and center cell 1
outer total 6 and center cell 0
outer total 5 and center cell 1
...

Each of these cases needs a 0 or a 1 - the new value to give to the center cell, when that case is the one that applies.

So, that is the 14 digit binary number the line you executed is expecting. It needs a full rule table for a 6 neighbor plus center cell outer totalistic rule. There are 14 distinguishable things that can happen, applying such a rule. It needs to know what it is to do if each of them happens to arise.

If you give it a 12 digit number only, it therefore quite naturally "coughs". Um, what? If you put an extra 0,0, at the front, you will tell it "if the outer total is 6, then make the center cell 0 at the next step." If you put a leading 1,0, at the front instead, then you will tell it "if the outer total is 6, then leave the center cell the way it was". Etc. But so far, you haven't told it what to do if that case arises, and it knows it won't be able to evaluate the rule if it doesn't know what each case does.

Make sense? That is why it needs a 14 digit binary number. That is the size of its rule table. The size of the rule table comes from 6 neighbors 0 or 1 all lumped into a sum, thus a number from 0 to 6, times two possible cases for each (center cell 0 or center cell 1).

I hope this helps.





Forum Sponsored by Wolfram Research

© 2004-2008 Wolfram Research, Inc. | Powered by vBulletin 2.3.0 © 2000-2002 Jelsoft Enterprises, Ltd. | Disclaimer
vB Easy Archive Final - Created by Xenon and modified/released by SkuZZy from the Job Openings