The Game of Life

[Different parts of this workshop are adapted from Shiffman et al (2012) and Beer (2004)]

In this part of the workshop we are going to move from a one-dimensional CA to a two-dimensional one. This will introduce some additional complexity; each cell will have a bigger neighborhood, but that will open up the door to a range of possible applications. After all, most of what we do in computer graphics lives in two dimensions, and this chapter will demonstrate how to apply CA thinking to what we draw in our Processing sketches.

The Game of life of stated the core principles behind complex systems: more than the sum of its parts, a complex system is a system of elements, operating in parallel, with short-range relationships that as a whole exhibit emergent behavior.

We will start expaining the rules of the Game of Life and defining some characteristic paterns that appear in it. We will learn how to create our own patterrns and play with them at the exercises.

Then, we will present an example of how cellular automatas as the Game of Life can be used to explore theoretical notions of biological systems like Maturana and Varela’s notion of autopoiesis. We will see how a simple model like the Game of Life can clarify some of the key ideas underlying autopoiesis and draw attention to some of the central open issues.

Finally, the parameter space of the Game is Life is studied, observing how life-like patterns only arise for a special range of parameters located in the edge between order and chaos.

1. Conway's Game of Life

We will build a system out of the simplest digital element possible, a single bit. This bit is going to be called a cell and its value (0 or 1) will be called its state. Working with such simple elements will help us understand more of the details behind how complex systems work. Its core principles are tied directly to simulate the natural world with code. The algorithm and its technical implementation will provide us with the inspiration and foundation to build simulations that exhibit the characteristics and behaviors of biological systems of reproduction.

Unlike von Neumann, who created an extraordinarily complex system of states and rules, Conway wanted to achieve a similar “lifelike” result with the simplest set of rules possible. Martin Gardner outlined Conway’s goals as follows:

  1. There should be no initial pattern for which there is a simple proof that the population can grow without limit.
  2. There should be initial patterns that apparently do grow without limit.*
  3. There should be simple initial patterns that grow and change for a considerable period of time before coming to an end in three possible ways: fading away completely (from overcrowding or becoming too sparse), settling into a stable configuration that remains unchanged thereafter, or entering an oscillating phase in which they repeat an endless cycle of two or more periods.


Martin Gardner, Scientific American 223 (October 1970): 120-123.

The above might sound a bit cryptic, but it essentially describes a Wolfram class 4 CA. The CA should be patterned but unpredictable over time, eventually settling into a uniform or oscillating state. In other words, it should have all those properties of a complex system

Instead of a line of cells, we now have a two-dimensional matrix of cells. The possible states are 0 or 1. Since we’re talking about “life," 0 means dead and 1 means alive. The cell’s neighborhood is the nine adjacent cells. The rules of life are:

  • Death. If a cell is alive (state = 1) it will die (state becomes 0) under the following circumstances.
    • Overpopulation: If the cell has four or more alive neighbors, it dies.
    • Loneliness: If the cell has one or fewer alive neighbors, it dies.
  • Birth. If a cell is dead (state = 0) it will come to life (state becomes 1) if it has exactly three alive neighbors (no more, no less).
  • Stasis. In all other cases, the cell state does not change. To be thorough, let’s describe those scenarios.
    • Staying Alive: If a cell is alive and has exactly two or three live neighbors, it stays alive.
    • Staying Dead: If a cell is dead and has anything other than three live neighbors, it stays dead.

Examples:

2. Patterns

In a cellular automaton, a pattern is any particular configuration of cells covering the infinite plane (or other backdrop) that the automaton operates on. A bounding box can be defined for any finite pattern, as the smallest rectangular area that contains all the live cells of a pattern. A simple description of a pattern is to enumerate the state of each cell within the bounding box.

Two patterns are considered the same, if they differ only by an isometry: a rotation, reflection or translation. For certain pattern types, other criteria may also be established: typically e.g. the phases of an oscillator are not considered different patterns entirely.

Still lifes

A still life is a pattern that does not change from one generation to the next, and thus is a parent of itself.

  • Block: Block is an extremely well-known and common still life that was found by John Conway in 1970.
  • Hat: Hat is a 9-bit still life that was discovered independently in 1971 by several Life enthusiasts

Oscillators

