Teaching objectives
How can a school of fish move in perfect unison with no one leading the way? Or how does an ant colony organize itself without anyone giving orders? This secondary-school lab explores eight families of emergent-rule phenomena — from fireflies to cellular automata and fractals — to show that complex order can arise from ridiculously simple local rules applied repeatedly across thousands of agents. This lab is worth highlighting in particular for its first room, where fish magically begin to form shoals; the third room, where fireflies synchronize; and room 23, where ants find food and start carrying it back to the nest. Each simulation is followed by an explanatory room where students must apply the rules locally themselves.
What you'll learn
Students discover that self-organization requires no central intelligence: it is enough for each element of the system to look at its neighbors and follow a simple rule. The journey alternates "wow" simulations with pencil-and-paper quizzes where students apply the same rule by hand on a small grid.
- Reynolds's three rules (separation, alignment, cohesion) explain flocking behavior; students apply them to a single fish to understand the model.
- Kuramoto synchronization shows how fireflies adjust their phase toward the average of their neighbors until they all flash in unison.
- Cellular automata (BZ spirals, Conway's Game of Life, a forest struck by lightning, a sand pile that topples) are studied as grids where each cell applies the same neighborhood rule step by step.
- The self-organized criticality of the sand pile illustrates why complex systems spontaneously settle at the edge of chaos.
- The percolation transition reveals that there is a critical density threshold p at which a path crossing the entire network suddenly appears.
- The Schelling model shows that a tolerance of just 33 % is enough for spatial segregation to emerge even when nobody individually desires it.
- Ants with pheromones and diffusion-limited aggregation (DLA) close the lab with fractal patterns of non-integer dimension generated by random walks.
Key mathematical ideas
- Local rules → global behavior: macroscopic complexity is not encoded in any individual agent.
- Cellular automaton: discrete grid + neighborhood function + iteration; B/S notation for the Game of Life.
- Kuramoto model: coupled oscillators that converge to a common phase through gradual adjustment.
- Self-organized criticality: the sand pile reaches a critical state where the distribution of avalanches follows a power law.
- Percolation threshold: phase transition at p ≈ 0.593 for square grids; no percolating path exists below it, and one almost always exists above it.
- DLA and fractal dimension: the branching structure has a Hausdorff dimension ≈ 1.71, arising from diffusion and randomness.
- Pheromone as distributed memory: a local concentration gradient replaces a global map.
Room-by-room contents
Room 1 · The flock invents itself
Boids simulation (Reynolds): each point follows only 3 rules looking at its nearby neighbours — no leader, no destination — and a coordinated flock emerges.
Student tasks
- Observe how the flock appears from the initial chaos.
- Tweak the separation, alignment and cohesion parameters to see when the formation breaks apart.
Room 2 · Three rules about a fish
Applied quiz: for each presented situation, the student decides in which direction each of the 3 rules (separation, alignment, cohesion) pushes the central fish.
Student tasks
- Identify which rule pushes the fish in each scenario.
- Combine the three resulting arrows to predict the net movement.
Room 3 · Fireflies that come into agreement
Kuramoto synchronisation simulation: each firefly flashes at its own rhythm, but by watching its neighbours it adjusts its phase until all flash in unison.
Student tasks
- Observe how many cycles it takes for synchronisation to be achieved.
- Vary the coupling strength and see how the speed of synchronisation changes.
Room 4 · Speeds up or slows down?
Quiz on the phase-adjustment rule: if a slow firefly watches one that is ahead in the cycle, does it correct by speeding up or slowing down? The student applies the rule to specific cases.
Student tasks
- Read the phase-adjustment rule towards the mean.
- Answer for each case whether the firefly speeds up or slows down.
Room 5 · Spirals from nothing
Cyclic automaton (analogous to the Belousov-Zhabotinsky reaction): each cell "eats" the neighbour that is one step behind in the cycle. From pure noise, rotating spirals emerge.
Student tasks
- Observe the formation of spirals from the random initial state.
- Reset several times and compare what patterns appear each time.
Room 6 · Grid and neighbours
Formal introduction to cellular automata: the grid, the Moore neighbourhood (8 neighbours), and a manual application of the "rule of 5" on a 3×3 mini-grid.
Student tasks
- Identify the 8 neighbours of a cell in the grid.
- Calculate the next state of each cell by applying the cyclic automaton rule.
Room 7 · Soup that invents creatures
Conway's Game of Life: from a random "soup", gliders, oscillators and stable structures emerge using only two rules (birth with 3 neighbours; survival with 2 or 3).
Student tasks
- Observe which stable or periodic structures emerge spontaneously.
- Edit the grid to place a glider and watch it travel.
Room 8 · Apply B3/S23 by hand
Cell-by-cell quiz: the student marks the next state of a Game of Life configuration using the notations B3 (born with 3) and S23 (survives with 2 or 3).
Student tasks
- Count the live neighbours of each cell.
- Apply B3/S23 and mark the new state of the grid.
Room 9 · Forest, rain and lightning
Forest fire model: trees grow at random, lightning strikes sporadically and fire spreads through connected trees. A dynamic equilibrium emerges between density and catastrophe.
Student tasks
- Observe the balance between growth and destruction.
- Vary the lightning rate to see how the average forest density changes.
Room 10 · Burn this forest by hand
Quiz: given a grid with trees and fire, the student calculates the next state by applying the rules (tree with burning neighbour → burning; burning → empty) with no growth or lightning.
Student tasks
- Identify which trees have at least one burning neighbour.
- Mark the resulting state of the entire grid after one step.
Room 11 · Sand pile on the edge
Model of self-organised criticality (Bak-Tang-Wiesenfeld): grains are added one by one; when a column exceeds 4, it collapses and distributes grains to its neighbours, triggering avalanches of all sizes.
Student tasks
- Add grains and observe small and large avalanches.
- Verify that the system always returns to the edge of instability.
Room 12 · Solve this avalanche
Quiz: given a grid with numerical values, the student applies the collapse rule (cell ≥ 4 loses 4 and shares 1 with each neighbour) until no cell exceeds the threshold.
Student tasks
- Locate the cells that trigger the initial collapse.
- Propagate the avalanche step by step and calculate the final state.
Room 13 · Oil and water that separate
Ising/spinodal-decomposition model by majority rule: each cell copies the majority colour of its 4 neighbours. From a random mixture, growing domains emerge that recall phase separation.
Student tasks
- Observe how small domains disappear and large ones grow.
- Compare the random initial state with the state after 50–100 steps.
Room 14 · What does the majority say?
Quiz on the majority rule: the student determines the next colour of each cell based on whether at least 3 of its 4 neighbours (north, south, east, west) share the same colour.
Student tasks
- Count the neighbours of each colour for each cell.
- Mark the new state of the grid by applying the majority rule.
Room 15 · The threshold that connects everything
Percolation transition: cells are filled at random with probability p. The student explores from which threshold a cluster appears that crosses the whole screen from top to bottom (p ≈ 0.593, not 0.5).
Student tasks
- Vary p and observe when the first continuous path appears.
- Record the approximate value of p at which the transition occurs.
Room 16 · Follow the path
Connectivity quiz: given a partially filled grid, the student determines whether there is a path of black cells running from the top row to the bottom row using only up/down/left/right movements.
Student tasks
- Trace the possible path (or prove its non-existence) on the grid.
- Answer yes/no with justification.
Room 17 · Voters that spread ideas
Voter model: each cell periodically picks a random neighbour and adopts its colour. The student observes whether diversity of opinions survives or whether the system converges to a single colour.
Student tasks
- Observe the time to convergence for different grid sizes.
- Compare with the majority model from Room 13.
Room 18 · Calculate the probabilities
Quantitative quiz: a cell with 4 neighbours of given colours picks one at random to copy. The student calculates the probability of the cell adopting each possible colour.
Student tasks
- Count the neighbours of each colour.
- Express the probability of adopting each colour as a fraction.
Room 19 · Schelling's segregation
Schelling model (1971): each agent moves away if fewer than T% of its neighbours belong to its group. Even with very high tolerances, ghettos emerge, showing how individual preference produces unexpected global segregation.
Student tasks
- Adjust the threshold T and observe when segregation appears.
- Reflect on the difference between individual preference and collective outcome.
Room 20 · Does this one move?
Quiz applying the Schelling rule with T = 33 %: the student analyses a neighbourhood and marks which agents will move because fewer than 1/3 of their neighbours belong to their group.
Student tasks
- Calculate the fraction of same-group neighbours for each agent.
- Mark the dissatisfied agents who move.
Room 21 · Ants that find the way
Stigmergy model with pheromones: each ant lays a trail and prefers paths with more pheromone. Without a map or a leader, an optimal route between nest and food emerges. The explanation of the rule "choose the neighbour with the most pheromone" is integrated into this room.
Student tasks
- Observe how the shortest path is progressively reinforced.
- Block the active path and see whether the ants find an alternative route.
Room 22 · Fractal from random walks
Diffusion-limited aggregation (DLA): particles wandering randomly stick on touching the central cluster. From a single seed a branching fractal structure of non-integer dimension (~1.71) grows.
Student tasks
- Observe the step-by-step formation of the fractal.
- Notice why the arms grow faster than the interior gaps.
Room 23 · Does it stick here?
Closing quiz: given a grid with a DLA cluster already formed, the student marks all the cells where a random walker would get stuck if it stepped on that square (i.e., all cells adjacent to the cluster).
Student tasks
- Identify the outer perimeter of the cluster.
- Mark exactly the empty cells adjacent to at least one cluster cell.
Rooms to project
The most striking ones to show and discuss in class.