High thresholds encouraging the evolution of cooperation in threshold public-good games

For a well-mixed population, we consider a threshold public good game where group members only obtain benefits from a public good if a sufficiently large number of them cooperates. We investigate the effect of an increase in the threshold on the level of cooperation that evolves. It is shown that for sufficiently large participation costs, the level of cooperation is higher for low and for high thresholds, than it is for intermediate thresholds – where in the latter case cooperation may not evolve at all. The counterintuitive effect where an increase in the threshold from an intermediate to a high one decreases the probability of cooperation, is related to the so-called common-enemy hypothesis of the evolution of cooperation. We further apply our analysis to assess the relative weight of different game types across the parameter space, and show that game types where either a small, or a large fraction of the population evolves as cooperators, receive more weight compared to game types where an intermediate fraction of cooperators evolves.

Cooperative behavior is characterized both by social diversity, namely the fact that some organisms have high levels of cooperation and others do not 1 , and by phenotypic plasticity, where individual organisms cooperate in some contexts but not in others 2 . At the same time, key examples of cooperation between organisms can be modeled as so-called threshold public-good games [3][4][5][6][7][8][9] (also known as participation games 10,11 , discrete public-good games 12,13 , or step-level public good games 14,15 ), where a public good is produced as soon as at least a threshold of players in a group cooperates. For instance, in cooperative hunting 16,17 , a minimal number of encircling predators may be needed to successfully catch a prey. Similarly, in the collective defense of a common territory [18][19][20] , a minimal number of cooperating individuals may be needed to successfully defend the territory.
The explanation for social diversity and for the phenotypic plasticity of cooperative behavior then seems straightforward: cooperative behavior is less likely to evolve when the threshold is higher. Simply, one would expect that cooperation is less likely to evolve the more challenging is the production of the public good. E.g., when predators face a larger prey and a higher threshold of cooperating predators is therefore needed to successfully catch the prey, the evolution of cooperative hunting would be less likely; when the threat of intrusion is larger and more participation is thus needed to successfully defend a common territory, the defense of the common territory would be less likely to evolve. This paper shows that this intuition may not always be correct. It may be because producing a public good is challenging and requires a large number of cooperating players that cooperation can evolve. The reason is the following. If in any group of n players a threshold k of cooperators is needed to produce the public good, then from the perspective of a focal player the probability of this focal player's participation ensuring that the threshold is exactly met (or: pivot probability), is maximal when a fraction k n ( 1)/( 1) − − of the population cooperates (such that the probability of the focal player being matched to exactly − k ( 1) cooperators among n ( 1) − other players is maximized). Yet, this maximal pivot probability itself is highest when the threshold is either low, or is high. In the same way, when drawing with replacement − n ( 1) balls from an urn containing white and black balls, both the probability of drawing few white balls when the urn contains few white balls, and the probability of drawing many white balls when the urn contains many white balls, are large compared to the probability of drawing exactly n ( 1)/2 − white balls if the urn contains 50% white balls. For this reason, it may only be for the lowest and the highest thresholds that the gain in fitness of cooperating rather than defecting exceeds the participation costs, and that cooperation can evolve. Taking now participation costs sufficiently large such that cooperation cannot evolve with an intermediate threshold, lowering the threshold thus enables the evolution of cooperation, fitting the initial intuition. Yet, taking the same starting point, Utrecht University School of Economics, Utrecht University, Utrecht, The Netherlands. email: k.dejaegher@uu.nl open increasing the threshold and thus apparently making the evolution of cooperation more challenging, counter-intuitively encourages the evolution of cooperation.
From a broader perspective, this paper fits into a theoretical literature that explains the evolution of cooperation by considering non-linear as well as linear impact functions [21][22][23][24][25][26][27][28] (where the impact function relates the level of the public good produced to the number of cooperating players in a group); for an overview, see 29 . In this way, cooperative games can not only take the form of an n-person version of the Prisoner's Dilemma 7,30 (where joint defection is the only stable fixed point), but can also be characterized by polymorphism (a stable fixed point exists where cooperators and defectors coexist), bistability (both a cooperative stable fixed point and a joint-defection stable fixed point exists), or a combination of both. Moreover, in this literature such game types are not studied in isolation, but it is explained how the shape of the impact function affects what game type is played. Yet, missing in this literature are predictions on how often we may expect cooperative situations to take on the form of individual game types. How often do we expect a combination of polymorphism and bistability, compared to situations with only polymorphism, only bistability, or situations that fit the Prisoner's Dilemma? Our analysis answers this question by assessing the relative frequency of several game types across the parameter space, where the parameters we vary are the threshold and the participation costs. Because of the described effect where at any cooperative stable fixed point the probability of being pivotal is largest for the lowest and for the highest thresholds, across the parameter space, games where either few or many of the players cooperate are predicted to occur more frequently than games where an intermediate fraction of the players cooperates.
Within the literature on non-linear impact functions, most closely related to our analysis are models that vary the shape of the impact function by varying the degree of complementarity between the players' cooperative efforts [26][27][28] . Figure 1 compares impact functions for several threshold levels ( Fig. 1(b)), with impact functions for several degrees of complementarity ( Fig. 1(a)). As is clear by comparing Fig. 1(b) to Fig. 1(a), the impact functions have the same shape with a minimal degree of complementarity as with the minimal threshold, and with a maximal degree of complementarity as with the maximal threshold. The difference is that for intermediate degrees of complementarity the impact function is closer to being linear, whereas for intermediate thresholds the impact function continues to take the form of a step function. This characteristic of the threshold impact function has two main advantages. First, it is realistic that impact functions are S-shaped, or so-called sigmoid functions 7 , where starting from a group with only defectors, the first cooperators in the group lead to increasingly large added benefits (accelerating part of the impact function), but the last cooperators add fewer and fewer benefits (decelerating part of the impact function). This contrasts with the impact functions depending on the degree of complementarity, which are either accelerating or decelerating, but never both. Threshold impact functions provide a good approximation for sigmoid functions, which are analytically hard to handle 7 . Moreover, the impact function may only approach continuous sigmoid functions for large groups, whereas for small groups a stepwise impact function is more realistic. A second advantage of threshold impact functions is that they account for a wider range of game types, in allowing for games that are characterized by both polymorphism and bistability 7,9 . This contrasts with impact functions with the degree of complementarity as a parameter, which for higher degrees of complementarity (accelerating impact functions) allow only for bistability but not for polymorphism (cooperation need not evolve, but if it does the entire population cooperates), and for lower degrees of complementarity (decelerating impact functions) allow only for polymorphism but not for bistability (cooperation always evolves, but the stable fixed point includes defectors as well as cooperators) 27,28 . In the threshold model, polymorphism without bistability is only allowed for the minimal threshold 31,32 , and bistability without polymorphism is only allowed for the maximal threshold 5 .
As pointed out by one of the referees, the effect of threshold increases we analyze is visible in numerical examples by Archetti and Scheuring 7 (specifically their Fig. 2), both for threshold and for sigmoid impact functions, though the authors do not describe this effect in the text. The main message of this reference is to stress the existence of intermediate cooperative games where cooperators and defectors coexist, on top of more familiar extreme games where the population evolves to contain only defectors, or evolves to contain few cooperators. The contribution of our paper is twofold. First, for threshold public good games, we systematically analyze the effect

