Cellular Automata/Mathematical Model
Formally, a cellular automaton is represented by the 4-tuple where:
- is the finite or infinite lattice
- is a finite set of cell states or values
- is the finite neighborhood
- is the local transition function defined by the transition table or the rule
The lattice is a finite or infinite discrete regular grid of finite number of dimensions, filled with cells. Each cell is defined by it's discrete position (an integer number) and by it's discrete value (one of a finite set of integers). Time is also discrete. The future state of a cell (time ) is a function of the present state (time ) of a finite number of cells 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 . is the finite set of cell states , for formalization purposes the states are enumerated . is the lattice, the infinite cyclic group of integers . The position of each cell inside the lattice is described by the position index . Configurations are usually written as strings.
The finite global state is a finite configuration , where is a finite lattice, a finite set of integers.
Configurations and their parts can be generally written as strings denominated by small greek letters from the beginning of the alphabet. Strings can be compactly written as numbers. Forward Converter
Neighborhood, local transition function and rule

The cells in the neighborhood of the cell have indexes , where are values from the set of neighbors . and are neighborhood sizes to the left and to the right since usually the neighborhood is symmetric a single radius can be used. The size of the neighborhood is .
A compact representation of the neighborhood value is a single integer defined as a number of digits base .

The local transition function
calculates the value of a single future cell from the neighborhood of the observed cell in the present.
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 is a compact representation of the local transition function. It is a single integer defined as a number of digits base .
- See also
- Cellular Automata/Neighborhood for some frequently used neighborhoods
- Cellular Automata/Rule for some special rules
Global transition function
The global dynamics of CA are described by the global transition function
translates the current (present) configuration into the next (future) configuration
The global transition function is defined by the local transition function as
Finite lattices and lattice boundaries

Infinite cellular automata have no boundary, so it's boundary description 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 .
The neighborhood used in the local transition function oversteps the lattice boundary for cells at the left and cells at the right.
There are two common solutions to the overstepping problem:
- the lattice is wrapped into a circle (torus for 2D CA)
- the values of the overstepping parts of the neighborhood are defined explicitly as the boundary
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 , where is a cyclic group of integers modulo ().
The cyclic position index is calculated as
Explicitly defined boundaries

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 (there is no boundary cell with index 0)
For space and time periodic quiescent backgrounds time dependent boundaries can be used .
Generalizations
Multidimensional cellular automata

The definition of n-dimensional CA is similar to that of one dimensional CA, the lattice becomes n-dimensional and and become vectors of length .
2D cellular automata
The 2D lattice can be tiled with cells in different ways:
- square grid (4-fold rotational symmetry)
- triangular grid (3-fold symmetry) or hexagonal grid (6-fold symmetry)
- quasi periodic grid (Penrose tiling)
2D cellular automata are often used to simulate real dynamic systems (fluid and gas dynamics)
- See also
- Cellular Automata/Neighborhood for some frequently used neighborhoods
Higher order cellular automata
The CA is of higher order if not only the present but past configurations too are used to calculate the future. A second order local transition function is defined as
Second order local transition functions are often used to construct reversible rules.