A New Kind of Science: The NKS Forum > Pure NKS > N x M CA - a programing problem
Author
Hunter Snevily

United States

Registered: Dec 2009
Posts: 3

N x M CA - a programing problem

N x M CA

Consider the two by three matrix below

2 17 99
43 5 110

All entries represent cellular automata rules – a row represents cells mod 3 and
a column represents time steps mod 2 – let me explain.

Start with some initial arrangement of black and white cells (time step=0).

The first row goes with odd time steps i.e. 1,3,5,7,…

For time steps = 1 mod 2 and for cells =1 mod 3 apply CA rule ‘2’.
For time steps = 1 mod 2 and for cells =2 mod 3 apply CA rule ‘17’.
For time steps = 1 mod 2 and for cells =0 mod 3 apply CA rule ‘99’.

The second row goes with even time steps i.e. 2,4,6,….

For time steps = 0 mod 2 and for cells =1 mod 3 apply CA rule ‘43’.
For time steps = 0 mod 2 and for cells =2 mod 3 apply CA rule ‘5’.
For time steps = 0 mod 2 and for cells =0 mod 3 apply CA rule ‘110’.

Thus we are applying ‘6’ different CA rules to update the cells.
Three rules for odd time steps and three rules for even time steps.

This generalizes to an N x M matrix

Note a 1x1 CA is just a normal CA as defined by Wolfram.

Problem- Write code that will produce pictures for any N x M CA.

Can you discover any interesting patterns?

Report this post to a moderator | IP: Logged

12-10-2009 07:35 PM
M Carneiro

Ohio

Registered: Nov 2009
Posts: 3

What you describe cannot be done with a regular cellular automaton in a blank initial condition, because your CA requires a cell to differentiate itself from its neighbors. It can be done, however, if the initial conditions include information for each cell saying "I am cell 2, time step 1" or somesuch. With that setup, this program will suffice:

code:
{{2, 17, 99}, {43, 5, 110}} With[{x = Length[%[[1]]], t = Length[%]}, CellularAutomaton[{c[ IntegerDigits[%[[#[[2, 3]] + 1, #[[2, 2]] + 1]], 2, 8][[FromDigits[#[[All, 1]], 2] + 1]], #[[2, 2]], Mod[#[[2, 3]] + 1, t]] &, {}, 1}, MapIndexed[ c[#, Mod[#2[[1]] - 1, 3], 0] &, {1, 0, 0, 1, 1, 1, 1, 1, 0, 1, 1, 0, 0, 0, 0}], 50]]; ArrayPlot[% /. c[a_, _, _] -> a]

The array at the beginning is the CA rule matrix, and the embedded 0/1 list is the IC. It turns out that your given matrix is quite boring; it always devolves into a 3-by-2 (surprised?) repeating pattern. Interesting patterns generated by random testing:

{{22, 135, 58}, {62, 163, 231}}
{{152, 41, 76}, {120, 74, 90}}
{{146, 221, 135}, {77, 123, 172}}
{{39, 166, 162}, {196, 169, 90}}
{{212, 114, 27}, {154, 153, 10}}
{{54, 183, 37}, {134, 78, 126}}
{{189, 86, 183}, {97, 106, 58}}
{{61, 238, 81}, {101, 101, 233}}
{{158, 95, 225}, {32, 193, 142}}
{{158, 105, 5}, {180, 185, 109}}

Report this post to a moderator | IP: Logged

01-15-2010 03:09 AM
mdmd

Registered: Not Yet
Posts: N/A

Thank you for this useful explanation and interpretation

Report this post to a moderator | IP: Logged

07-05-2010 09:16 AM
MikkH
University of Tartu
Estonia

Registered: Dec 2009
Posts: 22

(22, 90/91) <- (ic: e.g. 30/45) - class 4!

Produced using slightly modified code due to M Carneiro. Result for the ECA rules 22 (LR, class 3) and 90 (LR, additive, class 3) illustrated; 91 (class 2) instead of 90 produces the same type of complexity.

Conclusion:
Combinations of some ECA rules of the complexity classes 2 & 3 / 3 & 3 (sensu Wolfram) with random initial conditions produce complex class 4 type behavior.

MikkH has attached this image:

Last edited by MikkH on 03-19-2011 at 02:48 PM

Report this post to a moderator | IP: Logged

03-13-2011 04:23 PM

wolframscience.com  |  wolfram atlas  |  NKS online  |  web resources  |  contact us