# Cellular Automata/Mathematical Model

Formally, a cellular automaton is represented by the 4-tuple ${\displaystyle (Z,S,N,f)}$ where:

• ${\displaystyle Z}$ is the finite or infinite lattice
• ${\displaystyle S}$ is a finite set of cell states or values
• ${\displaystyle N}$ is the finite neighborhood
• ${\displaystyle f}$ is the local transition function defined by the transition table or the rule

The lattice is a finite or infinite discrete regular grid of cells on a finite number of dimensions. Each cell is defined by its discrete position (an integer number for each dimension) and by its discrete value (one of a finite set of integers). Time is also discrete. The future state of a cell (time ${\displaystyle t+1}$) is a function of the present state (time ${\displaystyle t-1}$) of a finite number of cells surrounding the observed cell called the neighborhood.

## One dimensional first order cellular automata

For the sake of readability the next definitions focus on one dimensional first order cellular automata.

### Lattice, cell and configuration

The infinite global state is a configuration ${\displaystyle C\in S^{Z}}$. ${\displaystyle S}$ is the finite set ${\displaystyle k=|S|<\infty }$ of cell states ${\displaystyle c\in S}$, for formalization purposes the states are enumerated ${\displaystyle S=\{0,1,\dots ,k-1\}}$. The lattice ${\displaystyle Z}$ is the infinite cyclic group of integers ${\displaystyle \{...,-1,0,1,2,...\}}$. The position of each cell inside the lattice is described by the position index ${\displaystyle x\in Z}$. Configurations are usually written as strings.

${\displaystyle C=\dots c_{-1}c_{0}c_{1}c_{2}\dots c_{x-1}c_{x}c_{x+1}\dots }$

The finite global state is a finite configuration ${\displaystyle C\in S^{Z}}$, where ${\displaystyle Z}$ is a finite lattice, a finite set ${\displaystyle \{0,1,2,...,N-1\}}$ of ${\displaystyle N}$ integers.

${\displaystyle C=c_{0}c_{1}\dots c_{x-1}c_{x}c_{x+1}\dots c_{N-2}c_{N-1}}$

Finite configurations and their parts can be generally written as strings denominated by small Greek letters from the beginning of the alphabet (${\displaystyle \alpha }$, ${\displaystyle \beta }$, ...).

#### The number notation for strings

Strings can be compactly written as numbers. A string of ${\displaystyle N}$ characters ${\displaystyle C}$ from a set of ${\displaystyle |S|}$ symbols is translated into a ${\displaystyle N}$-digit base ${\displaystyle |S|}$ number. Usually strings are indexed from the left to the right but for the number notation indexing from right to left is more intuitive.

${\displaystyle \alpha =\sum _{i=0}^{N-1}k^{N-1-i}c_{i}=k^{N-1}c_{0}+\cdots +k^{1}c_{N-2}+k^{0}c_{N-1}}$

### Neighborhood, local transition function and rule

The neighborhood size and position

#### Neighborhood

The neighborhood ${\displaystyle A}$ of size ${\displaystyle m=|A|}$ is defined by the set of relative positions inside the configuration.

${\displaystyle A=\{a_{0},a_{1},\dots ,a_{m-1}\}}$

By applying the set ${\displaystyle A}$ onto an observed cell ${\displaystyle c_{x}}$ the neighborhood of this cell is obtained.

${\displaystyle n_{x}=c_{x+a_{0}}c_{x-a_{1}}\dots c_{x+a_{m-1}}}$

The name neighborhood can be used for booth the set of relative distances and for the actual substring of cells related to an observed cell.

A compact representation of the neighborhood value ${\displaystyle n_{x}}$ is a single integer defined as a number of ${\displaystyle m}$ digits base ${\displaystyle k}$.

${\displaystyle n_{x}=\sum _{i=0}^{m-1}{k^{m-1-i}c_{x+a_{i}}}=c_{x+a_{0}}k^{m-1}+c_{x+a_{1}}k^{m-2}+\dots +c_{x+a_{m-1}}k^{0}}$
The neighborhood cell indexing and the local transition function

For definitions of common neighborhoods see Neighborhoods.

#### Local transition function

The local transition function

${\displaystyle f:S^{N}\mapsto S}$

calculates the value of a single future cell ${\displaystyle c_{x}}$ from the neighborhood of the observed cell in the present.

${\displaystyle c_{x}^{t+1}=f(n_{x}^{t})}$

The transition table defines the local transition function by listing the output value for each input value.

 n  -> f(n)
-----------
000 -> 0
001 -> 0
........
111 -> 0


The rule ${\displaystyle f}$ is a compact representation of the local transition function. It is a single integer defined as a number of ${\displaystyle m}$ digits base ${\displaystyle k}$.

${\displaystyle f=\sum _{i=1}^{k^{m}-1}{f(i)k^{i}}=f(k^{m}-1)k^{k^{m}-1}+\dots +f(1)k^{1}+f(0)k^{0}}$

