Page 1 of 1

The Game of Life[Semi mathematical]

Posted: 2006-11-04 12:06pm
by Ace Pace
Just quote someone elses post on this...

Five years ago a little mathematical game triggered a curiosity, which has persisted ever since. It is called "The Game of Life," first made famous in the October 1970 issue of Scientific American. The brain child of mathemetician John Conway, The Game of Life gave rise to a field of study now called cellular automata.

Let me start by explaining the game. (If you're the impatient type visit the link below and then come back.) The game consists of a grid of cells. The cells can be black or white. A black cell is alive, a white cell is dead. We create a starting screen in which some of the cells are alive and some are dead. These are our initial conditions. Now we evolve the grid step by step. One step involves recalculating and redisplaying the status of every cell in the grid. During each step, some cells will die and some will be born. A set of very simple rules are used to determine whether a cell lives or dies:
any living cell with fewer than two neighbors dies of loneliness
any living cell with more than three neighbors dies from overcrowding
any living cell with two or three neighbors stays alive
any dead cell with exactly three living neighbors comes to life
That's it.

Now, what do you think will happen when we quickly evolve the grid step-by-step using a computer program? No doubt, many of you have seen the game and already know that "life" emerges from this simple scenario. Okay, not life as we know it, Jim, but something surprising.

At this point, you have to see it in action.

Here is a link where you can see what I'm talking about. Click the "Enjoy Life" button to run a java applet. You can experiment by creating your own initial conditions with your mouse or click the Open button to select some common initial conditions with cool behaviors. (If this link has disappeared because you are reading this article many moons after it was written, just search on 'the game of life'. It's all over the web.)

http://www.ibiblio.org/lifepatterns/

If you examined the standard initial conditions you saw how they could give rise to particularly interesting behaviors. Perhaps the most common creature to appear is called the glider, which hobbles its way across the screen and would go forever if it had enough screen and nothing got in its way.

What's interesting about the game of life is that we have no way of predicting from our basic set of rules above what kind of complex, self-organizing behaviors we could expect when we run the program. All of the observed patterns have been discovered rather than predicted in spite of the fact that this is a math problem for which we know all the rules. Even though the process is completely deterministic we have no theory for it. The best we can do is run a simulation and see what happens.

[Snip]

Further reading

Posted: 2006-11-04 12:20pm
by brianeyci
I don't get as much gliders as it says. I get "blinkers" more than gliders, and "eaters" and most of them are just useless and sit around.

Come to think of it... not too many "gliders" in real life and most people are lazy like me :P. Thumbs up.

Posted: 2006-11-04 12:22pm
by Surlethe
I wonder what would happen if you played Life on the surface of a torus instead of a square?

As for predicting the results, the game is purely algorithmic, so I suspect it's easier to simply model the initial condition and let it run than try to say, "Okay, given t_0, after the kth iteration, the condition will be X" without knowing what goes on in between.

Also, does anyone know if it's possible to create a non-repeating, non-terminating progression in the game?

Posted: 2006-11-04 12:28pm
by brianeyci
The non-terminating non-repeating process are the gliders as far as I can tell. Don't ask me how to model it mathematically though :P.

Posted: 2006-11-04 04:01pm
by Surlethe
brianeyci wrote:The non-terminating non-repeating process are the gliders as far as I can tell. Don't ask me how to model it mathematically though :P.
No, gliders repeat. It's like they're analogous to rational numbers: they may repeat after k iterations, but they still repeat.
Destructionator XIII wrote:That is an interesting enough question that you got me to crack open my text editor and compiler. I should be able to code that, somewhat easily, since the game is so simple.
I look forward to the results. I think we're going to code Conway's Life as one fo the last few labs in my CS 120 class this semester, and I may try to modify it to be a torus then, but I've really very little idea on how to approach the problem.

