Problem 42877. Cellular Automaton | Rule X
Cellular Automata (CA) provide a convenient way to represent many kinds of systems in which the values of cells (either 0 or 1) in an array are updated in discrete steps according to a local rule.
Start with a single ONE at the center of the 1st row of an (n+1)-by-(2*n+1) sheet of ZEROs , the value of each point in the array at position A(i,j) , i = 2:n is determined by values of its 3-neighbors A(i-1, j-1), A(i-1,j), A(i-1,j+1) according to the given Rule.
Since we consider 3-neighbors, they can have one of 8 possible states (starting with 000 to 111). The Rule number is a decimal number between 1-256 (i.e. 2^8), where its 8-bit Bin form represents the outputs of those 8 possible states as shown in the figure below.
You problem is to generate the Cellular Automaton array given the Rule number and number of iteration to run (n = rows of array).
NOTE: you can plot the result using imagesc(CA) for fun.
\
/

Solution Stats
Problem Comments
-
5 Comments
Thanks for your clarification, Jan. In this case, it is necessary that the assumption is stated in the problem, or the answer should stick to the example shown in the description.
BTW. Illustraton from mathworld.worfram.com is missing reference, isn't it?
The example does not match the solutions. First puzzle(30,3) has [0 1 1 0 ...] as next to last row with an expected [0 1 0]. The example shows this as [1 1 0]
Solution Comments
Show commentsProblem Recent Solvers17
Suggested Problems
-
Given two arrays, find the maximum overlap
1608 Solvers
-
184 Solvers
-
104 Solvers
-
289 Solvers
-
Reverse the elements of an array
1052 Solvers
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!