In biology there are patterns of life that grow infinitely and uncontrollably (such as tumors), other that die out immediately under certain conditions and some other that persists for only a finite number of steps. Interestingly, some cellular automaton rules exhibit the similar behaviour. This work explore such rules within the context of one-dimensional totalistic cellular automata, focusing of those that generate finite life when starting from a single cell active.
Introduction
Introduction
Cellular Automata (CA) are simple mathematical systems that evolve in discrete steps, where each cell in a grid updates its state based on a set of rules and the states of its neighbours. Despite their simplicity, they can produce surprisingly complex behaviour and have been widely studied in areas such as mathematics, physics, computer science, and biology.
Among the different types of behaviour that can emerge from cellular automata, one especially interesting case is that of finite lifeforms. These are patterns that, starting from a single active cell, grow for a certain number of steps before stopping completely. They don’t disappear instantly, but they also don’t expand forever. This behaviour can be compared to some biological processes that are active for a limited time, like certain types of cell growth.
This project explores totalistic cellular automata in one dimension — a class where the rules depend only on the total sum of neighbouring cell states. Through a series of filters and computational tools, we reduce the number of possible rules and identify which ones can generate finite lifeforms. We also analyse how these rules relate to each other by building graphs that connect similar behaviours.
Since testing all possible rules is computationally expensive, we also designed an algorithm that discovers new rules by applying small changes (mutations) to existing ones. This strategy helps to explore the space of rules more efficiently and understand the structure behind these finite lifeform patterns.
Theoretical framework
Theoretical framework
Definitions
Definitions
Cellular Automata
Cellular Automata
Cellular automata (CA) are defined as a collection of cells arranged in a regular grid, where each cell updates its value based on the interaction with its neighbors. Mathematically, a cellular automaton is described by a 4-tuple:
◼
L: The dimensional space. It defines the dimensionality of the grid of cells. This space is (theoretically) infinite.
◼
S: A finite set of possible states that each cell can assume within the assigned space.
◼
N: The neighborhood. It defines the relative positions of the cells that make up each cell’s neighborhood. The behavior of each cell depends on the states of its neighbors.
◼
f: The transition function, defined as . It determines the next state of each cell based on the states of its neighbors. This update occurs simultaneously for all cells at each discrete time step.
f:S
[N]
S
Elementary Cellular Automata
Elementary Cellular Automata
Elementary Cellular Automata (ECA) represent the simplest class of cellular automata. Their characteristics are as follows:
◼
L = 1: The cell are arranged in a one-dimensional consecutive infinite line.
◼
S = {0, 1}: Each cell can be in one of two possible states.
◼
N = {-1, 0, 1}: The neighborhood consists of the cell itself and its two immediate neighbors, one to the left and one to the right. This is also referred to as radius 1.
◼
The transition function depends on the states of three cells, and since each cell can be in one of two states, there are 8 possible neighborhood configurations. Each of these 8 configurations can map to either 0 or 1 as the next state, which gives us a total of 256 different elementary cellular automaton rules.
N
S
3
2
N
S
S
3
2
2
8
2
Each rule can be uniquely identified by the binary output assigned to the 8 neighborhood configurations. This binary number can be interpreted as a decimal value between 0 and 255. For example, the rule corresponding to the binary sequence is known as Rule 210, since .
11010010
210
10
11010010
2
Out[]=
ECA 210 |
The figure below illustrates this rule, where black squares represent state 1 and white squares represent state 0.
In[]:=
Labeled[ArrayPlot[CellularAutomaton[210,{{1},0},256],ColorRules->globalColorRules],Style[Text["Evolution of ECA 210"],12]]
Out[]=
Evolution of ECA 210 |
Totalistic Cellular Automata
Totalistic Cellular Automata
Totalistic Cellular Automata (TCA) are a type of cellular automaton in which the transition rules depend solely on the sum (or equivalently, the average) of the values of the cells in a neighborhood. Although TCAs can be described using standard cellular automaton formalisms, this formulation significantly reduces the number of possible rules.
This type of rule is used, for example, in Conway' s Game of Life .
The evolution of a one - dimensional totalistic cellular automaton is illustrated in the following figure.
Out[]=
TCA 20 |
The evolution of a one-dimensional cellular automaton is illustrated in the next figure.
Out[]=
Evolution of TCA 10 |
Finite lifeforms
Finite lifeforms
Starting from a single active cell, there are certain rules that produce patterns with finite lifespans, that is, their evolution is neither infinite nor does it die out immediately. These patterns persist for a limited number of time steps before becoming inactive.
The following example involves a system with three states, and its evolution is shown in the next figure.
Out[]=
Rule 5600111605818 (3 states) |
This behaviour can be also found in TCA. For example, the next figure shows the finite lifetime of the rule 357 (3 states) which lives exactly 87 steps.
Out[]=
Brute force search
Brute force search
The total number of TCA rules is given by the following formula:
rules
(2r+1)(k-1)+1
k
Where:
◼
k
◼
r is the neighborhood radius
This formula accounts for all possible totalistic transition functions.
Filtering totalistic rules
Filtering totalistic rules
The number of TCA rules increases exponentially with the number of states. For this reason, it is necessary to apply a series of filters to reduce the search space.
Spontaneous Life
Spontaneous Life
Rules that generate activity from an entirely inactive neighborhood (i.e., where the sum is zero) are considered to produce spontaneous life. These are discarded by checking if the transition function assigns a non-zero value to the lowest input sum (the last position in the rule vector).
Out[]=
Infinite Growth
Infinite Growth
The second filter considers the initial condition. If the output in the rule’s second position is the same as the initial cell’s state, the pattern will grow indefinitely. These rules are also excluded.
Spontaneous Death
Spontaneous Death
The third filter involves applying the CellularAutomaton function for a single time step to remove rules that cause the pattern to vanish immediately, i.e., those that lead to spontaneous death.
Configurations
Configurations
By applying the proposed filters, the number of TCA rules is significantly reduced, enough to allow a brute-force search for finite lifeforms. Unfortunately, brute-force methods are only feasible for rule sets below approximately 2 million entries. Beyond this threshold, the computational cost becomes inefficient.
The following table summarizes the total number of rules and the number of rules remaining after filtering, for different combinations of state count 𝑘 and neighborhood radius 𝑟:
Execution
Execution
The following iconized object contains all the different rules that produce finite lifeforms, grouped by the same resulting pattern. Each group is generated from all possible initial states (20 configurations in total).
The animations below display all the finite lifeforms corresponding to the first 6 configurations mentioned above. Generally, the smaller the finite lifeform, the greater the number of rules capable of producing that pattern.
Below are the best rules found across different configurations.
The longest finite lifeform discovered through brute-force search was of length 109,521, using parameters k = 3, r = 2.5, initial states of 2 and a grid of length 699.
The longest finite lifeform discovered through brute-force search was of length 109,521, using parameters k = 3, r = 2.5, initial states of 2 and a grid of length 699.
The 3D plot below displays all discovered rules under 700 steps for the same configuration.
◼
The height of each node represents the scaled length of the lifeform.
◼
Edges indicate that one rule can be transformed into another via a single mutation in the rule vector.
A common pattern observed across all graphs is that longer lifeforms tend to have fewer connections . This sparsity in connectivity makes random walks a poor strategy for discovering long finite lifeforms, as the probability of reaching high-scoring configurations becomes significantly lower.
The following graph shows that shorter lifeforms can be produced by a larger number of rules, while longer lifeforms are generated by fewer rules. This inverse relationship highlights how complex patterns are rarer and require more specific rule configurations.
Graph build and search
Graph build and search
The generated graphs for each configuration reveal that there are direct connections between all rules that produce finite lifeforms. However, since the total number of rules grows exponentially with the number of states and neighbourhood radius, it becomes computationally infeasible to exhaustively test all configurations, even after applying the filtering strategies.
For this reason, the following algorithm is designed to discover rule-to-rule relationships by starting from a random rule and iteratively applying mutations to its rule vector. This process builds a graph that captures the local structure of rule space, highlighting how small changes can lead from one finite lifeform-producing rule to another.
First, is necessary to define the configuration, those are the number of states, the radius of the neighbourhood, the initial cell and the number of unique finite lifeforms to search.
The following algorithm implements a breadth-first search strategy to explore the space of totalistic cellular automata (TCA) rules that produce finite lifeforms . The process starts from the null rule, which is guaranteed to mutate into a valid finite lifeform with a single change.
At each iteration:
◼
New connections (edges) are created between the current node and its neighboring nodes.
◼
The algorithm continues expanding until the specified depth (i.e., number of nodes visited) is reached.
This strategy avoids redundant pattern checks and reveals how small mutations lead to connected components of rules producing similar finite patterns.
Random mutations
Random mutations
We implemented the PoissonRandomWalkSearch function as a way to explore the space of cellular automaton rules starting from a null rule (rule 0). This algorithm performs a random walk over the rule space, guided by a Poisson distribution whose λ parameter increases in each iteration. The goal is to gradually increase the probability of selecting neighbors with better fitness, where fitness is measured by the lifetime of the cellular automaton (via TestCALifetime).
By focusing the search on rules with longer lifetimes, this method attempts to discover interesting or complex behavior within a limited number of steps . Each iteration explores single mutation neighbors of the current rule and selects the next rule based on a weighted probability, favoring rules with higher lifetimes as λ increases .
The function returned a sequence of cellular automata, each labeled with its lifetime. As expected, the system started from a simple rule and gradually evolved towards more stable or active configurations. This confirms that the increasing Poisson distribution successfully biases the selection process towards better-performing rules.
Test Algorithm
Test Algorithm
The below plots shows the sequence of the largest lifeforms generated by random mutations:
To increase the likelihood of discovering rules that produce longer-lasting lifeforms, it is recommended to use a λ increment smaller than 0.5. The following 3D plot shows the maximum lifetime achieved for each configuration. Although there are some instances where a larger increment led to good results, these cases are much less frequent and less probable overall.
Poisson Random Walk Search
Poisson Random Walk Search
The Poisson distribution provides a dynamic and tunable mechanism for balancing exploration and exploitation in the rule space, helping the algorithm discover increasingly complex or stable patterns without getting trapped in early suboptimal choices. The PoissonRandomWalkSearch function works as follows:
1
.Initialization: It begins with rule 0 and calculates its lifetime. This serves as the starting point of the search.
2
.Neighbor Generation: For each iteration, it generates all possible single-digit mutations of the current rule in base k. These mutated rules form the set of neighbors.
3
.Fitness Evaluation: It evaluates the lifetime of each neighbor using the TestCALifetime function and filters out any invalid or degenerate results.
4
.Poisson-Based Selection: It applies a Poisson distribution (with increasing λ) to assign weights to neighbors based on their lifetimes. These weights are used to compute selection probabilities, favoring higher-lifetime rules more as λ grows.
5
.Update and Record: The best rule found so far is updated whenever a new rule with a longer lifetime is discovered. That rule is stored using Sow, and λ is reduced temporarily to re-focus the search locally.
6
.Termination: The loop continues until λ exceeds 5. The function then returns the sequence of best configurations found throughout the run.
This method is an efficient and adaptive way to navigate the vast rule space of cellular automata using a biologically inspired probabilistic model.
Concluding Remarks
Concluding Remarks
This work explored the emergence of finite lifeforms in one-dimensional totalistic cellular automata, starting from a single active cell. By applying a series of logical filters, the number of rules to evaluate was drastically reduced, allowing a feasible brute-force search within small configurations.
Through this approach, a variety of finite patterns were discovered, and their distribution across the rule space was analyzed. The results showed that shorter lifeforms are more common and widely distributed, while longer lifeforms are rarer and more isolated in the rule space.
To better understand these relationships, we developed a graph-based exploration algorithm using a breadth-first strategy. This allowed us to group rules by behavior and reveal the connectivity between them through minimal mutations. The resulting graphs showed that rules producing similar finite lifeforms tend to form tightly connected clusters, while longer and more complex lifeforms appear at the periphery with fewer connections.
Overall, this methodology not only allowed the discovery of interesting finite patterns but also provided a framework to study the structure of the rule space, the robustness of lifeforms, and the evolutionary paths between different configurations.
Acknowledgments
Acknowledgments
I would like to express my deep gratitude to my mentor Willem Nielsen for his constant support and guidance throughout this project. His patience, clarity, and deep understanding of the subject were fundamental to my progress. I am also thankful to Alejandra Ortiz and Hugo Suárez, who assisted me with the code and helped me overcome technical and style challenges during the development.
Special thanks to Stephen Wolfram for suggesting the project direction and finally, I want to thank Professor Genaro Juárez for giving me the opportunity to attend the WSS and present this work.
Functions
Functions
References
References
1
.E. Weisstein (n.d.), “Cellular Automaton,” MathWorld – A Wolfram Web Resource. https://mathworld.wolfram.com/CellularAutomaton.html
2
.E. Weisstein (n.d.), “Totalistic Cellular Automaton,” MathWorld – A Wolfram Web Resource. https://mathworld.wolfram.com/TotalisticCellularAutomaton.html
3
.S. Wolfram (2024), “Why Does Biological Evolution Work? A Minimal Model for Biological Evolution and Other Adaptive Processes,” Stephen Wolfram Writings. https://writings.stephenwolfram.com/2024/05/why-does-biological-evolution-work-a-minimal-model-for-biological-evolution-and-other-adaptive-processes
4
.J. Hurtado et al. (2024), “Exploring Finite Lifeforms in Totalistic Cellular Automata,” Wolfram Community Post. https://community.wolfram.com/groups/-/m/t/3208800
Cite This Notebook
Cite This Notebook
Adaptative Evolution in Totalistic Cellular Automaton
by Erick Jesse Angeles Lopez
Wolfram Community, STAFF PICKS, July 9, 2025
https://community.wolfram.com/groups/-/m/t/3496929
by Erick Jesse Angeles Lopez
Wolfram Community, STAFF PICKS, July 9, 2025
https://community.wolfram.com/groups/-/m/t/3496929