Posted: 2006-11-04 05:11pm
by Surlethe
Destructionator XIII wrote:So the code is pretty much dealing with a rectangle that wraps around at the edges, then it can be rendered either as this rectangle (since we are basically dealing with a surface area), or rendered in 3d by applying the same parametric equations again.
That's what prompted the question -- I was curious what would happen if some starting position were set loose on a rectangle which wraps around, instead of a (presumably infinite) plane. This also has the advantage of confining analysis to at most 2^mn starting positions (for an mxn rectangle).

Posted: 2006-11-04 05:43pm
by Jaepheth
I don't think you could have a non-repeating and non-terminating progression since there's a finite number of squares and hence a finite number of possible combinations on the board (albeit a large number of combinations)

Is the next board state computed all at once, or square by square?

It should be the former since order would affect the outcome if calculated square by square

Posted: 2006-11-04 09:55pm
by Surlethe
Jaepheth wrote:I don't think you could have a non-repeating and non-terminating progression since there's a finite number of squares and hence a finite number of possible combinations on the board (albeit a large number of combinations)
The thought experiment is ideal: what if you have an infinite board? Can you get a non-repeating and non-terminating progression then? I'm pretty sure you can code a Turing Machine into Conway's Life, and shouldn't that be able to do something like calculate the progression of pi (IIRC, there's an algorithm for the decimal progression)?

Posted: 2006-11-05 02:03am
by Psycho Smiley
I lost most of my links on the subject, but math departments have been playing with Life for the past 30+ years, and most of the things you guys are discussing have been done to death.

