We define disease dynamics in finite populations of size N as a stochastic process. Time evolves in discrete steps and two types of events may occur which change the composition of the population: infection events and recovery events. Let us assume the SIR model, as this is the most general case (see Text S1 for a detailed analysis specific for each disease model). Each state of the population is characterized by two indices i,r ð Þ, where i is the number of infected individuals in the population and r the number of recovered (and immune) individuals (izrƒN). The number of infected decreases with a rate given by