When entering a query in Wolfram Alpha you usually see an animation shown for a couple of seconds before the result is displayed. It seems to be a cellular automaton with 3 distinctive states.
I would like to know what this particular automaton is called, and where I can find informations about it. Thank you!
cellular automata (CA), model of a spatially distributed process that consists of an array (usually two-dimensional) of cells that “evolve” step-by-step according to the state of neighbouring cells and certain rules that depend on the simulation. CAs can be used to simulate various real-world processes.
In mathematics and computability theory, an elementary cellular automaton is a one-dimensional cellular automaton where there are two possible states (labeled 0 and 1) and the rule to determine the state of a cell in the next generation depends only on the current state of the cell and its two immediate neighbors.
It's a cellular automaton with 5 states. The rule is 3457/357/5
using Golly's notation.
It has 5 states: 0
, 1
, 2
, 3
, 4
. In each step, cells behave as follows:
0
-> 1
if 3, 5 or 7 of its eight neighbors are 1
, or 0
otherwise1
-> 1
if 3, 4, 5 or 7 of its eight neighbors are 1
, or 2
otherwise2
-> 3
3
-> 4
4
-> 0
Here is an oscillator with period 15:
Here is a puffer with period 24:
Here is a very fast matlab implementation of Wolfram Alpha's cellular automation:
rng(38); % 31 lasts a while / 38 has two oscillators / 39 lasts longer /42 lasts muuuuch longer
X = randi([0 4],30,40);
[a,b] = size(X);
initialFig = figure('toolbar','none','menubar','none');
[x,y] = meshgrid(1:b,1:a);
scathandle = scatter(x(:),y(:),20*X(:)+1,X(:)+1,'filled');
colormp = linspace(1,0.4,5)'*[1 1 1]; colormap(colormp);
axis([0 b+1 0 a+1]); axis off; set(gca,'position',[0 0 1 1]); set(gcf,'toolbar','none','menubar','none','color','w','numbertitle','off','name',''); axis equal;
n = [a 1:a-1]; % The previous row
s = [2:a 1]; % The next row
e = [2:b 1]; % The next column
w = [b 1:b-1]; % The previous column
[A,B,C] = meshgrid(1:a,1:b,[0 1]);
Xnew = X;
while 1
N = (X(n,:)==1) + (X(s,:)==1) + (X(:,e)==1) + (X(:,w)==1) + (X(n,e)==1) + (X(n,w)==1) + (X(s,e)==1) + (X(s,w)==1); % Look for the total number of nieghbours == 1
Xnew(X>=2) = mod(X(X>=2)+1,5); % if state is greater or equal to 2, increment 1 modulo 5
Xnew(X==0) = (N(X==0)==3 | N(X==0)==5 | N(X==0)==7); % if state is 0, turn to 1 when neighbours equal 3,5 or 7. Leave 0 otherwise.
Xnew(X==1) = 2 - (N(X==1)==3 | N(X==1)==4 | N(X==1)==5 | N(X==1)==7); % if state is 1, turn to 2 unless neighbours equal 3, 4 or 5. In the latter case, leave 1.
X = Xnew;
set(scathandle,'cdata',X(:)+1,'sizedata',20*X(:)+1);
drawnow;
if ~ishandle(initialFig)
return
end
end
I guess that, at any moment, someone will find this useful (somehow).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With