Illustration of within-group and between-group selection in absence and presence of selection. In all scenarios we assumed a population that consists of 10 groups of 10 individuals. For within-group selection (a, b) we varied the proportion of cooperators within groups while assuming that all groups have the same proportion of cooperators. For between-group selection (c, d) each groups contained either only cooperators or only defectors and we varied the proportion of cooperator groups. In (a) and (c) we assumed that a single individual reproduces and calculated the fitness-dependent probability that the reproducing individual is a cooperator. In (b) and (d) we assumed that a single individual dies and calculated the fitness-dependent probability that the dying individual is a cooperator. In all cases we assumed costs of 1, and benefits of 2. Circles show results in absence of selection (s = 0). Squares show results in presence of selection (s = 0.5).