An oscillator is a pattern that is a predecessor of itself. That is, it is a pattern that repeats itself after a fixed number of generations (known as its period).

  • Blinker: The blinker is the smallest and most common oscillator. Found by John Conway in March 1970, it is the only known oscillator that is one cell thick.
  • Cross: Cross is a period 3 oscillator that was found in October 1989 by Robert Wainwright. It is the smallest in an infinite family of period 3 oscillators.

Spaceships

A spaceship is a finite pattern that reappears (without additions or losses) after a fixed number of generations displaced on space by a non-zero amount. That is, they move about the grid. It’s important to note that the cells themselves aren’t actually moving, although we see the appearance of motion in the result as the cells turn on and off.

  • Glider: The glider (or featherweight spaceship) is the smallest, most common, and first-discovered spaceship. It travels diagonally across the Life grid at a speed of c/4. Gliders are important because they are easily produced (for an example see the Gosper glider gun), can be collided with each other to form more complicated objects, and can be used to transmit information over long distances.
  • Dart: Dart is a c/3 orthogonal spaceship that was found by David Bell in May 1992. It is currently the smallest known bilaterally symmetric c/3 spaceship.

Guns

A gun is a stationary pattern that emits spaceships (or rakes) repeatedly forever. It’s important to note that the cells themselves aren’t actually moving, although we see the appearance of motion in the result as the cells turn on and off.

  • Gosper glider gun: The Gosper glider gun is the first known gun, and indeed the first known finite pattern with unbounded growth, found by Bill Gosper in November 1970. It consists of two shuttles stabilized by two blocks. The Gosper glider gun can be constructed with only 8 gliders, and it can be destroyed completely by 2 gliders.
  • Bi-gun: The bi-gun is a double-barreled glider gun that was found by Bill Gosper in the early 1970's. Much like his Gosper glider gun works by colliding two shuttles together, the bi-gun works by colliding two twin shuttles together. Dietrich Leithner discovered that it can be synthesised with 12 gliders.

How to Program the Game of Life

The objetive of this Workshop is not show all the details of how to program the Game of Life, but a step-by-step tutorial can be found in this chapter for Nature of Code (Shiffman et al, 2012)

2.1. Exercise