ETA: Here are some good links:
Golly: Uber-engine
Life Lexicon: bestiary/encyclopedia
Fucktons of interesting patterns, including the Unit Cell (see below
Turing Machine paper (PDF)
Mathematical enumeration of patterns
What lifeforms can exist v/s what has been constructed
In-depth FAQ
Articles on Life
More weird patterns
Turing machine: yes, it has been built.

Pseudo-infinite universes with sparse random distributions evolve more complex patterns. Self-replicators have been mathematically shown to exist and would theoretically evolve in a sufficiently large universe.

Toroidal-capable engines exist. They are used to model infinite universes. Insufficiently large universes lead to patterns choking on their own debris.

Engines that project forwards to time T use hash algorithms and are known as HashLife.

Patterns that run their own life simulations exist, even to the extent of each modelled cell simultaneously simulating n sub-cells.

Patterns that generate various irrational and transcendental numbers exist.

Prime generators exist.

There are patterns that travel at the highest possible speed (c, or 1 cell per cycle).

Patterns that oscillate or produce gliders or other spaceships above any mathematical minimum frequency are known to exist, as are spaceships that travel at any speed below c, in any arbitrary direction (although some are arbitrarily large)

Certain patterns can be made to travel indefinitely along constructed paths.

There are patterns that can "jump" another pattern ahead at apparent velocities exceeding c.

There are patterns that can non-destructively detect other patterns and transmit that information faster than the signal pattern.

There are patterns that can spread to fill the entire universe at the maximum sustainable density.

If you can think it, it has probably been mathematically proven or disproven, and usually only remains to be constructed. There are a few exceptions, though. For example, while an "unstoppable force" has been disproven, an "immovable object" or perfect "eater" is theoretically possible but unknown last I checked. However, all mathematically "interesting" work is being done with automated search and construction programs. Most work is now in writing better programs.

ETA: Here's an excerpt from Steven Levy's Hackers discussing the first computer implementation of life:
Steven Levy wrote: It was in 1970 that Bill Gosper began hacking LIFE. It was yet another system that was a world in itself, a world where behavior was "exceedingly rich, but not so rich as to be incomprehensible." It would obsess Bill Gosper for years.

LIFE was a game, a computer simulation developed by John Conway, a distinguished British mathematician. It was first described by Martin Gardner, in his "Mathematical Games" column in the October 1970 issue of Scientific American. The game consists of markers on a checkerboard-like field, each marker representing a "cell." The pattern of cells changes with each move in the game (called a "generation"), depending on a few simple rules cells die, are born, or survive to the next generation according to how many neighboring cells are in the vicinity. The principle is that isolated cells die of loneliness, and crowded cells die from overpopulation; favorable conditions will generate new cells and keep old ones alive. Gardner's column talked of the complexities made possible by this simple game and postulated some odd results that had not yet been achieved by Conway or his collaborators.

Gosper first saw the game when he came into the lab one day and found two hackers fooling around with it on the PDP-6. He watched for a while. His first reaction was to dismiss the exercise as not interesting. Then he watched the patterns take shape a while longer. Gosper had always appreciated how the specific bandwidth of the human eyeball could interpret patterns; he would often use weird algorithms to generate a display based on mathematical computations. What would appear to be random numbers on paper could be brought to life on a computer screen. A certain order could be discerned, an order that would change in an interesting way if you took the algorithm a few iterations further, or alternated the x and y patterns. It was soon clear to Gosper that LIFE presented these possibilities and more. He began working with a few AI workers to hack LIFE in an extremely serious way. He was to do almost nothing else for the next eighteen months.

The group's first effort was to try to find a configuration in the LIFE universe which was possible in theory but had not been discovered. Usually, no matter what pattern you began with, after a few generations it would peter out to nothing, or revert to one of a number of standard patterns named after the shape that the collection of cells formed. The patterns included the beehive, honey farm (four beehives), spaceship, powder keg, beacon, Latin cross, toad, pinwheel, and swastika. Sometimes, after a number of generations, patterns would alternate, flashing between one and the other: these were called oscillators, traffic lights, or pulsars. What Gosper and the hackers were seeking was called a glider gun. A glider was a pattern which would move across the screen, periodically reverting to the same pointed shape. If you ever created a LIFE pattern which actually spewed out gliders as it changed shape, you'd have a glider gun, and LIFE'S inventor, John Conway, offered fifty dollars to the first person who was able to create one.

The hackers would spend all night sitting at the PDP-6's high-quality "340" display (a special, high-speed monitor made by DEC), trying different patterns to see what they'd yield. They would log each "discovery" they made in this artificial universe in a large black sketchbook which Gosper dubbed the LIFE Scrap-book. They would stare at the screen as, generation by generation, the pattern would shift. Sometimes it looked like a worm snapping its tail between sudden reverses, as if it were alternating between itself and a mirror reflection. Other times, the screen would eventually darken as the cells died from aggregate overpopulation, then isolation. A pattern might end with the screen going blank. Other times things would stop with a stable "still life" pattern of one of the standards. Or things would look like they were winding down, and one little cell thrown off by a dying "colony" could reach another pattern and this newcomer could make it explode with activity. "Things could run off and do something incredibly random," Gosper would later recall of those fantastic first few weeks, "and we couldn't stop watching it. We'd just sit there, wondering if it was going to go on forever."

As they played, the world around them seemed connected in patterns of a LIFE simulation. They would often type in an arbitrary pattern such as the weaving in a piece of clothing, or a pattern one of them discerned in a picture or a book. Usually what it would do was not interesting. But sometimes they would detect unusual behavior in a small part of a large LIFE pattern. In that case they would try to isolate that part, as they did when they noticed a pattern that would be called "the shuttle," which would move a distance on the screen, then reverse itself. The shuttle left behind some cells in its path, which the hackers called "dribbles." The dribbles were "poison," because their presence would wreak havoc on otherwise stable LIFE populations.

Gosper wondered what might happen if two shuttles bounced off each other, and figured that there were between two and three hundred possibilities. He tried out each one, and eventually came across a pattern that actually threw off gliders. It would move across the screen like a jitterbugging whip, spewing off limp boomerangs of phosphor. It was a gorgeous sight. No wonder this was called LIFE the program created life itself. To Gosper, Con-way's simulation was a form of genetic creation, without the vile secretions and emotional complications associated with the Real World's version of making new life. Congratulations you've given birth to a glider gun!

Early the next morning Gosper made a point of printing out the coordinates of the pattern that resulted in the glider gun, and rushed down to the Western Union office to send a wire to Martin Gardner with the news. The hackers got the fifty dollars.

This by no means ended the LIFE craze on the ninth floor. Each night, Gosper and his friends would monopolize the 340 display running various LIFE patterns, a continual entertainment, exploration, and journey into alternate existence. Some did not share their fascination, notably Greenblatt. By the early seventies, Greenblatt had taken more of a leadership role in the lab. He seemed to care most about the things that had to be done, and after being the de facto caretaker of the ITS system he was actively trying to transform his vision of the hacker dream into a machine that would embody it. He had taken the first steps in his "chess machine," which responded with a quickness unheard of in most computers. He was also trying to make sure that the lab itself ran smoothly, so that hacking would progress and be continually interesting.

He was not charmed by LIFE. Specifically, he was unhappy that Gosper and the others were spending "unbelievable numbers of hours at the console staring at those soupy LIFE things" and monopolizing the single 340 terminal. Worst of all, he considered the program they were using as "clearly non-optimal." This was something the LIFE hackers readily admitted, but the LIFE case was the rare instance of hackers tolerating some inefficiency. They were so thrilled at the unfolding display of LIFE that they did not want to pause even for the few days it might take to hack up a better program. Greenblatt howled in protest "the heat level got to be moderately high," he later admitted and did not shut up until one of the LIFE hackers wrote a faster program, loaded with utilities that enabled you to go backward and forward for a specified number of generations, focus in on various parts of the screen, and do all sorts of other things to enhance exploration.

Greenblatt never got the idea. But to Gosper, LIFE was much more than your normal hack. He saw it as a way to "basically do science in a new universe where all the smart guys haven't already nixed you out two or three hundred years ago. It's your life story if you're a mathematician: every time you discover something neat, you discover that Gauss or Newton knew it in his crib. With LIFE you're the first guy there, and there's always fun stuff going on.

You can do everything from recursive function theory to animal husbandry. There's a community of people who are sharing these experiences with you. And there's the sense of connection between you and the environment. The idea of where's the boundary of a computer. Where does the computer leave off and the environment begin?"

Obviously, Gosper was hacking LIFE with near-religious intensity. The metaphors implicit in the simulation of populations, generations, birth, death, survival were becoming real to him. He began to wonder what the consequences would be if a giant supercomputer were dedicated to LIFE ... and imagined that eventually some improbable objects might be created from the pattern. The most persistent among them would survive against odds which Gosper, as a mathematician, knew were almost impossible. It would not be randomness which determined survival, but some sort of computer Darwinism. In this game which is a struggle against decay and oblivion, the survivors would be the "maximally persistent states of matter." Gosper thought that these LIFE forms would have contrived to exist they would actually have evolved into intelligent entities.

"Just as rocks wear down in a few billion years, but DNA hangs in there," he'd later explain. "This intelligent behavior would be just another one of those organizational phenomena like DNA which contrived to increase the probability of survival of some entity. So one tends to suspect, if one's not a creationist, that very very large LIFE configurations would eventually exhibit intelligent [characteristics]. Speculating what these things could know or could find out is very intriguing ... and perhaps has implications for our own existence."

Gosper was further stimulated by Ed Fredkin's theory that it is impossible to tell if the universe isn't a computer simulation, perhaps being run by some hacker in another dimension. Gosper came to speculate that in his imaginary ultimate LIFE machine, the intelligent entities which would form over billions of generations might also engage in those very same speculations. According to the way we understand our own physics, it is impossible to make a perfectly reliable computer. So when an inevitable bug occurred in that super-duper LIFE machine, the intelligent entities in the simulation would have suddenly been presented with a window to the metaphysics which determined their own existence. They would have a clue to how they were really implemented. In that case, Fredkin conjectured, the entities might accurately conclude that they were part of a giant simulation and might want to pray to their implementors by arranging themselves in recognizable patterns, asking in readable code for the implementors to give clues as to what they're like. Gosper recalls "being offended by that notion, completely unable to wrap my head around it for days, before I accepted it."