Population Dynamics in Conway’s Game of Life and its Variants

30
Population Dynamics in Conway’s Game of Life and its Variants David Hua and Yoni Biel

description

The presentation for the project of high school students Yonatan Biel and David Hua made in the Students and Teachers As Research Scientists (STARS) program at the Missouri Estimation of Distribution Algorithms Laboratory (MEDAL). To see animations, please download the powerpoint presentation.

Transcript of Population Dynamics in Conway’s Game of Life and its Variants

Page 1: Population Dynamics in Conway’s Game of Life and its Variants

Population Dynamics in Conway’s Game of Life and its Variants

David Hua and Yoni Biel

Page 2: Population Dynamics in Conway’s Game of Life and its Variants

Background and Motivation

Cellular automata (CA) as computational models Can simulate any algorithm (computation). Useful in computational theory, biology, physics,

mathematics, artificial intelligence. Used to study emergence of complex behavior, self-

organization, self-replication, and other aspects. Conway’s game of life is one of simplest yet powerful CA.

The purpose of this project Study Conway’s game of life and its variants. Focus on population dynamics in terms of the rule set

used and initialization of the simulation. Learned programming in C++.

Page 3: Population Dynamics in Conway’s Game of Life and its Variants

Outline

1. Cellular automata.

2. Conway’s game of life and its variants.

3. Population dynamics of studied CA variants.

4. Summary, conclusions, and future work.

Page 4: Population Dynamics in Conway’s Game of Life and its Variants

What are Cellular Automata?

Computational models arranged on a grid of cells.

Each cell is in a state.

Grid changes over a number of discrete time steps.

Change of cell state determined by its current state, states of its neighbors, and the set of rules.

Cellular automaton for simulating diffusion/aggregation

