Experiment with a mathematical model of birds in flight. Three knobs, no leader — and yet a murmuration.
Birds fly toward their neighbours.
Birds keep a minimum distance from each other.
Birds match their direction and speed to their neighbours.
The flight of this digital flock is beautifully intricate. But its complex behaviour arises from just the three simple rules you control with the knobs.
Each bird can only see its neighbours within a short distance. On every frame it averages what those neighbours are doing, nudges its own heading a little toward that average, and backs off from anyone who has come too close. That is the whole model.
There is no central coordination of the birds — no leader, and no bird that can see the flock it belongs to. Yet the flock moves as if with one unified mind, an example of what’s called emergent behaviour. Real birds, such as starlings, do something similar; their flocking is called a murmuration.