Methods
We consider a well-mixed, infinitely large population of players that reproduces asexually. Players face the binary choice of cooperating or defecting. At any given moment, a fraction p of the population cooperates, and a fraction − p (1 ) defects. Groups of n players are randomly and repeatedly formed. Denote by f p ( ) C the average fitness of cooperating, and by f p ( ) D the average fitness of defecting. Assuming that the fraction of cooperating players is determined by the continuous replicator dynamics 33 , the change over time of the fraction of cooperating players p  equals: In (2.2) and (2.3), c denotes the participation costs (=costs of cooperating rather than defecting), and b x denotes the benefit the focal player obtains when exactly x players in her group (including herself) cooperate. The focal player's fitness when cooperating or defecting is determined by the number  that cooperates among the n ( 1) − other players in her group. Given the fraction p of cooperating players in the population, the number of other cooperators in a group follows the binomial distribution, with the binomial coefficient In order to specify the model as a threshold model, we follow existing notation in the literature 9 . Denote k as the threshold, where ∈ … k n {1, 2, , }. For the threshold public good game, we assume that b 1 x = when ≥ x k (meaning that the maximal value of the public good that can be produced is normalized to 1), and b 0 x = when < x k. Furthermore, we assume that c 0 1 < < , meaning that a single player whose cooperation allows the group to meet the threshold, is better off cooperating. (2.2) and (2.3) can now be rewritten as It follows that the gains from switching from cooperating to defecting equal: Figure 2. Phase portraits for cases where the threshold public-good game is a Volunteer's Dilemma ( = k 1), a Stag Hunt k n ( ) = , and a Hybrid Game ( k n 1 < < ) (where meant are n-player versions of these game types). A filled dot indicates a stable fixed point, a non-filled dot an unstable fixed point; the arrows on the axes indicate the direction in which the population evolves. p k II denotes the fraction of cooperators in a stable interior fixed point, p k I the fraction of cooperators in an unstable interior fixed point (with − p 1 k I equal to the size of the basin of attraction of a stable fixed point where at least a fraction of the players cooperates).
Given the threshold nature of the game, when the focal player ends up in a group with either fewer than − k ( 1) cooperators or more than k ( 1) − cooperators, the benefit part of the gains from switching equals zero. The benefit part of the gains from switching therefore equals the probability of being pivotal in one's group (or in short: pivot probability), times the benefit of being pivotal; as the latter is normalized to 1, the benefit part of the gains from switching equals the pivot probability itself, which we denote as ( ) (2.1), p = 0 and p = 1 are always fixed points; by (2.6), interior points may additionally exist for p such that The existence of such interior fixed points depends on the properties of π p ( ) k .

