Enter the maze

The vigilance of the flock

by Paul Curzon, Queen Mary University of London

Bird feeding on beach in sunset : copyright www.istockphoto.com 59995154

How do scientists understand the behaviour of animals? One way is to spend lots of time in the field observing animals and seeing what they do. But you only really understand something when you know the mechanism of how and why it happens, not just that you can describe the behaviour. Scientists come up with hypotheses and then try to find ways to test the hypotheses, finding situations where it will be obvious if the hypothesis is wrong. That can be very hit and miss if just done with observation. Computer Science has given a whole new way to do this: computational modelling and a new way to do it called Cellular Automata.

The Game of Life

It all started with a mathematical curiosity: The Game of Life. Invented by mathematician, John Conway, the game is played on a giant, ideally infinite, board of squares. Some squares contain counters, and others are empty. Each counter represents a cell - a life form. Those cells all live or die following the same rules. If an empty square is surrounded by exactly 3 live cells then a new cell is born, otherwise it stays empty. If a live cell is surrounded by exactly 2 or 3 live cells then it stays alive. Otherwise it dies. Time steps forward a tick at a time, and on each tick, all squares check their surrounding squares and follow the rule, dying or coming to life in synchrony at the end of the tick. To play the Game of Life you just choose the initial starting position, then follow the rules. The result is surprisingly complex, with intriguing patterns emerging. Some patterns coalesce into stable formations. Others turn into patterns that move across the board. Some die out, others evolve through ever changing patterns.

Intriguing patterns emerging as you follow the rules

Computer Scientists realised The Game of Life could be turned into more than just a game. It was a powerful new kind of computation, a way to model all sorts of real situations, just by choosing different rules, different programs, for the cells to follow. The idea of Cellular Automata was born: a whole new way of thinking about, and doing, programming.

To eat or not to eat?

Work exploring the way flocks of birds behave when feeding on the ground by researchers from the University of Colorado is a good example of how cellular automata can support science. They were interested in how feeding flocks of birds decide whether to watch the sky or eat. If all eat at the same time then all will be at risk of predators. If all watch the sky, then none get to eat which defeats the point of being on the ground and at risk in the first place. From observation it is clear that neither extreme holds. At any time some birds are always watching the sky and some are feeding. Somehow individual birds make a decision at any point in time to feed or watch. One theory might be that they just behave randomly. Another might be that somehow they know what all the others are doing.

Whatever the theory, if it is true, it must account for the observations: for example, the bigger the flock, the less time individual birds spend watching the sky. Also when there are obstacles like trees, the birds spend more time watching the sky, and birds in a line spend more time scanning the sky than birds in a circle.

Watch your neighbours

The Colorado researchers had a theory that individual birds must make decisions based just on what the birds around them were doing. If lots around them were watching the sky, they would eat. If few were they would watch. To understand the consequences of this supposed behaviour better, they created a cellular automata of the scenario. Each square of the grid held a single bird. The program of each cell, so of each bird, implemented the following simple rules. Each bird can eat. Alternatively, it can look up and both watch the sky and its 8 neighbours in the grid. If 4 or more neighbours of a bird are eating then the bird scans the sky (someone must). If 4 or more are scanning then the bird eats (there is plenty of protection). If a bird is eating it pays no attention to its neighbours most of the time, but does periodically check what they are doing. It then decides to continue eating or not based on the same rules.

Does it match reality?

By programming these rules into a cellular automata program the researchers could run simulations of different situations to see what happened. What they found was that the model matched the observations. Automata birds were less vigilant if flocks were large, and obstacles led to greater vigilance. The model also helped the scientific method. It gave specific predictions that could then be tested in the field. For example, it suggested that the shape of the flock should affect how vigilant birds were. The larger the perimeter of the flock for a given number of birds, the more the birds should spend time scanning the sky. Having very specific predictions to test like this is what drives science. If the predictions prove right, then the model, and so understanding of what is happening, is further confirmed. If they prove wrong then it shows that the hypothesis - so the rules - do not account for all behaviour and so need to be adapted, or possibly completely changed.

Automata birds were less vigilant if flocks were large

Cellular automata started as recreational maths, but they've not only provided a new way to do computation, they've also provided a new way to do science too, complementing methods based on observation. It is just one of the reasons why the skill of computational thinking has become a must for all scientists, not just computer scientists.