
This article is part 1 of a series of articles that aim to highlight the aesthetics that can be found in the computational world and data universes. It is as Walframe puts it an "abstract voyages in the computational world"[1]. Hence, I decided to start with a Cellular Automata model as it can tell us a lot about the nature of modeling and its inseparable relation to aesthetics. If you do not know what Cellular Automata means, do not worry, I will explain it in the first section of this article. All the code relevant to this article can be found on Github.
The concept of computation doesn’t in any way require the existence of a substance nor even a purpose. Instead, it is a construct built on top of arbitrary axioms which may or may not lead to coherent results. Hence, the human realization of such a construct has aesthetics in it. This realization could be by different means; however, for this article, in particular, we will discuss computational aesthetics in terms of visualization. In other words, we will try to point our microscopes away from the real world into the computational world. Similar to any investigation in natural sciences, the article will use three steps:
1- Methodology: Cellular Automata
2- Experiment: Evolutionary Games and Spatial Chaos Model
3-Results: Aesthetics and meaning

Cellular Automata
The main motivation behind Cellular Automata (CA) is to try to depict the way nature performs computational operations. For example, a multi-cellular organism starts as one cell. These cells grow and differentiate according to an algorithm stored in the DNA. The communication between the cells happens through a complex signaling process that is yet to be fully discovered. Hence, CA tried to model these concepts into the numerical world. CA aims to be able to compress complex information as a growing and responsive object similar to biological organisms.
How does CA translate biology into Computer Science?
A cellular automaton is a continuous state of a set of cells (elements of a grid) starting from a seed that can be either a single cell or several cells. A set of cells at time "t+1" is an update of the set at "t" according to an update "rule". The update rule involves calculations that depend on neighboring cells. There are three standard definitions of a neighbor cell.

According to each different type of neighborhood, a varied selection of cells (colored grey) contributes to the update of a specific cell (colored black). Thus, the state or values a cell holds directly affects the other cells. Hence, a cellular automaton evolves as a continuous entity. The influence of neighbors on a cell differs according to the type of grid. The best way to illustrate this is by considering a 1-dimensional grid. In the animation below, all the cells occupy one line. Each cell can only have a value of 0 or 1.

Therefore, The rule determines how one generation changes to the next generation with respect to its neighbors. The cases numbered from 0 to 7 represent the different situations that can exist in this 1-D grid. For example, case 2 indicates that if a cell (the center block is the current cell) is currently 1 and has two 0-neighbors, then it will remain 1 (the outcome is shown as the bottom block). There are 256 different combinations since each of the 8 cases can be either 0 or 1. Hence, for a 1-dimensional binary cellular automaton, there can be 256 different rules that will govern the evolution of a system. These systems are generally referred to as Elementary Cellular Automata (ECA)[2]. Despite their simplicity, some rules produce intricate patterns over several generations, such as Rule 30, Rule 90, Rule 110, and Rule 184.

To learn more about CA, I strongly advise you to read the Cellular Automata section of "Neural Cellular Automata For Art Recreation"[3].
Experiment
The experimental setup in play will be built on top of the prisoner dilemma.
The Prisoner’s dilemma
The Prisoner’s dilemma has received a lot of attention since the being of the concept of modeling of Game of Life. This is partially due to its simplicity as a model but also due to the paradox it leads to.

In the original and simple version of the model, the prisoner dilemma shows that two rational people may not cooperate even when the output is more beneficial for both parties. The model proves that the system moves toward the (5|5: 5 years, by 5 years for both parties). This seemingly counterintuitive conclusion is referred to as the "prisoner’s dilemma" (Flood 1950) [4]. Hence, it highlighted the importance of modeling such concepts in terms of Game Theory.
However, this model is static. It does not depict the continuity in real life. In other words, the decision is made at one step and does not evolve in action. Therefore, the importance of a continued reformation of the model is apparent, due to the fact the in reality the history of an individual’s decisions impacts their future chances. Continues formations of game theory models are referred to as Evolutionary Game Theory. Such models can explain the evolution of altruism, and other concepts making them a field with increasing importance for various disciplines.
The reformulation of the Prisoner’s Dilemma in terms of Evolutionary Game Theory is presented in Nowak’s works (Nowak 1991)[5]. This work will be discussed, recreated, and examined in this article.
Evolutionary Game Theory
The models presented in this article (Nowak model) is a two-dimensional, time-continuous, "deterministic" version of the simple Prisoner’s Dilemma presented earlier. The model considered a system where Moore-neighborhood (figure 7a) interactions and an accumulative history for each grid. Hence, each grid presents one player (Player A in green) interacting with another grid (Player B in red). Thus, at each time step, player A makes 8 decisions while interacting with all the neighboring grids. The same player copies the best strategy within the Moore-neighborhood. These strategies can be one of two types, either complying (C ) or defecting (D). These definitions make this model more dynamic than tit-for-tat models. Furthermore, periodic boundary conditions (figure 7b) are imposed. Hence, players at boundaries do not experience a discontinuity in the number of their neighbors which leads to a more coherent model.

