CA’FOSCARI HARVARD SUMMER SCHOOL 2014 LORENZO SCHIRATO INTRODUCTION TO COMPLEXITY MATR. 847547 PROF. PAOLO PELLIZZARI JULY 9 2014 ASSIGNMENT 3 GAME OF LIFE INTRODUCTION As we can appreciate, the words “Complexity” and “Complex Systems” define a very large domain of ides, theories, models and knowledge in general. With this essay, we are going to recap some general ideas of complexity and analyze a specific and famous model known as The Game of Life. After a general description of the wider family of models called Cellular Automata (The Game of Life comes from this wider context), we will first describe the model and then discuss some experimental results. The general aim of this section is to show how complexity may arise from extremely simple conditions. In the final part of the essay, we will propose some general consideration on why this model offers some useful insights and applications in the real world. CELLULAR AUTOMATA As we discussed in class, a complex systems is characterized by a set of elements interacting together without a central controller that coordinates their actions. Another important feature of these systems is the emergence and evolution of some specific patterns caused by the continuous interaction among the parts. The Cellular Automata models (CA) meet all these specific features. A Cellular Automaton consists in a defined grid of cells that can assume a finite number of states (generally on or off). Each cell in the grid is surrounded by other cells with the same characteristics (they can be either on or off in a specific time). The models develop by steps: at time t some cells are on and other are off, at time t+1 each cell can be either on or off according to a specific rule. This rule defines the cell’s future state (t+1) according to the features of the cell’s neighborhood at the previous state (t). The process than goes on following the same rule which can lead the system to complex, chaotic, periodic and stable states. We may add that these models can be onedimensional, bi-dimensional or three-dimensional and has been widely used in computer science and cryptography from the 60s onwards. 1 Here are some examples: Even if we are not going to cover in a specific way all these models, it is important to underline some of their features. In CA we find: a collection of simple interacting objects (the cells), a process of interaction (each cell will be on or off according to its neighbors), the absence of a central controller, emerging patterns and a self-organizing behavior. GAME OF LIFE The Game of Life or Life (the name comes from some similarities with life dynamics themselves) is probably the most famous CA model. It was developed by the Cambridge mathematician John Conway and became extremely popular once it was mentioned on a Scientific American article in 1970. The secret of its popularity probably lies in its apparent simplicity: as other CA, the game of life is based on a narrow set of simple rules that define the evolution of the system. Nonetheless we realize eventually that these simple rules can generate very complex and, sometimes, chaotic patterns that seem to have no visible relationship with the initial simple pattern. The game is a so-called zero-player game, which means its evolution is determined just by the first state: the system will evolve independently according to the rues specified at the beginning. The game takes place in a two dimensional grid of square cells of the same size. Each cell has eight similar cells around it (also referred as the neighborhood). Every square of the grid can be either alive or dead (less dramatically: on or off). The Game of Life starts (at time t) with a specific arrangement of alive and dead cells and evolves by steps. At time t+1 each cell may stay on or off or switch its state, getting off or on. This passage develops according to four simple rules: 1) Any live cell with less than two live cells in its neighborhood dies in the next period because of loneliness (more formally: because of overpopulation) 2) Any live cell with two or three live neighbors stays alive in the next period 3) Any live cell with more than three live cells in its neighborhood dies in the next period because of too much crowding (i.e. overpopulation) 4) Any dead cell with exactly three live cells in its neighborhood becomes a live cell in the next period. 2 The first pattern (usually referred as the seed of the game) can be defined by the user or randomly generated. The following pattern (i.e. at t+1) is created applying the rules to each cell simultaneously. With the same procedure the systems evolves from period t+1 to period t+2 and so on. At this point, we may ask ourselves why Conway specified this exact set of rules. The answer is that the mathematician created them after a considerable period of experimentation in order to make them respect the following criteria (Conway, private communication to the 'Life list', 14 April 1999): 1) There should be no explosive growth. 2) There should exist small initial patterns with chaotic, unpredictable outcomes. 3) There should be potential for Von Neumann universal constructors. 4) The rules should be as simple as possible, whilst adhering to the above constraints. EXAMPLE Once the structure and the rules has ben described, we present a short example of the game in order to better visualize how the process develops. After this short demonstration, we are going to analyze some famous patterns that made the game famous. In this example we consider an initial seed with four on cells (C,E,H,M) and 12 off cells (note: try to imagine the grid filled with dead cells beyond the limit of the picture). Every cell’s state depends on the state of its neighborhood (e.g.: F’s neighborhood is made of A,B,C,G,M,L,I and E). What we want to show here is the way rules define the following state (1). From 0 to 1: According to rule 1, cells E,M and C will die in the next state (1) because there are less than two alive cells in their neighborhood. The only cell that will survive at period 1 will be H since C and M are its only neighbors (see rule 2). Finally, we expect that cells F and G, at period 0 off, will become on next period according rule 4. From 1 to 2: In the current state the only alive cells are F,G and H. If we apply rule 1 we notice that F and H will become off in the next period because of the lack of a sufficient number of neighbors. G instead will remain on since F and H are now on. The last passage is to decide whether some off cells will get on in period 2: M and C have three on neighbors therefore they will get on in the next step. 3 From 2 to 3: In the next period we should expect: C and M to become off (rule 1), G to stay on (rule 2) and F and H to become on (rule 4). From 3 on: we realize that the pattern at period 3 is exactly the same at period 1: applying the same set of rules we can predict that the patterns 1 and 2 will repeat themselves periodically. What we discovered here is an example of an oscillator, a pattern that repeats itself over time. SPECIAL PATTERNS One can obtain many different outcomes playing the Game of Life that range from still life objects to seemingly chaotic patterns. In this paragraph, we are going to present some of them. STILL LIFE OBJECTS Still life patterns, as the names says, do not evolve over time. The rules of the game do not cause any change as time passes. Some examples (pictured here from left to right) of these patterns are the block, beehive the loaf and the boat. OSCILLATORS In the first example we made, what we discovered was an oscillating pattern of period 2 that goes under the name of Blinker. Other interesting Oscillators are the Toad (period 2), the Beacon (period 2) and the Pulsar (period 3) whose evolutions are shown (from left to right) below. 4 SPACESHIPS This type of patterns resembles the oscillators but are much more interesting: as the same scheme of on and off cells repeats itself periodically, the object moves around the grid too: here are some examples: OTHER SPECIAL PATTERNS Until this point, we have been seeing interesting but not exactly complex patterns. With the following examples, we want to show how simple patterns can create very complex behavior in this system. The seed that we are going to use are often referred as Methuselah (from the biblical character) because of the large number of generation needed to reach a stable state. R-PENTONIMO This seed is probably the most representative pattern of the Game of Life. It starts with just five cells on and takes 1103 generations to stabilize reaching a number of alive cells equal to 116 (description taken from: http://www.conwaylife.com/wiki/R-pentomino). Its behavior is a clear example of how a simple initial 5 pattern can actively create complex emerging structures. Here below is reported how it develops considering some of its generations. ACORN This seed is similar to the previous: it starts with seven alive and it takes 5206 generations to stabilize (description taken from: http://www.conwaylife.com/wiki/Acorn). 6 There are many other famous patterns worth analyzing (shown below). The important message we can formulate after this brief analysis is that a system like this does not need difficult rules or complicated initial seeds to generate amazing complex patterns. APPLICATIONS The Game of Life model is with no doubt very interesting. However, are there any significant applications? Since Life has been developed inside the wider field of computer science, the first significant applications of the model are used in cryptographic software, in the analysis of computer viruses and in pseudo random number generators. The Game of Life can also be used to create the so-called Turing Machines (A Turing machine is a hypothetical device that manipulates symbols on a strip of tape according to a table of rules from: http://en.wikipedia.org/wiki/Turing_machine) which are particularly interesting when it comes to discuss computer algorithms and the functioning of a CPU. One may believe that, by its nature, this system can be used only within computer science without any possible extension to the real world. Fortunately, it is not true: If we try to look at the system with a flexible point of view, considering its essence (that few rules can generate complex behavior for example), we will soon realize that Life can be used to explain an uncountable number of situations. The Game of Life could be a good tool to explain traffic patterns or to study new robots to be used in space exploration (think about robots that can make decision starting from a limited amount of inputs and following few simple rules). An important field of application is biology too: organisms’ cells may behave according to a small number of simple rules (not yet discovered) and the state of their neighbors. In addition, the brain’s activity (think about a set of simple cells as neurons interacting together with few specific signals), consciousness and life itself are a good target for this game (even if not in a comprehensive way). We should not forget that the inventor of CA John Von Neumann himself developed the Cellular Automata model hoping to find a system that could autonomously reproduce itself as cells do. 7 If we move to the wider set of CA models we may also notice that such computational tools can explain biological facts as patterns of some seashells (Conus and Cymbiola for example). The theory behind them can be extremely useful in branches of sciences as Artificial Intelligence, physics and many other disciplines too (see Wolfram's A New Kind of Science). If we stick to theory, we may say that CA and Game of Life could be applied probably everywhere in science. This could be true but, in reality, such models are difficult to be implemented. The main reasons are two: first, the link between the theoretical model and reality is often difficult to spot, much more difficult to prove; second, CA and Life require a lot of computational power to be fully understood. In order to find interesting and possibly self-organizing, “living” patterns, an incredible number of long simulations have to be carried out (and probably the most interesting results may be found in complex 3D CA models that require a lot of computing power to simulate). The point is that, at the present date, we do not have the tools to analyze the topic any further (maybe with the new generation of quantum processors and cloud computing the task will become easier, that is what we hope for). We are then forced to discuss mere theories with no consistent proof behind. The topic remains fascinating though, showing an interesting and substantially easier way to approach apparently difficult problems. CONCLUSION The study of complexity represents a relatively new way to approach wide range of disciplines: from computer science to biology, physics, social sciences and so on. From a popular point of view, the word “complexity” usually evokes ideas as chaos, the functioning of entire societies, the stock market, epidemics and so on. What we notice in our daily experiences is that complexity is commonly related to the cognitive difficulty to understand it or the feeling “I’m not a genius, I’ll never get it”. The point that we want to show is that we do not need complicated and tortuous setups or a Ph.D. in Mathematics to generate and appreciate the essence of a complex system. The Game of Life is a clear demonstration that complexity may arise from the simplest situation. We have clearly seen that starting from a simple environment (the grid of cells) and a small set of straightforward rules we can get amazing complex patterns. The previously discussed example of R-Pentomino is probably the most significant representation of this idea: starting from a simple input (just five alive cells) complex and long lasting patterns are generated. The Game of Life may just appear as a theoretical model but the potential of the insights we get from it is huge. The underlying idea that every dynamics in our universe may be a manifestation of extremely simple rules offers a new and unprecedented way to approach many disciplines of science. Discipline as robotics, biology, evolutionary science and physics may be partly reinterpreted using these models. The fact that the link between this theory and reality is difficult to prove may have lead this model to be underestimated. Nonetheless, its core intuition remains powerful and we believe that in future, possibly with better computational tools, models like Life may give us new interesting intuitions about our world. 8 ASSIGNMENT PART B: MULTIPLE CHOICE QUESTION In the El Farol Bar model: The system, in the long run, will reach a stable state. In the long run the average attendance to the bar will be below 60 agents. The variance of the outcomes decreases as agents use a lot of different rules to choose whether to go or not to the bar. We can always find a single best strategy to use at every period. 9