📜 ⬆️ ⬇️

Interesting examples of cellular automata

Interesting examples of cellular automata.

On Habré many articles on cellular automata ( http://habrahabr.ru/post/168291/ , http://habrahabr.ru/post/227003/ ), especially on the game "Life" ( http://habrahabr.ru/ post / 67790 / , http://habrahabr.ru/post/154509/ , http://habrahabr.ru/post/237629/ ). I want to tell something new - about other cellular automata, to give unexpected and interesting, in my opinion, examples. We look at the structure, which gradually copies its original configuration ; and on the structure that draws a circle .

Caution, big gifs
')
Definition is an important thing, but not everyone is interested.
According to Kudryavtsev’s book, Introduction to Automata Theory, a cellular automaton (or a homogeneous structure) is a set:


Where inline_formula the set of integer k-dimensional vectors is the cell structure. Will use inline_formula ;
inline_formula - many states;
inline_formula - an ordered set of pairwise different non-zero vectors from inline_formula power inline_formula for convenience we put inline_formula . This is a neighborhood of the cell;
inline_formula - the function n of the valued logic h of arguments ( inline_formula ), inline_formula - rule of change of states;

Generally speaking, instead of inline_formula You can take and other media, just do it incredibly rarely. Why not make the cellular automaton on the torus?


This also applies to definitions, but it will definitely come in handy:
inline_formula - the state of the structure.
inline_formula - cell, then inline_formula - her condition. Something like: "according to the coordinates of the cell - its state".
inline_formula - new cell state
inline_formula - new state of the structure, where each cell has its own new state. (Applied inline_formula to all cells)

Note that the new state of the structure does not depend on the “order of application” inline_formula as it may seem at first glance: in fact, we do not change the state, we make a new field and fill it with new states.

Configuration - the state of the structure with a finite number of non-zero cells.

Copy structure


We have some directions inline_formula - surroundings. We want to inline_formula - XOR'ila all values ​​from the neighborhood (including the value of the cell, the result of which is calculated). Why did we take that way? It's just clear to us that if we have only one single cell on the field, then in one move it will “copy out” into the entire neighborhood (inverted).

Obviously, the operation is linear (in the sense of XOR), that is, we can subtract the new configurations for each cell separately, and then element-wisely proximize the result, and not honestly read the new configuration. In other words (hereinafter under inline_formula understood XOR): if inline_formula then inline_formula . Well, accordingly inline_formula .
Denote inline_formula - configuration with one unit in a cell inline_formula element.

Proof


Well, consider them separately. It is easy to see that the following configuration will have inline_formula in cells inline_formula (including, 1 will remain in place), that is:


Let's see how the configuration will bring itself further (and then it will behave cool!):


It turns out that all members at inline_formula they are reduced, for they include an even number of times in the sum (and we use the characteristic field two).

Well, the proof base is ready to copy, try to make the transition. All the same, only instead of two - inline_formula .
If application inline_formulainline_formula time looks like:


that


What I wanted to get.
Now we have inline_formula
Cool, cool, our structure is really copied along the vectors that define the neighborhood.

Let's dig the sun:
sun

On the example of a square, how it extends further:
Xor

Circle


A remarkable example of the incredible: with a discrete structure, with a finite memory of each cell (which means it cannot even remember its coordinates!), We will interpolate a continuous object — a circle — as much as you like.

I will not formally describe this system, since it will not become clearer from its formal description: there are a dozen states in the cell and the same number of elements in the surroundings.

Let's start. Almost obvious what a running signal is.

How does
There are two cells with fixed states and one “signal” - a cell in the segment between the first two. A sign has two states: “move to the left” and “move to the right,” and, unexpectedly, in these states it evolves in a certain direction. In contact with fixed cells, he turns in the opposite direction.


signal

And it is clear that he can "push apart" the cells holding him.

How does
Each of the fixed cells in contact with the signal will behave similarly to the signal: move to the side.


signal2

This is almost all we need: let's launch a horizontal signal that will push the carrier cells, and with each pushing we will create two vertical latches and a vertical signal. It is clear that the signals can be arranged so that the horizontal does not conflict with the vertical ones: if they are superimposed, you need to make a new state that will “remember” in which directions the signals should be launched in the next step.

Why do fixing points tend to circle?
Denote:
inline_formula , inline_formula - the distance "to the beginning" from the points fixing the horizontal signal;
inline_formula , inline_formula - distance from the horizontal axis to the points fixing the vertical signal in the column with the index inline_formula ;

Then start time inline_formula vertical signal: inline_formula (for each inline_formula of the amount we need to move away from the center inline_formula right, return, left, return), which is asymptotically inline_formula . Likewise, the time from the launch of a vertical signal to its height inline_formula : inline_formula . Define inline_formula circle radius like inline_formula that is, we have inline_formula . As we already understood, the time of formation of a point on inline_formula distance column inline_formula : inline_formula . This point lies on the circle of radius inline_formula (Pythagorean theorem), that is inline_formula but inline_formula so we got that inline_formula . And this means that all such (vertical fixing) points will be located approximately at the same distance from the center as the horizontal fixing points. Therefore, they will form a shape close to the circle.

Beautiful picture, clarifying the situation:

circle

Thanks to Arsen for the prototype sun!

Source: https://habr.com/ru/post/267219/


All Articles