Next, we are going to create our own patterns. To do so, click on the OpenProcessing logo of the example below to open the webpage of the associated code. In that page, click the </> symbol to modify the code.

  • To create a new pattern, modify the variable "patternData" at the start of the code. It has an intuitive format, where the zeroes mean dead cells and the ones mean living cells.
  • To load a predefined pattern, go to (http://www.conwaylife.com/wiki/Category:Patterns) and choose one pattern of the collection. In the right bar, click in "Pattern files" to acces the raw codification of the pattern. The formats "Life 1.05" and "Plaintext" are very intuitive. You can easily adapt it to the code and run it, you just have to download the pattern as a .txt file, fork the sketch and upload the file (note that you must be logged in into openprocessing in order to fork sketches and upload files)

In [5]:
%%HTML
<iframe src="https://www.openprocessing.org/sketch/433158/embed/" width="630" height="378"></iframe>


3. Autopoiesis

When is a physical system alive? When is a physical system cognitive? This necessarily involves identifying and characterizing living systems as coherent spatiotemporal structures that are generated and maintained through the interactions among their physical constituents.

Roughly speaking, an autopoietic (literally, self-producing) system is a network of component-producing processes with the property that the interactions between the components generate the very same network of processes that produced them, as well as constituting it as a distinct entity in the space in which it exists. The paradigmatic example of autopoiesis is a cell, in which the components are molecules, the interactions are chemical reactions, and the cell membrane serves as a physical boundary that spatially localizes these reactions into an entity (or “unity”) distinguishable from its environment.

To many biologists, life is either a long list of phenomenological properties (e.g., the ability to reproduce and evolve) or a long list of physical components (e.g., DNA). Instead, Maturana and Varela offer a view of life as a specific organization of physical processes that has as its principal product the maintenance of its own organization: an organizational homeostasis.

The glider

Consider a glider, the simplest oscillatory structure that moves in the Game of life universe. A glider is a configuration of five ON cells that undergoes a sequence of transformations that ultimately leave the original glider displaced by one cell both horizontally and vertically. These transformations repeat every four cycles, so that, over time, a glider moves diagonally across the life universe. In short, a glider is a coherent localized pattern of spatiotemporal activity in the life universe that continuously reconstitutes itself.

Normally, the label “glider” refers to the distinctive pattern of five ON cells shown in Figure 1. However, this characterization seems incomplete from an autopoietic perspective. In order for these configurations of ON cells to undergo the sequence of transformations and renewal that we associate with a glider, they must be surrounded by a layer of OFF cells. This layer forms the environment necessary for the ON cells to undergo the required transitions, and the ON cells themselves participate in the production and maintenance of the OFF layer. In other words, the layer of OFF cells serves as a boundary necessary for the continued existence and propagation of a glider. The extent to which this boundary is analogous to the cell membrane of a living cell is an interesting open question.

Glider-Environment Interaction

The interaction between a unity and its environment takes the form of mutual structural perturbations. Since a glider can interact with its environment only through its boundary, these perturbations consist of cell state changes at the interface between the glider’s boundary and the part of the environment that immediately surrounds that boundary (cross-hatched regions in below figure). The glider’s internal state can likewise only influence its environment through the states of its OFF boundary cells. Indeed, because the cells on either side of this glider-environment interface have Moore neighborhoods that overlap both, their states are co-specified by both the glider and the environment.

Maturana and Varela distinguish two broad classes of outcomes that can result from an interaction between a unity and its environment. In a destructive interaction, the unity is unable to compensate for the structural changes induced by an environmental perturbation, and it disintegrates.

In contrast, in a nondestructive interaction, the unity’s organization is preserved, but its structure may be affected.

Identical environmental perturbations can affect a glider differently, depending on the state the glider is in when they occur. The converse is also true. Different perturbations can leave a unity in the same state, in which case that unity is incapable of making any distinction between them.

The Minds of Gliders

For Maturana and Varela, the ability of a unity to draw distinctions through its selective response to perturbations is the hallmark of the cognitive. Indeed, they refer to the domain of interactions in which a unity can engage without disintegration as its “cognitive domain.”

By virtue of the structural changes that a perturbation induces in a unity, the effect of a second perturbation can be different than it would otherwise have been.Thus, each perturbation that a unity experiences, as well as the structural changes that it undergoes even in the absence of perturbations, influences its sensitivity and response to subsequent perturbations.

As long as no interaction leads to a loss of identity, this state-dependent differential sensitivity to perturbations can continue indefinitely, with each perturbation orienting the unity to different possibilities for future interaction. By undergoing a succession of perturbations and corresponding structural changes, any unity that persists must necessarily exhibit a certain congruence or fit with its environment. Maturana and Varela have used the term “structural coupling” to denote this process by which the structural changes of a unity become coordinated with those of its environment. The notion of structural coupling serves to remind us that a unity-centric perspective of environmental perturbation is not the only one we can take. Structurally, we can also view the unity and its environment as a single dynamical system.

An especially interesting and important special case of structural coupling occurs when multiple unities share the same environment. Not only do such unities interact with their environment, they also serve as mutual sources of perturbation to one another. Indeed, to any particular unity, other unities literally are a part of their environment. Ongoing interactions between multiple unities can lead to structural coupling between them, so that the pathways they take through their respective interaction graphs become coordinated. Such a community of interacting unities can form what Maturana and Varela call a “consensual domain,” in which interactions serve to orient the other agents to similar possibilities for future action. It is this mutual orientation within shared domains that forms the basis of linguistic interactions, or “languaging”.

Most perturbations to gliders are destructive. Thus, their cognitive domains are extremely limited. Although this may reflect either the discrete nature of cellular automata or the reactivity of Conway’s update rules, I suspect that it is primarily due to the simplicity of gliders.

The Dynamics of Adaptive Behavior and Cognition

Embodiment and situatedness emphasize the roles played by an agent’s physical and contextual circumstances in the generation of its behavior. For a situated, embodied agent, taking appropriate action becomes the primary concern, and an agent’s biomechanics, the structure of its environment, and its social context become sources of both significant constraints on and resources for action. Dynamical approaches emphasize the way in which an agent’s behavior arises from the ongoing interaction between its brain, its body, and its environment.

A dynamical perspective on behavior and cognition follows directly from an autopoietic perspective on life when two key abstractions are made.

First, we focus on an agent’s behavioral dynamics. An agent’s behavior takes place within its cognitive domain, which is a highly structured subset of its total domain of interaction. A glider, for example, is instantiated in the states and arrangements of individual lattice cells in the life universe. However, the behavior of a glider, as opposed to its constituent lattice cells, is better described in terms of changes in position, orientation, phase, and so on, of the entire spatiotemporal pattern. Each nondestructive perturbation to a glider induces changes in these variables, as can the glider’s own dynamics. Thus, our first abstraction involves formulating a higher-level set of neural, somatic, and environmental state variables more directly related to an agent’s behavioral degrees of freedom, and then describing its behavioral dynamics in these terms.

Second, we abstract the set of destructive perturbations that an agent can undergo as a viability constraint on its behavioral dynamics. Since it is meaningful to study an agent’s behavior only so long as that agent actually exists, we largely take an agent’s autopoiesis for granted in behavioral and cognitive analyses. However, we must somehow represent in our behavioral description the limitations that autopoiesis imposes on an agent’s interactions, or we will have no way of deciding if a given behavior is adaptive or not. Thus, our second abstraction involves collapsing all perturbations that lead to a loss of identity into a single terminal state that serves as a viability constraint on the agent’s behavior.

There are many consequences of taking an embodied, situated, and dynamical perspective on adaptive behavior and cognition. Perception becomes a kind of perturbation to an agent’s dynamics. An agent’s internal state sets a context in which the effects of a given perturbation play out without necessarily playing any representational role. Behavior becomes a property of an entire coupled agent-environment system rather than being generated by any one component. The joint dynamics of multiple interacting agents leads to such structurally coupled phenomena as languaging, which involves the mutual orientation of agents in their respective cognitive domains to shared possibilities for future interaction. Learning can be understood as dynamics on multiple time scales. And so on.

3.1 Exercise

Now, we will practice some examples of the glider. To remark the autopoises of the glider, its surrounding cells, i.e. its membrane, it is red coloured when the glider is alive.

  • In the example below, select different initial configurations and watch how they affect the persistence of the glider.
  • Modify the code to create and play other settings.

In [4]:
%%HTML
<iframe src="https://www.openprocessing.org/sketch/433149/embed/" width="630" height="378"></iframe>


4. Life at the Edge of Chaos: parameter space of the Game of Life

As in the Elementary CA, life-like patterns in the game of life emerge for a restricted set of rules. From the dauntingly large number of possible rules, we have only observed the behaviour for a very special set of parameters. What makes this parameters special?

We can try to observe the behaviour of neighbouring sets of parameters, and we observe a peculiar phenomena. Making slight changes to one parameter generally drives the system either to chaotic and disordered behaviour, or to stable and boring configurations. This phenomena can be observed in a variety of systems showing complex patterns, and has led to the hypothesis that complex, life-like phenomena occur at a special region of the parameter space labeled as the "Edge of chaos".

The term Edge of chaos is used to denote a transition space between order and disorder that is hypothesized to exist within a wide variety of systems. This transition zone between the two regimes is known as the edge of chaos, a region of bounded instability that engenders a constant dynamic interplay between order and disorder. Some authors suggest that the organizations at the edge of chaos may be the characteristic target of selection for systems able to coordinate complex tasks and adapt.


4.1. Exercise

Now, we will play a grid of the game of life started with random living cells at a probability of 0.5, i.e. half of the cells will be alive and half dead at the start.

  • In the code, open the tab "GOL_orig" and look for rules (lines 50-52). Modify the reproduction rule and restart the example to watch the behaviour of the world. High values of the reproduction rule (i.e. 5) will collapse the world in a few generations while low values (i.e. 1) will produce an overpopulation.
  • Experiment with other changes on the overpopulation and underpopulation rules to analysis their influence on the viability of the system.

In [5]:
%%HTML
<iframe src="https://www.openprocessing.org/sketch/433075/embed/" width="800" height="410"></iframe>


4.2. Exercise

Finally, we have a world where we can modify the parameters in a continuous way.

  • Start the simulation and modify its speed to watch the transformations comfortably.
  • Modify the rules to observe the expresed viability and adjust them on the way to let the system live for longer periods. Look for rulesets that support a long viability.
  • Identify the most common patterns (e.g. gliders, blinkers, blocks) and devise their functions on the system (e.g. information transmitter).

In [1]:
%%HTML
<iframe src="https://www.openprocessing.org/sketch/431684/embed/" width="800" height="554"></iframe>


5. References