Using mathematical models and individual-based simulations to study the social evolution of microbes, viruses, and endosymbiosis.