Results
The following properties of π p ( ) k depending on k are easily checked, where Property 1(i) and 1(ii) have been previously derived in the literature 9 (all proofs of the properties and results in this paper can be found in part A of the Supporting Information): is a unimodal function that reaches a maximum for p k n Property 1 can be understood by the fact that with a given threshold k, the focal player is most likely to be pivotal if the fraction of cooperating players within the population is − − k n 1 1 . Result 1 now follows directly from Property 1, and derives the stable fixed points as a function of the participation costs and of the threshold level (where the parts of Result 1 for ≤ < k n 1 have been stated elsewhere 7,9,29 ). The result can be concisely stated by looking at the type of the game played as a function of the parameters; these game types, and their corresponding phase diagrams are represented in Fig. 2. These game types have originally been defined for, and are most often described in the context of two-player games; when we refer to these games here, we mean n-player versions of them 4,5,7,32,34,35 , where we omit the qualifier "n-player" for brevity. A Snowdrift Game 36 is a game with a single interior stable fixed point where a fraction of the players cooperates (in particular, as in all cases where the game is a Snowdrift Game, a single cooperator suffices to produce the public good, the game is a Volunteer's Dilemma 37 ). A Prisoner's Dilemma is a game with a single stable fixed point where all players defect 30 . A Stag Hunt 34 is a game with both a stable fixed point where the entire population cooperates, and a stable fixed point where the entire population defects. A Hybrid Game shares features of the Volunteer's Dilemma and the Stag Hunt, and has both a stable fixed point where all players defect (which we refer to as the defective stable fixed point), and an interior cooperative stable fixed point.
We first look at non-interior stable fixed points. While in existing literature the focus is on the cooperative stable fixed point 9 , we include in our analysis the possibility that p = 0 is a stable fixed point. In fact, such a defective stable fixed point exists for all k 1 > , as it is then a best response to defect if the entire population defects. For k 1 = , however, if the entire population defects, the individual player is better off cooperating, and = p 0 is an unstable fixed point. Additionally, for k n = , = p 1 is a stable fixed point, because the individual player is then better off cooperating in a population where all players cooperate; however, for < k n, the individual player is better off defecting in such a case, and p 1 = is an unstable fixed point. We next look at interior stable fixed points. For k n 1 < < , Property 1(ii) tells us that p ( ) k π is hill-shaped, such that for participation costs that are not too large, two interior fixed points exist. For k 1 = (respectively = k n), given that π p ( ) k is decreasing (increasing) and ranges from 1 to 0 (from 0 to 1), a single interior fixed point always exists. Denote in particular by p k I an interior fixed point with p c ( ) Clearly, any fixed point p k I is unstable, because for a slightly larger (smaller) fraction of cooperating players, the individual player is better off cooperating (defecting). Summarizing, for k 1 = , the game has a single interior cooperative fixed point. Also, for k n 1 < ≤ , the game has two stable fixed points, namely the defective stable fixed point, and the cooperative stable fixed point. In this case, we consider the size of the basin of attraction of the cooperative stable fixed point, i.e. p ( 1 ) k I − , as the probability that this fixed point will evolve. The underlying reasoning is that each initial population is equally likely, so that the probability that the cooperative stable fixed point evolves is equal to the probability that the initial population lies in its basin of attraction.
In order to describe Result 1, we define ¯π = =  In order to look at the effect of increases in the threshold, we now derive Property 2 about π p ( ) k , which looks at how the shape of the pivot probability p ( ) k π is affected by the threshold. An example is given in Fig. 3 for = n 7. Property 2 can be understood as follows. An increase in the threshold means that the pivot probability becomes smaller for a lower range of fractions of cooperation players, and larger for an upper range of such fractions, and that the fraction of cooperating players for which the pivot probability is maximal increases (Property 2(i)). At the same time, the maximal pivot probability itself is a U-shaped function of the threshold (Property 2(ii)); this is because the threshold is most likely to be exactly achieved when the threshold is low and a small fraction of the players cooperates, or when the threshold is high and a large fraction of the players cooperates. Furthermore, Property 2(iii) establishes some symmetry properties of the pivot probabilities, and Property 2(iv) calculates the maximal pivot probabilities whenever possible.

Property 2 about
. Combine this fact with Property 1(ii), and consider p , k n k n We now come to our main result in Result 2, which follows directly from Property 2 and looks at how, for given levels of the participation costs, the game type changes as a function of the threshold. As the level of cooperation that can evolve differs across game types (see Fig. 2), these game-changing effects of increases in the threshold can be interpreted as effects on the level of cooperation. In detail, Result 2 shows that for sufficiently large participation costs (Result 2(i) and 2(ii)), increasing the threshold has a U-shaped effect on the level of cooperation, in that cooperation can evolve both for low and for high thresholds, but not for intermediate thresholds.
Put otherwise, for sufficiently large participation costs, we have a Volunteer's Dilemma or Hybrid Game for low www.nature.com/scientificreports www.nature.com/scientificreports/ thresholds and a Stag Hunt or Hybrid game for high thresholds (in which cases cooperation can evolve), but a Prisoner's Dilemma for intermediate thresholds (in which cooperation cannot evolve). The interpretation of the game-changing effects in Result 2(i) and 2(ii) as effects on the level of cooperation is a strong interpretation, as it applies for all formal measures of the level of cooperation that one may consider. For instance, one may simply measure the level of cooperation by the fraction of cooperating players in the cooperative stable fixed point 9 . Yet, a more goal-oriented measure may be found by calculating the probability that the public good is produced within any individual group; moreover, one may include in this measure the expected participation costs, so that one considers the expected payoff that each individual player obtains. Finally, for each of these measures, one may additionally include the ex-ante probability that cooperation evolves at all, as given by the basin of attraction of the cooperative stable fixed point. Whichever of these formal measures one considers, as the game is a Prisoner's Dilemma for intermediate thresholds and has no cooperation, the U-shape effect is maintained.

Result 2. game-changing effects of an increase in the threshold.
It is natural to ask oneself whether the U-shaped effect on the level of cooperation implied by Result 2(i) and 2(ii) is maintained when one does not only consider game-changing effects of higher thresholds, but also looks at the effect on the level of cooperation when a higher threshold does not change the type of the game. As shown in part B of the Supporting Information, for a range of participation costs just below the maximal pivot probability, the effect of the threshold on the level of cooperation remains U-shaped, no matter what measure for the level of cooperation one considers. Moreover, by the hysteresis effect 3,6 , the game-changing effects in Result 2(i) may extend to smaller participation costs, where for intermediate thresholds the defective fixed point would continue to be the only outcome that can evolve. The point of the hysteresis effect is that for participation costs just below the maximal pivot probability, the fraction of cooperating players in the cooperative stable fixed point is only slightly above the critical fraction of cooperating players that brings one in the basin of attraction of this stable fixed point. Thus, a small shock in the fraction of cooperating players can lead to joint defection evolving. Once joint defection has evolved, a small shock in the fraction of cooperating players cannot bring one back to the cooperative stable fixed point. In the same way, for participation costs just below the maximal pivot probability, a small shock to the participation costs can turn the game into a Prisoner's Dilemma. Once joint defection has evolved, a return to the original participation costs does not allow the cooperative stable fixed point to evolve again. For this reason, Result 2(i) may effectively apply for a wider range of participation costs. Yet, for the smallest participation costs, as is clear from Fig. 3, the hysteresis effect does not apply, because participation costs are far below the maximal pivot probability, and because the fraction of cooperators in the cooperative stable fixed point is much larger than the critical fraction dividing the basins of attraction. As shown in part B of the Supporting Information, the effect of the threshold on the level of cooperation is ambiguous in this case, and depends on the precise measure of the level of cooperation that is considered.
Another way to interpret our results is in terms of the predicted frequency of the different game types. What game types receive more weight across the parameter space covering all possible combinations of participation costs and thresholds? To assess this, Fig. 4 represents for the example = n 7 all possible thresholds (k 1, 2, , 7 = … ) on the X-axis, and all participation costs ( c 0 1 < < ) on the Y-axis; as a function of these, the type of the game played is indicated. As is clear from Fig. 4, roughly, games in which the evolution of cooperation is possible apply for smaller participation costs (as the Prisoner's Dilemma applies for larger participation costs). Yet, both for low and for high thresholds, participation costs need to be less small to allow for the evolution of cooperation, with such evolution possible over the entire participation cost range both for the minimal threshold (in which case the game is a Volunteer's Dilemma) and the maximal threshold (in which case the game is a Stag Hunt). For this reason, across the parameter space, among the games that allow for the evolution of cooperation, games with low and with high thresholds have more weight. This effect is particularly pronounced for small groups. For instance, assuming a uniform distribution of both k and c, applying Property 2(iv), it can be checked that with n = 3 the Snowdrift game and the Stag Hunt each take up 1/3 of the parameter space, whereas the Hybrid game and the Prisoner's Dilemma each take up 1/6; with n = 4 the Snowdrift game and the Stag Hunt each take up 25% of the parameter space, the Hybrid game takes up 22%, and the Prisoner's Dilemma takes up 28%. For larger groups, Hybrid games take up a larger part of the parameter space; yet within the class of Hybrid games itself, those where few or where many players cooperate in the cooperative stable fixed point again receive more weight, as is clear from Fig. 4.  (2020) 10:5863 | https://doi.org/10.1038/s41598-020-62626-3 www.nature.com/scientificreports www.nature.com/scientificreports/ We further look at how the picture in Fig. 4 is affected by group size. Given Property 2(iv), as + c n ( 1)/2 approaches 0 for large n when n is odd (and as = + c c n n ( 2)/2 / 2 approach 0 for large n when n is even), the U-shaped effect of the threshold on the level of cooperation in Results 2(i) and 2(ii) applies for a wider range of participation costs the larger the group size. Yet, at the same time, it is clear that for large n the share of the parameter space taken up by the Volunteer's Dilemma and the Stag Hunt becomes smaller and smaller. Moreover, the fraction of cooperating players in the unique stable fixed point of the Volunteer's Dilemma, and the basin of attraction of the joint-cooperation fixed point in the Stag Hunt, get smaller and smaller as n is increased. This means that for the U-shaped effect in Result 2(i), the level of cooperation for the minimal and maximal threshold is small, so that the U-shaped effect is weak. While for group sizes approaching infinity the fixed points can be calculated, these appear less relevant because the Prisoner's Dilemma becomes dominant, and in the remaining cases where cooperation can evolve, the predicted level of cooperation is vanishingly small. Overall, our two results about the counter-intuitive effect of a higher threshold and about the frequency of different game types across the parameter space, are thus most pronounced for smaller groups.

Discussion
The first conclusion of this paper, namely that a higher threshold for the successful production of a public good may enable rather than hamper the evolution of cooperation, can be linked to a hypothesis that dates back to at least Kropotkin 38,39 , stating that the evolution of cooperation takes place when harsh environments make it in organisms' interest to cooperate. This hypothesis may be termed the common-enemy hypothesis, with a harsher environment acting as a common enemy encouraging cooperation. The hypothesis forms an alternative to more well-known explanations for the evolution of cooperation, including direct 40 and indirect reciprocity 41 , network reciprocity 42 , kin selection 43 , and group selection 44 . In our analysis, a harsh environment takes the form of e.g. a larger prey, such that more cooperating predators are needed to successfully catch a prey, or of a higher threat of intrusion, such that a larger number of defenders is needed to successfully protect a common territory.
Existing theoretical underpinnings for the common-enemy hypothesis argue that in harsher environments, players who defect from cooperation become to a larger extent the victim of their own defection (the so-called boomerang effect) 27,28,45 . Put otherwise, a harsher environment makes each player's cooperative effort to a higher extent pivotal, and thus changes the benefit of being pivotal. The argument is therefore that harsher environments change the shape of the impact function of the public good produced by the players, and in particular makes the impact function to a larger extent accelerating, such that the last player who cooperates contributes more (see Fig. 1(a)). In the current paper, a harsher environment does not change the shape of the impact function, in the sense that the player whose cooperative effort ensures that the threshold is reached, always contributes the full , and all possible thresholds (horizontal axis) for the case n = 7. As thresholds are natural numbers, they are represented as bars. The figure represents the incidence of the several game types (see Fig. 2) across the parameter space, where to each color corresponds a game type (where the game types refer to n-player versions of these games). As shown in the figure, the game types that allow for the evolution of cooperation (all other games than the Prisoner's Dilemma) take up a large part of the parameter space for lower, and for higher thresholds. For large participation costs, the only game types that allow for the evolution of cooperation are the Volunteer's Dilemma and the Stag Hunt. www.nature.com/scientificreports www.nature.com/scientificreports/ value of the public good (the impact function always takes the shape of a step function; see Fig. 1(b)). Instead, a harsher environment in the form of a larger threshold means that the probability of the individual player being pivotal in her group becomes larger, so that a cooperative stable fixed point may come to exist, where none existed before. In the current paper, it is therefore not the benefit of being pivotal that is affected by the harshness of the environment, but the probability of being pivotal.
The second conclusion from this paper is that cooperation where either a small fraction in any group cooperates, or a large fraction, should evolve more frequently than cooperation where an intermediate fraction of a group cooperates. When modeling the evolution of cooperation, evolutionary game theory has often focused on stylized games such as the Volunteer's Dilemma (leading to polymorphism) or the Stag Hunt (leading to bistability) 7 . While this focus is due to the simplifying assumption of two-player games, which do not allow for Hybrid games characterized by both polymorphism and bistability, our analysis suggests that this focus has some merit, given our prediction that cooperation where either a small, or a large fraction of a group cooperates, evolves more frequently. It is tempting to see a similar pattern in canonical examples of cooperative behavior, which often include sentinel behaviour, where a single sentinel may suffice to produce the public good 46 , as well as cooperative hunting, where several hunters need to cooperate to catch the prey 16,17 . However, a systematic study looking at the relevance of several game types across a broad range of cooperative instances is missing, and furthermore, cooperative hunting has itself been observed to be characterized by polymorphism, with both cooperators and defectors 16 .
Our results can be linked to the literature that studies the effect of group size on the probability of cooperation, connected to the so-called Olson conjecture 9,47 , stating that cooperation is hampered by larger group sizes. Given that a cooperative stable fixed point exists over a large range of participation costs when the threshold approaches the group size, it follows that holding the threshold fixed and decreasing group size until it approaches the threshold can enable the evolution of cooperation -which is fully in line with the Olson conjecture. If group size is itself subject to evolution 48 , it is therefore possible that groups evolve to be equal in size to the threshold needed to achieve successful public-good production. Yet, in a similar way, one could reason that, since for low thresholds it is also the case that a cooperative stable fixed points exists for a large range of participation costs, starting from a fixed intermediate threshold, increasing group size could also enable the evolution of cooperation, as the fixed threshold then becomes small compared to group size. However, this reasoning is wrong, as is clear by looking at the effect of group size on pivot probabilities 9 . The point is that, while by decreasing group size one can always ensure that the threshold becomes equal to the group size (so that the game becomes a Stag Hunt), by increasing group size for a given threshold, even though the threshold may become small compared to group size, one can never make the threshold equal to 1 (so that the game never becomes a Volunteer's Dilemma). Our results are thus in line with the Olson conjecture, in that all else equal an increase in group size is still predicted to hamper the evolution of cooperation. Still, our results imply that, if for a given group size and threshold smaller than the group size cooperation cannot evolve, then increasing the group size and at the same time increasing the threshold even more so that it approaches the new group size, can still enable the evolution of cooperation. This is because of the large pivot probabilities that can be achieved if the threshold approaches the group size.
An avenue for future research is to study the common-enemy hypothesis in combination with standard explanations for the evolution of cooperation, such as (in)direct reciprocity or network reciprocity. Notably, in statistical physics (for an overview, see 49 ) the effect of threshold changes on the evolution of cooperation has been studied for structured populations 50 . Because of network reciprocity, in simulations, an opposite effect to the one we describe for sufficiently large participation costs is observed, where the level of cooperation that evolves is higher for intermediate thresholds than for low or high thresholds. The intuition for this result is that it is for intermediate thresholds that cooperators benefit most from the vicinity of other cooperators. For a similar reason, cooperation can also be higher for intermediate group sizes in case of network reciprocity 51 . As a well-mixed population can be considered as a limit case of a structured population 52 , a question for future research is therefore for what population structures the effect we describe applies, and for what population structures an opposite effect applies.