• Aucun résultat trouvé

Justin Milliun Judy Reardon Peter Smart W Ossipee Rd Silver Lake NH 03875

What can you do with you r computer?

After hearing about the game of Life, you may never ask the question again. Within the capabilities of a very m inimal system, Life gives the computer the kind of job it does best: an enormous amount of repetitive logical operations.

{

The authors' system demonstrates this point: it had 2 K memory and a video terminal at the time of this writing.

]

This leaves you, the user, free to apply your creative energy on this fascin­

ating game.

Developed by j ohn Horton Conway, a British mathematician at the University of Cambridge, Life was first described in the October 1 970 Scientific A merican by Martin Gardner in his "Mathematical Games" col u mn. I ts name comes from its resemblance to changing societies of living organisms which can grow, m ove and occasionally die out.

The Game of Life

An easy way to understand th is game is to imagine an i mmense gridwork or checker­

board. We cal l each square in the checker­

board a cel l, and the entire board a cell ular space. Each cell is identical and can perform a nu mber of specific fu nctions. We won't worry about the edge of the board: let's say the space is large enough so that we never know there is an edge. I n the game of Life, each cel l can sense its eight neighboring cel ls (as in figure 1 ). Each cel l in our space is in one of two states: it is either al ive, or not alive (quiescent). The cellular space changes with time; time advances over the

entire space at once, in steps. Each of these steps is called a generation.

The rules which determine the state of a given cell in the next generation are what give Life its delightful properties. They were chosen with great care by Conway, with reasons in mind that will be d iscussed later.

/

For mathematical background information see the book, I ntroduction to Artificial I ntell igence by Philip C

j

ackson, published in 7974 by Petrocelli-Charter. A discussion of cellular automata and pointers to several detailed references are found in chapter 8.}

Let us say there is a pattern of cells in the cellular space, some l iving, some not. The rules tell which presently l iving cells survive, which l iving cel ls d ie, and which cells that are not now alive will be l iving in the next generation. The rules are as foll ows:

Each cell presently al ive which has either two or three of its eight neigh­

boring cells al ive will be living in the next generation.

Each cell presently alive wh ich has other than exactly two or three l ive neighbors will not be alive in the next generation.

If a cell is presently not alive, and exactly three of its eight neighboring cells are alive, it will be l iving in the next generation.

The above ru les are applied all at once in the program for the game of Life. Every cel l i n the space i s checked, a s are its neighbors.

The fate of that cell in the next generation is then determined. Note that th is wi l l amount to many thousands o f checks i n each generation for a cellular space fil ling even a smal l video d isplay screen.

When the program has been loaded into the computer and you've entered the pattern, what can happen as the pattern evolves? There are a number of possibilities.

I 2 3

4 0 !I 6 7 8

Figure 7 : The center cell (0) has eight neighbors, as does every cell except those bordering the edges of the cellular space in any finite buffer in a computer program. Treating boun­

dary conditions for a finite Life buffer is a fine point of Life program design.

• 1e

• l e

2a

• •

1e • • ,.

2b

Figure 2: Examples of still life cell patterns, the block

{

a

)

and the beehive (b

)

.

December 1978 © BYTE Publications Inc 45

• • •

Generation 0

• •

Generation I

• • •

I

Genera tion 2

I .

• •

Genera tion 3

Figure 3: Four generations of the blinker pattern.

46 December 1978 © BYTE Publications Inc

Types of Patterns

The pattern may die, leavingyou with an empty display as you search your imagi­

nation for another possibility to try.

It may stop at what Conway calls a sti l l life. A simple example (figure 2 ) is the block, another the beeh ive. These patterns, when left undistu rbed, remain the same generation to generation (a little more inter-. esting than a blan k screen, perhaps) .

The pattern may develop a repeating cycle. The simplest of these is the blinker, which returns to its original self every other generation (see figu re 3). A more sophisti­

cated periodical ly repeating pattern has been described in the February 1 971 Scientific American. Discovered by G D Col lins J r, it is cal led th e tumbler (figure 4) . It has a period of 1 4 generations, but after seven it is an upside-down copy of the original pattern; hence its name. Watching the tumbler change, you will notice that in every generation there is a row of empty cells separati ng two mirror image patterns.

Each half helps keep the other half under control. If left to itself, half a tu mbler wi ll ru n over 1 00 generations before settling down .

There are patterns wh ich have most intrigu ing properties of motion. The gl ider shown in figure 5 is one such pattern. It is so named because the way that it moves is called gl ide reflection, or reflection from a diagonal line. I n four generations the gl ider produces a replica of itself, facing the same direction but d isplaced one square d ia­

gonal ly. After only two generations, it is a copy of itself pointing 90 " from its original orientation. There are actually just two unique patterns in the life h istory of the gl ider, but it takes four generations for the orientation to match that of the original pattern.

Another example of a moving pattern is the lightweigh t spacesh ip shown in figure 6.

This pattern also requires four generations to move and to complete a fu l l cycle; it also has only two unique patterns if we disregard their orientation. Note that th is pattern moves along a line of cel ls, as op­

posed to the gl ider's diagonal motion.

F i nally, patterns exist which continue indefinitely, forever evolving. ( I t was not certain that such infinite patterns should exist for some time after Life was de­

veloped.)

• •

I I I

• •

• •

I

• •

I

• •

I I

• •

• •

I I

• •

• • : • •

I

Figure 4: A n example of the tumbler, a periodically repeating pattern.

I nfinite Evolution a Possibility?

Conway selected the ru les of Life to meet the fol lowing considerations:

