Practice: Cellular Automata
Module 6: Explorables and Discrete Models
This is ungraded practice. It collects the lab of Session 30 into one short study that you can use to check your understanding: encode the rule, update the row synchronously, build a space-time diagram, and compare outcomes across experiments (Wolfram 1983).
You can follow the guide here:
1D Cellular Automata Space-Time Diagrams Rule Exploration Boundary Conditions Game of Life Random Soups
Goals
The practice checks three skills:
- Translate a rule number into a working local update.
- Simulate repeated synchronous updates on a one-dimensional lattice.
- Interpret how rule choice, initial condition and boundary shape the global pattern.
Core tasks
- Implement
apply_rule()and a reusablesimulate_ca()function. - Reproduce a space-time diagram for Rule 30 starting from a single occupied cell at the centre.
- Compare at least three rules from the set
{30, 90, 110, 184}using the same initial condition. - For one chosen rule, compare two different initial conditions, one single-seed row and one random row.
- Write a short paragraph that explains which features are controlled by the rule and which depend strongly on the initial condition.
Questions to answer
- Which rule in your experiments produced the most regular pattern?
- Which rule was most sensitive to the initial condition? Support your answer with the Hamming distance after a single flip.
- Did you find one rule that already looks like transport or directed motion? Explain why.
- Implement periodic boundary conditions and compare the result with fixed-zero edges.
- Add a stochastic flip rule, for example flipping a cell with small probability after each update.
- Track the density of occupied cells over time for one rule and interpret the trend.
- Add interactivity to the initial row, either in a notebook or with the reference script.
- Find a Game of Life pattern of at most 5 cells that grows for more than 100 generations before it settles.
Tips
- Test
apply_rule()on a short row before you run a long simulation. - Print the rule table once so you know which output corresponds to each neighbourhood.
- Keep the first experiments small enough that you can inspect the pattern visually.
- Reuse the same plotting code when you compare rules so the differences are easier to see.
Reference code: amlab/cellular_automata/cellular.py, amlab/cellular_automata/elementary.py and amlab/cellular_automata/life.py.
Exit question
On a ring of 100 cells, you run Rule 30 for 1000 steps and see no repetition. A classmate concludes that Rule 30 is aperiodic on this ring. Is the conclusion correct?
No. A ring of 100 cells has \(2^{100}\) configurations, so every orbit is eventually periodic. The period can be far longer than 1000 steps, which is why you see no repetition. What you observe is a long transient or a long cycle of a finite system, not true aperiodicity.