### Global transition function

The global dynamics of CA are described by the global transition function

${\displaystyle F:S^{Z}\mapsto S^{Z}}$

${\displaystyle F}$ translates the current (present) configuration ${\displaystyle C^{t}}$ into the next (future) configuration ${\displaystyle C^{t+1}}$

${\displaystyle C^{t+1}=F\left(C^{t}\right)}$

The global transition function ${\displaystyle F}$ is defined by the local transition function ${\displaystyle f}$ as

${\displaystyle F(\dots c_{x-1}c_{x}c_{x+1}\dots )=\dots f(n_{x-1})f(n_{x})f(n_{x+1})\dots }$

### Finite lattices and lattice boundaries

The lattice boundary sizes (left and right)

Infinite cellular automata have no boundary, so its boundary description ${\displaystyle B}$ is omitted. But there is no way to simulate an infinite system using a finite system. The simulation must focus on a finite part of length ${\displaystyle l}$.

The neighborhood used in the local transition function oversteps the lattice boundary for ${\displaystyle r_{L}}$ cells at the left and ${\displaystyle r_{R}}$ cells at the right.

There are two common solutions to the overstepping problem:

1. the lattice is wrapped into a circle (torus for 2D CA)
2. the values of the overstepping parts of the neighborhood are defined explicitly as the boundary ${\displaystyle B}$

#### Cyclic boundaries

Cyclic boundaries are frequently used as there is no need to explicitly define the boundary value and no external information is introduced into the CA that could otherwise cause interference at the boundaries.

The state of a finite lattice cellular automata is a configuration in the lattice ${\displaystyle S^{Z}}$, where ${\displaystyle Z}$ is a cyclic group of integers modulo ${\displaystyle N}$ (${\displaystyle \{0,1,...,N-1\}}$).

${\displaystyle C=c_{0}c_{1}\dots c_{x-1}c_{i}c_{x+1}\dots c_{N-1}\qquad c\in S}$

The cyclic position index is calculated as

${\displaystyle x_{\circ }=x\mod N\qquad x\leq 0\vee x>N}$

#### Explicitly defined boundaries

The lattice boundary (left and right)

Explicitly defined boundaries are less common as the simple constant values are useful only for CA where we observe events on a quiescent background with period 1. The boundary can be defined as a single set (the left and the right part combined) of cell values of length ${\displaystyle k-1}$ (there is no boundary cell with index 0)

${\displaystyle B=\{b_{-k_{0}},\dots b_{-2},b_{-1},b_{l},b_{N+1},\dots ,b_{k-k_{0}-1}\}\quad b\in S}$

For space and time periodic quiescent backgrounds time dependent boundaries can be used ${\displaystyle B=B(t)}$.

## Generalizations

### Multidimensional cellular automata

Neighborhood in a 2D lattice

The definition of n-dimensional CA is similar to that of one dimensional CA, the lattice becomes n-dimensional and ${\displaystyle k}$ and ${\displaystyle k_{0}}$ become vectors of length ${\displaystyle n}$.

#### 2D cellular automata

The 2D lattice can be tiled with cells in different ways:

2D cellular automata are often used to simulate real dynamic systems (fluid and gas dynamics)

One further generalization of the concept of a CA extends the n-dimensional construct. Given a finitely generated group, ${\displaystyle G}$, and a alphabet, ${\displaystyle A}$, we may define the configuration space to be ${\displaystyle C=A^{G}}$. That is, each configuration is a map from ${\displaystyle G}$ into ${\displaystyle A}$. If ${\displaystyle G}$ is abelian, then the group is isomorphic to some quotient space of ${\displaystyle Z^{n}}$ and may be ragarded as a n-dimensional lattice with possibly periodic boundary conditions. This space admits a group action, where ${\displaystyle c^{g}(h)=c(g'h)}$ where ${\displaystyle g'}$ is the inverse of ${\displaystyle g}$. Any finitely generated group is a metric space, in which the distance between any two elements, ${\displaystyle d(g,h)}$ can be defined to be the minimum length of the set of paths connecting ${\displaystyle g}$ and ${\displaystyle h}$ on the groups Cayley graph. We define a metric on the configuration space, ${\displaystyle d(c,c')}$ to be 0 if the two configurations are identical, and the infimum of ${\displaystyle 1/(1+d(e,h))}$ over the set of ${\displaystyle h}$ such that ${\displaystyle c}$ and ${\displaystyle c'}$ disagree at ${\displaystyle h}$ and where ${\displaystyle e}$ denotes the identity element of the group. We define a cellular automata to be a continuous mapping, ${\displaystyle f:C\to C}$, that commutes with the group action and an initial configuration ${\displaystyle c_{0}}$. The evolution of the system is defined by ${\displaystyle c_{n+1}=f(c_{n})}$.
${\displaystyle c_{x}^{t+1}=f(n_{x}^{t},n_{x}^{t-1})}$