I t should not be obvious that an initial pattern wil l grow without limit.

(Conway specified that cel ls can die from overcrowdi ng.) .

It shou ld seem possible (but not obvious) that some patterns will grow without lim it.

Some in itial patterns should grow and change for a considerable period of time.

As reported in the original Scientific American series of articles, Conway conjec­

tured that there were no patterns wh ich wou ld actual l y grow without l imit. At that time he offered a $50 prize to the first person to prove or disprove his conjecture.

A short time afterwards a grou p from M IT disproved it by their discovery of a gl ider gu n. The gl ider gun produces a glider every 30 generations. Since the glider moves away from its birthplace, we may consider the glider gu n to be a special type of repeating pattern (see figure 7). The M IT group also discovered other remarkable events in Life by observing such th ings as col lisions be­

tween numerous gliders.

Symmetry

A rather curious p roperty in the evo­

lution of many patterns is their tendency to gain symmetry. As an example, let us begin with a pattern with only partial symmetry cal led the snowflake, shown in figure 8a. I n 1 5 generations i t becomes the pattern called

-

r--• • • •

• • • • •

Genera t ion 0 Genera t ion I Generation 0 Generation I

,

. !.

• • • •

l e I. t • •

Genera tion 2 Genera tion 3 Generation 2 Generat ion 3

• le

• :• le

Genera tion 4 Generation 4

Figure 5: Four generations of a glider pattern. Note that in generation 2, the glider is reflected and rotated 90 ·, moving down one space. In generation 4, the glider is again reflected, but rotated 90 in the opposite direc­

tion, as well as moved over one space.

Figure 6: This example of a lightweight spaceship pattern also has a 4 generation pattern cycle. Note that generation 2 is a go· rotation of generation 0 and is moved over one space. In generation 4, the spaceship returns to the orientation of generation 0, but has moved over two spaces.

the honey farm, shown in figure 8b. (Th is initial pattern used for producing a honey farm differs from the one discovered by Conway and his collaborators.) Within the brief history of th is pattern, it gains new symmetry it can never lose. Apparently, un less the pattern d ies out completely, symmetry can only be gained, never lost.

Another example of a pattern increasi ng its symmetry is given in figure 9. Again, beginning with only partial symmetry, it evolves into another known pattern, a beautifu l oscillating pattern cal led Pulsar CP 48-56-72. It reaches th is pattern in 26 generations during wh ich it gains its symmetry. (The i nitial pattern given here

is again an alternative path to the known pattern.) The oscil lating period of the Pulsar is three generations, and it provides a very interesting display.

The "Garden of Eden"

Up to now, the evolution of patterns has been considered, using some i n itial pattern.

Can this in itial pattern itself have u nusual properties? It has been proven that a so-cal led "Garden of Eden" pattern must exist for the game of Life. A "Garden of Eden" pattern is one wh ich cannot be produced by any other pattern. I n other words, no pattern ever becomes a "Garden

December 1 978 © BYTE Publications Inc 47

1-

l e l e l e 1e

-• •

I I

1e

•.•

-,.-• • • .�.�

l e le l e 1e l e l e l e 1e

le le 1e v

I /

t-I

1e e 1e

1e

le

• •

• • •

• •

• •

48 December 1978 © BYTE Publications Inc

!

• •

1e 1e

I

-1e

/

I I

r---t--

+

-.I--. I I :

_I

t--1-

-• I /

-I--

lL

li *

-I-·

�-·

I/

t- 1/

I 1 /1

I /

I

I /

'

+

t-I

-I I

---Figure 7: The glider gun is shown in mid-cycle with two generated gliders, the arrow indicating their direction .of travel. A more detailed description of this pattern is given in the February 7 977 Scientific American column by Martin Gardner, page 7 7 4.

of Eden" pattern. Such a pattern can only exist, therefore, as an initial pattern speci­

fied in generation zero.

It has been shown that a "Garden of Eden" pattern for Life can exist within a sq uare with 1 0 bill ion squares on each side, but possibly it could be much smaller .

Perhaps one way to find a "Garden of Eden" pattern is to apply some program­

ming skill, and al l your computer's spare time. You start with a pattern you devised or one your computer generated, randomly or otherwise. The computer could then attempt to find a pattern wh ich generates your pattern by trying out all the patterns possible in a l arger space than your pattern uses. If it did not succeed in generating your pattern, you wou ld have found a

"Garden of Eden" pattern. A lucky appli­

cation of this brute force technique may come up with the answer, but the going wil l b e very slow. Perhaps some clever shortcut could be developed.

A Warning

The game of Life is downright addictive because there is always another pattern that you'll want to try out in your search for attractive, unusual or unpredictable patterns . Examin ing properties of symmetry and motion, and looking for "Garden of Eden"

patterns and patterns l ike the glider gun wil l test your abil ity to predict fate in the game of Life.

The Program

A program for Life could be written in BAS I C or some other h igh level language, but it would be grossly inefficient, both in size and speed. First of all, only a single bit is requ ired to store each cell, but there is no simple way to manipu late individual bits in BAS I C. You wou ld therefore be forced to use one element of a floating point array for each cel l, and since a floating point number typically uses three bytes, you woul d only make use of one out of every 24 bits. That would mean for a 64 by 64 cellu lar array you wou ld need 1 2 K bytes.

(Actual ly, you wou ld need twice th is number since two copies of the cel lular array are needed in the simple Life program to be described.) The obvious way to reduce the size is to use every bit; a 64 by 64 cellu lar array woul d then require only 51 2