{'fraction_non_alphanumeric': 0.04979485266691533, 'fraction_numerical': 0.008392390898918314, 'mean_word_length': 4.242424242424242, 'pattern_counts': {'":': 0, '<': 2, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Adversity magnifies the importance of social information in decision-making

Decision-making theories explain animal behaviour, including human behaviour, as a response to estimations about the environment. In the case of collective behaviour, they have given quantitative predictions of how animals follow the majority option. However, they have so far failed to explain that in some species and contexts social cohesion increases when conditions become more adverse (i.e. individuals choose the majority option with higher probability when the estimated quality of all available options decreases). We have found that this failure is due to modelling simplifications that aided analysis, like low levels of stochasticity or the assumption that only one choice is the correct one. We provide a more general but simple geometric framework to describe optimal or suboptimal decisions in collectives that gives insight into three different mechanisms behind this effect. The three mechanisms have in common that the private information acts as a gain factor to social information: a decrease in the privately estimated quality of all available options increases the impact of social information, even when social information itself remains unchanged. This increase in the importance of social information makes it more likely that agents will follow the majority option. We show that these results quantitatively explain collective behaviour in fish and experiments of social influence in humans.

options can be good or bad independently, we have P (XȲ |C) = P (X|C)P (Ȳ |C). Now we define G x = P (X|C) and G y = P (Y |C), so P (XȲ |C) = G x (1 − G y ). If we further assume that private information is symmetrical (G x = G y ≡ G), Equation S1 becomes P (XȲ |B, C) = P (B|XȲ , C)G(1 − G) P (B|XY, C)G 2 + [P (B|XȲ , C) + P (B|XY, C)]G(1 − G) + P (B|XȲ , C)(1 − G) 2 . (S3) The four probabilities P (B|XY, C), P (B|XȲ , C), P (B|XY, C) and P (B|XȲ , C) parametrize the available social information. Because they must sum one, we only have three free parameters. It is therefore more useful to define S b ≡ P (B|XY, C)/P (B|XȲ , C), S x ≡ P (B|XȲ , C)/P (B|XȲ , C) and S y ≡ P (B|XY, C)/P (B|XȲ , C), and write Equation S3 as The probabilities for the other three states can be derived in the same way: Now we define the quality of x as the probability that x is good (and the same for option y), getting (S9)

Effect of a relative decision rule
We assume that y is the majority option. If the decision rule is relative (Equation 3 of the main text), superaggregation in adversity will take place when ∂(Qy/Qx) ∂G < 0 (Equation 7 of the main text). From Equations S8 and S9, (S10) The denominator of this expression is always positive because it is squared. S b is always positive because it is a ratio of probabilities. And S y > S x because y is the majority option, so this derivative is always negative. Therefore, there is superaggregation in adversity for any values of the parameters.

Effect of an absolute decision rule
If the decision rule is absolute (Equation 10 in the main text), superaggregation in adversity will take place when ∂(Qy−Qx) ∂G < 0 (Equation 12 of the main text). From Equations S8 and S9, The denominator is always positive because it is squared. S x − S y is always negative because S y > S x when y is the majority option. Therefore, the sign depends on the sign of (s b − 1)G 2 + 2G − 1. This polynomial has a single root between 0 and 1 at G = ( √ s b + 1) −1 . Therefore, the derivative is negative when G > ( √ s b + 1) −1 , recovering the same result as for the Bayesian model in the main text: there is superaggregation in adversity in the regime of high G, and the opposite effect in the regime of low G.
2 Superaggregation in space emerges for a wide range of dynamical parameters The emergence of superaggregation in adversity in our spatial model does not depend on a particular choice of dynamical parameters. To illustrate this, we have run simulations both in 2D and 3D, and with random parameters of the dynamical model (speed, acceleration, etc). Superaggregation in adversity arises in most cases, independently of these details ( Figure S1e).

The selfish herd hypothesis in the quality landscape
We assume that the available space is divided in M possible locations. The i-th location is occupied by n i individuals (i = 1 . . . M ). The quantities n i do not count the focal individual, which starts from any given location. A predator may arrive to any location with probability 1 − G (we define it in this way to keep the convention that G decreases when conditions become adverse). If the predator arrives, it will eat one of the individuals in that location, chosen at random. We define the quality of each option as the probability that the focal individual survives after choosing that location, so for location k we have where n k + 1 is the number of individuals in option k, assuming that the focal individual chooses it and that no other individual moves in the current round.   Figure S2a shows the trajectory of this estimation rule for the case of two locations (M = 2), when private information modifies the value of G. The probability of following the majority increases in adversity both for the relative decision rule ( Figure S2b, solid line) and for the absolute one ( Figure S2b, dashed line).