Hence, at each time step Player A (green grid) will look at the score of each of the 8 red grids (other players) and will memic the same attitude of the highest-scoring player in the neighborhood. The possible outcome interactions from these interactions will lead to score transfer which can be summarized as the following:

· R: is the value returned or paid when both players C: Both players have a good attitude
· T: One defects while the other Complies, first earns T>S: One player deceives the other player
· S: One defects while the other Complies second earns S<T: One player deceives the other player even though the player played fairly in a previous time-step
· P: Both players defect and earn P: Both players do not play fairly and both of them try to deceive the other

The change of player’s behavior is color-coded according to the chart to the left. This will help us understand the overall ethical behavior of the testing environment. Hence, this is the matrix of decisions that will lead to a payoff. The payoff is then added to the player’s score in the Score matrix.
This gives us control over the experimental environment, for example, if the player chooses to defect, the player will be rewarded a score of S. If this score is high, we expect to see the players try and deceive other players more frequently. However, if this score is low, we expect the players to choose to comply as there is no incentive to defect.
The strategy that guides the player’s decision is also dynamic and stored in a matrix. After the current states are calculated. Each player looks at their neighborhood and sees which cell has the highest score. They adapt their strategy. The adopted strategy will then guide the player at step (n+1).
In this experiment, we will set up an environment that consists of 1000 players each presented in a grid. We will fix the scores as 1 while R will be set to vary between 1.5 to 2. In other words, if the player could successfully deceive another player, the player will be rewarded 50%-100% more than a more ethical player.
Experiment:
We will set 10% of the player in defecting mode placed at random as shown in Figure 8

Now we can set different rewards for defecting and observe how the overall population evolves

We can see that more players decide to defect as deceiving other players gives more incentive (77% more gain). However, the overall players still choose to comply with C as it is still more beneficial for the long term gain.

However, this is not always the case. As shown in Figure 10, when there is enough incentive to break the social contract, most of the players decide to defect to other players. Hence, the majority of the players become colored red and we see some smaller communities of players who decided to stay ethical. The small groups swim through the experimental setup and do not reach a stable point.
Results
Nowak’s model is part of many initiatives that aim to model human behavior from an evolutionary point of view in hopes to understand one day the evolution of moral values. Hence, these models serve as toy models for evolutionary-behavior theorists.
However, aside from their scientific incentives, these models generate very interesting patterns. They both reflect the social interactions between the players and present aesthetically-pleasing visualizations.

Even simple models can create such complex and intriguing patterns that prove that computation has hidden aesthetics that can be discovered if we widen our perspective. You can expand the experiment by using the code to generate your pattern. The code can be found on Github.

Thank you for reading, and stay tuned for future experiments!
References:
[1]: Q&A with Wolfram, April 9, 2005, From Interview by Andres Hax, Clarín
[2]: Weisstein, Eric W, Elementary Cellular Automaton, From MathWorld – A Wolfram Web Resource.
[3]: Naji, Mayssam. "Neural Cellular Automata For Art Recreation." Medium, Towards Data Science, 19 Aug. 2020, link
[4]: Flood M. Merrill. Prisoner’s Dilemma: Game Theory. Framing Device, Experimental Economics.
[5]: Nowak, Martin & May, Robert. (1992). Evolutionary Games and Spatial Chaos. Nature. 359. 826–829. 10.1038/359826a0