[http://www.hermetic.ch/pca/da.htm]

Page 5: Population Dynamics in Conway’s Game of Life and its Variants

Differences from Most Other Models

Three interesting features of CA

Parallelism: Every cell is updated at the same time.

Localism: Every cell is updated based upon its neighbors.

Homogeneity: Every cell is updated using the same rules.

Page 6: Population Dynamics in Conway’s Game of Life and its Variants

Why Cellular Automata?

Cellular automata can simulate any algorithm via implementing universal Turing machine.

Cellular automata can demonstrate and model emergence of complex global behavior from simple local rules, self-organization, self-replication, population dynamics.

Cellular automata useful in computational theory, biology, physics, artificial intelligence…

Page 7: Population Dynamics in Conway’s Game of Life and its Variants

2D Cellular Automata

Cells arranged in a two-dimensional grid. Each cell has 8 neighbors

• Opposite sides may connect so that the grid wraps around (for top/bottom row and left/right column).

Page 8: Population Dynamics in Conway’s Game of Life and its Variants

Conway’s Game of Life

Conway’s game of life is 2D cellular automaton.

Two possible states for each cell Alive Dead

States can change Living cell can die (death). Dead cell can become alive (birth).

Simple set of rules specifying Death (overcrowding, underpopulation). Birth (reproduction).

Page 9: Population Dynamics in Conway’s Game of Life and its Variants

Basic Rules of Conway’s Game of Life

1. Living cells die if they have fewer than 2 neighbors(underpopulation/loneliness)

3. Dead cells that have 3 neighbors become alive (reproduction)

4. Otherwise, there is no change (whether cell is alive or dead)

2. Living cells die if they have more than 3 neighbors

(overpopulation)

Page 10: Population Dynamics in Conway’s Game of Life and its Variants

Game of Life - Behaviors

Wide range of common structure types: Mobile groups,

spaceships Oscillators Static structures …

Structures and their interaction crucial for simulating computations or processes.

Page 11: Population Dynamics in Conway’s Game of Life and its Variants

Summarizing Rules; Game of Life Variants

Rules can be summarized in a simple statement defining the rules for survival and birth (also else is just dead).

Examples: B3 / S23 (Conway’s original rules)

Born if 3 neighbors are alive. Survives if 2 or 3 neighbors are alive.

B36 / S23 (high life) Born if 3 or 6 neighbors alive. Survives if 2 or 3 neighbors alive.

B2 / S (seeds) Born if 2 neighbors are alive. Never survives.

Page 12: Population Dynamics in Conway’s Game of Life and its Variants

Rule Sets Used for 2-State Game of Life

Rule sets: Game of life (B3 / S23) Reversed GOL (B23 / S3) Evens (B02468 / S02468) Day and night (B3678 / S34678) Maze (B3 / S12345) Walled cities (B45678 / S2345)

Page 13: Population Dynamics in Conway’s Game of Life and its Variants

Our Research

• For each rule set, set a few important inputs as controls for each simulation• World size – 20x20 cells• Number of time steps – 100 steps• Number of runs of each simulation – 100 runs

• Independent variable• Initialization percentages of living cells – 10%-90%

• Analyze behavior of various rule sets.

• For each rule set, analyze influence of controllable variables on1. Percentages of living cell populations.

2. Percentages of changed cell states per time step (rate of change).

Page 14: Population Dynamics in Conway’s Game of Life and its Variants

Game of Life - Dynamics

Convergence upon common asymptote.

Initial population decline.

Limited range of initializations achieve this.

Restrictive survival rule.

010203040506070

Population Level Over Time

20.00%30.00%40.00%50.00%60.00%

Time Interval

% Living Cells

0

10

20

30

40

50

60

Rate of Change Over Time

20.00%30.00%40.00%50.00%60.00%

Time Interval% Change From Previous Time

Page 15: Population Dynamics in Conway’s Game of Life and its Variants

Reversed GOL (B23/S3) Example

Begins by expanding very quickly

Seems to change in waves

Not very many cells stay alive from time step to time step

Page 16: Population Dynamics in Conway’s Game of Life and its Variants

Reversed GOL (B23/S3) Population Dynamics

1 7 13 19 25 31 37 43 49 55 61 67 73 79 85 91 970

10

20

30

40

50

60

70

80

90% Changed

20% Initialization 40% Initialization

60% Initialization 80% Initialization

Number of Time Steps

Perc

enta

ge o

f C

ells C

hanged

1 7 13 19 25 31 37 43 49 55 61 67 73 79 85 91 970

10

20

30

40

50

60

70

80

90% Living

20% initialization 40% initialization

60% initialization 80% initialization

Number of Time Steps

Perc

enta

ge o

f Liv

ing C

ells

• Populations very stable• Overcrowding still kills• Maybe many live & dead

cells switch places

Page 17: Population Dynamics in Conway’s Game of Life and its Variants

Evens (B02468/S02468)Example

No recognizable patterns

All regions seem to change constantly

All movement is chaotic

Page 18: Population Dynamics in Conway’s Game of Life and its Variants

Evens (B02468/S02468)Population Dynamics

1 7 13 19 25 31 37 43 49 55 61 67 73 79 85 91 970

10

20

30

40

50

60

70

80

90% Changed

20% Initialization 40% Initialization

60% Initialization 80% Initialization

Number of Time Steps

Perc

enta

ge o

f C

ells C

hanged

1 7 13 19 25 31 37 43 49 55 61 67 73 79 85 91 970

10

20

30

40

50

60

70

80

90% Living

20% Initialization 40% Initialization

60% Initialization 80% Initialization

Number of Time Steps

Perc

ent

of

Liv

ing C

ells

• Populations very stable• Half changes and half is static• Initial population size doesn’t

matter

Page 19: Population Dynamics in Conway’s Game of Life and its Variants

Day and Night (S34678/B3678)

ExampleLife and death

are symmetrical – living and dead cells behave the same way

Large regions of living/dead cells

Regions have similar activity, chaotic boundaries

Page 20: Population Dynamics in Conway’s Game of Life and its Variants

Day and Night (S34678/B3678)

Population Dynamics No convergence

in population level or rate of change.

Relatively stable; no significant initial population decline.

Rule set – living and dead are treated equally, less survival pressures.

0

20

40

60

80

100

120

Population Level Over Time10.00%20.00%30.00%40.00%50.00%60.00%70.00%80.00%90.00%

Time Interval% Living Cells

0510152025303540

Rate of Change Over Time

10.00%20.00%30.00%40.00%50.00%60.00%70.00%80.00%90.00%

Time Interval

% Change From Previous Time

Page 21: Population Dynamics in Conway’s Game of Life and its Variants

Maze (S12345/B3)Example

Static rule set: stops changing after pattern is complete.

Consistent maze pattern for all initializations.

Page 22: Population Dynamics in Conway’s Game of Life and its Variants

Maze (S12345/B3)Population Dynamics

Convergence of a range of initializations.

Rate of change quickly drops to zero.

Stable, expanding population – tolerant survival rule.

0

10

20

30

40

50

60

70

80

90

100

Population Level Over Time

10.00%20.00%30.00%40.00%50.00%60.00%70.00%80.00%90.00%

Time Interval

% Living Cells

Page 23: Population Dynamics in Conway’s Game of Life and its Variants

Walled Cities (S2345/B45678)

ExamplePolygonal cities

filled with chaotic activity.

Activity continues only within cities after they are built.

Page 24: Population Dynamics in Conway’s Game of Life and its Variants

Walled Cities (S2345/B45678)

Population Dynamics Initial population

drop.

Limited range of initializations converge despite lack of interaction between cities.

Restrictive survival rule similar to game of life.

0

10

20

30

40

50

60

70

80

90

100

Population Level Over Time

10.00%20.00%30.00%40.00%50.00%60.00%70.00%80.00%90.00%

Time Interval

% Living Cells

Page 25: Population Dynamics in Conway’s Game of Life and its Variants

3-State Game of LifeExample

An additional living cell type represents a second species or group.

Rules used are the game of life with identity of new species determined by dominant neighboring cell type.

Cells coalesce into homogeneous mobile masses.

Each region becomes overtaken by one cell type.

Page 26: Population Dynamics in Conway’s Game of Life and its Variants

3-State Game of Life Population Dynamics

Initializations are based on difference between initial populations, with total initial population of 20%.

Rates of change are same as game of life.

Little correlation between populations of each species.

Higher initializations had higher rates of decline.

0

5

10

15

20

Population Level Over Time

Initial Difference: 16%

2.00%18.00%

Time Interval

% Living Cells

0

5

10

15

20

Population Level Over Time

Initial Difference: 12%

4.00%16.00%

Time Interval

% Living Cells

0

5

10

15

Population Level Over Time

Initial Difference: 8%

6.00%14.00%

Time Interval

% Living Cells

0

5

10

15

Population Level Over Time

Initial Difference: 4%

8.00%12.00%

Time Interval

% Living Cells

Page 27: Population Dynamics in Conway’s Game of Life and its Variants

Summary

Presented basics of CA.

Presented basics of Conway’s game of life (simple CA).

Explored population dynamics for several variants of the game of life as well as concrete examples.

Considered both 2-state and 3-state variants.

Page 28: Population Dynamics in Conway’s Game of Life and its Variants

Conclusions

Simple rule sets for CA can yield complex behavior.

Small change to rule set can yield completely different results.

Changes in the initialization of cell populations can sometimes yield similar dynamics, but sometimes the dynamics are dramatically affected (depends on rules).

Rule sets can be categorized by population dynamics, which appear to be affected by the survival rule Convergence upon optimum population levels/rates of change. Initial behavior and time for stabilization. Limited range of initializations achieving an optimum state.

Additional states introduce new possibilities for simulating competition and species-specific pressures.

Page 29: Population Dynamics in Conway’s Game of Life and its Variants

Future Work

Simulations of biological and ecological systems Example: Spreading of forest fires

3 colors for live plants, fire, & empty space Rules

Fire consumes all plant neighbors Fire can’t pass over empty spaces Plants survives with any neighbors until fire reaches it Space stays as space

This can simulate a very important phenomenon rather easily.

Simulate ecosystems, evolutionary systems, social systems, …

Page 30: Population Dynamics in Conway’s Game of Life and its Variants

Acknowledgments

STARS-2012 sponsors Pfizer Inc. LMI Aerospace Inc. / D3Technologies St. Louis Symphony Orchestra Solae University of Missouri in St. Louis Washington University in St. Louis

Martin Pelikan (mentor) supported from NSF under grants ECS-0547013 and IIS-1115352. Any opinions, findings, and conclusions or recommendations expressed in this material are those of the authors and do not necessarily reflect the views of the National Science Foundation.