Fish schools and ant trails are excellent illustrative examples of collective behaviour. Thousands or millions of individuals interact with each other and create a pattern, a fish school or an ant trail network, on a scale much larger than the individual animals. We have developed a systematic approach to studying these phenomena. We start with a relatively naive mathematical model, such as a self-propelled particle model, of how individuals interact and show how the patterns ‘emerge’ from individual interactions. We then work with experimental biologists to better understand the details of these interactions, typically using Bayesian methods to choose between competing models. By gradually refining our model we have gained insight in to bird navigation, fish schools, ant trails and human crowds. I go on to discuss some more recent work where we apply the same methods to studying ethnic segregation, combining experiments in classrooms with longitudinal studies of segregation between Stockholm schools. Finally, I give a few remarks about how a similar approach can be used to solve the difficult (but too many people highly fascinating) problem of understanding team performance in football.