Complexity Science is an interdisciplinary field—at the intersection of mathematics, computer science, and natural science—that focuses on discrete models of physical and social systems. In particular, it focuses on complex systems, which are systems with many interacting components. Complex systems include networks and graphs, cellular automatons, agent-based models and swarms, fractals and self-organizing systems, chaotic systems and cybernetic systems.
This book is primarily about complexity science, but studying complexity science gives you a chance to explore topics and ideas you might not encounter otherwise, practice programming in Python, and learn about data structures and algorithms. This book picks up where Think Python leaves off. I assume that you have read that book or have equivalent knowledge of Python. As always, I try to emphasize fundamental ideas that apply to programming in many languages, but along the way you will learn useful features that are specific to Python. The models and results in this book raise a number of questions relevant to the philosophy of science, including the nature of scientific laws, theory choice, realism and instrumentalism, holism and reductionism, and Bayesian epistemology.
Complexity science is relatively new; it became recognizable as a field, and was given a name, in the 1980s. But its newness is not because it applies the tools of science to a new subject, but because it uses different tools, allows different kinds of work, and ultimately changes what we mean by “science”.
To demonstrate the difference, I’ll start with an example of classical science: suppose someone asks you why planetary orbits are elliptical. You might invoke Newton’s law of universal gravitation and use it to write a differential equation that describes planetary motion. Then you can solve the differential equation and show that the solution is an ellipse. QED!
Most people find this kind of explanation satisfying. It includes a mathematical derivation — so it has some of the rigor of a proof — and it explains a specific observation, elliptical orbits, by appealing to a general principle, gravitation.
If you start with a simulated city that is entirely unsegregated and run the model for a short time, clusters of similar agents appear. As time passes, the clusters grow and coalesce until there are a small number of large clusters and most agents live in homogeneous neighborhoods.
The degree of segregation in the model is surprising, and it suggests an explanation of segregation in real cities. Maybe Detroit is segregated because people prefer not to be greatly outnumbered and will move if the composition of their neighborhoods makes them unhappy.
Is this explanation satisfying in the same way as the explanation of planetary motion? Many people would say not, but why?