Appendix S4: Inclusive Fitness Calculation

Frequency and Population States

We calculate the states in which we might expect to see the population (to find the frequency with which we observe each fitness). psplus refers to a state where s is greater than or equal to the value given. p5image refers to the number of times that we will observe 5 patches with a helper of one species and a non-helper of the other when we observe 5 patches.

a1plus=2*(((1+b-c)/(2+b-c)));
a1minus=2*((1/(2+b-c)));
a2plus=((1+b-c)/(2+b-c));
a2minus=(1/(2+b-c));
a3plus=((1-c)/(2-c));
a3minus=((1+b)/(2+2*b-c));
a4plus=((1+b-c)/(2+2*b-c));
a4minus=(1/(2-c));
a5plus=((1-c)/(2-c));
a5minus=((1+b)/(2+2*b-c));
a1=a1plus+a1minus;
a2=a2plus+a2minus;
a3=a3plus+a3minus;
a4=a4plus+a4minus;
a5=a5plus+a5minus;

p0=((a2*(a4-a5))/(a1*a3+a1*a4+a2*a4-(a1+a2)*a5))//FullSimplify;
p1=((a1*(a4-a5))/(a1*a3+a1*a4+a2*a4-(a1+a2)*a5))//FullSimplify;
p2=((a1*a3*(a4-a5))/(a4*(a1*a3+a1*a4+a2*a4-(a1+a2)*a5)))//FullSimplify;
p3=p2*(a5/a4)//FullSimplify;
p4=p3*(a5/a4)//FullSimplify;
p5=p4*(a5/a4)//FullSimplify;
p1plus=(p2/(1-(a5/a4)))+p1//FullSimplify;
p2plus=(p2/(1-(a5/a4)))//FullSimplify;
p3plus=(p3/(1-(a5/a4)))//FullSimplify;
p4plus=(p4/(1-(a5/a4)))//FullSimplify;
p5image=(((((a4))^2)/(((a4-a5))^2)))*(p5/2)//FullSimplify;

Regression of Fitness against the 6 Predictors of Fitness

We are looking at the behaviour of a long chain of cooperators, therefore the two ends of the chain are equivalent. We consider only what happens at the right end of the chain. These chains get very long, so most of the time that we are looking at at least one cooperator, all 10 patches will be cooperators. We say that we observe this state of the population k times (when all predictors are cooperators), and all the other states are calculated relative to this. We can say that we observe this state k times because while there are infinitely many cooperators, each chain will only be finitely long.

regression=(0)+((((1/(2-c))+(1/2)-1-Aminus2))^2)((p1plus/2))+((((1/(2-c))+(1/2)-1-Aminus2))^2)((p2plus/2))+((((1/2)+((1-c)/(2-c))-1-Aminus2-A0))^2)((p3plus/2))+((((1/2)+((1-c)/(2-c))-1-Aminus2-A0))^2)((p4plus/2))+(((0-Aminus2-A0-Aplus2))^2)(p5image)+((((1/(2+b))+(1/2)-1-Bminus2))^2)((p1plus/2))+((((1/(2+b-c))+(1/2)-1-Bminus2-Aminus2))^2)(p0)+((((1/(2+b-c))+(1/2)-1-Bminus2-Aminus2))^2)((p1/2))+(((((1-c)/(2+b-2*c))+((1-c)/(2-c))-1-Bminus2-Aminus2-A0))^2)((p2/2))+(((((1-c)/(2+b-2*c))+((1-c)/(2-c))-1-Bminus2-Aminus2-A0))^2)((p3/2))+(((((1-c)/(2+b-2*c))+(1/2)-1-Bminus2-Aminus2-A0-Aplus2))^2)((p4plus/2))+((((1/(2+b))+(1/2)-1-Bminus2))^2)((p2plus/2))+((((1/(2+b-c))+(1/2)-1-Bminus2-Aminus2))^2)((p1/2))+((((1/(2+b-c))+(1/2)-1-Bminus2-Aminus2))^2)(p0)+(((((1-c)/(2+b-2*c))+((1-c)/(2-c))-1-Bminus2-Aminus2-A0))^2)((p1/2))+(((((1-c)/(2+b-2*c))+((1-c)/(2-c))-1-Bminus2-Aminus2-A0))^2)((p2/2))+(((((1-c)/(2+b-2*c))+(1/2)-1-Bminus2-Aminus2-A0-Aplus2))^2)((p3plus/2))+((((1/2)+((1+b)/(2+b))-1-Bminus2-B0))^2)((p3plus/2))+(((((1+b)/(2+2*b-c))+((1+b)/(2+b))-1-Bminus2-B0-Aminus2))^2)((p2/2))+(((((1+b)/(2+2*b-c))+((1+b)/(2+b))-1-Bminus2-B0-Aminus2))^2)((p1/2))+((((1/2)+((1+b-c)/(2+b-c))-1-Bminus2-B0-Aminus2-A0))^2)(p0)+((((1/2)+((1+b-c)/(2+b-c))-1-Bminus2-B0-Aminus2-A0))^2)((p1/2))+((((1/2)+((1+b-c)/(2+b-2*c))-1-Bminus2-B0-Aminus2-A0-Aplus2))^2)((p2plus/2))+((((1/2)+((1+b)/(2+b))-1-Bminus2-B0))^2)((p4plus/2))+(((((1+b)/(2+2*b-c))+((1+b)/(2+b))-1-Bminus2-B0-Aminus2))^2)((p3/2))+(((((1+b)/(2+2*b-c))+((1+b)/(2+b))-1-Bminus2-B0-Aminus2))^2)((p2/2))+((((1/2)+((1+b-c)/(2+b-c))-1-Bminus2-B0-Aminus2-A0))^2)((p1/2))+((((1/2)+((1+b-c)/(2+b-c))-1-Bminus2-B0-Aminus2-A0))^2)(p0)+((((1/2)+((1+b-c)/(2+b-2*c))-1-Bminus2-B0-Aminus2-A0-Aplus2))^2)((p1plus/2))+(((0-Bminus2-B0-Bplus2))^2)(p5image)+(((((1+b)/(2+2*b-c))+(1/2)-1-Bminus2-B0-Bplus2-Aminus2))^2)((p4plus/2))+(((((1+b)/(2+2*b-c))+(1/2)-1-Bminus2-B0-Bplus2-Aminus2))^2)((p3plus/2))+((((1/2)+((1+b-c)/(2+2*b-c))-1-Bminus2-B0-Bplus2-Aminus2-A0))^2)((p2plus/2))+((((1/2)+((1+b-c)/(2+2*b-c))-1-Bminus2-B0-Bplus2-Aminus2-A0))^2)((p1plus/2))+(((0-Bminus2-B0-Bplus2-Aminus2-A0-Aplus2))^2)(k);

regressionBminus2=D[regression,Bminus2]//FullSimplify;
regressionB0=D[regression,B0]//FullSimplify;
regressionBplus2=D[regression,Bplus2]//FullSimplify;
regressionAminus2=D[regression,Aminus2]//FullSimplify;
regressionA0=D[regression,A0]//FullSimplify;
regressionAplus2=D[regression,Aplus2]//FullSimplify;

Solve[{regressionBminus2==0,regressionB0==0,regressionBplus2==0,regressionAminus2==0,regressionA0==0,regressionAplus2==0},{Bminus2,B0,Bplus2,Aminus2,A0,Aplus2}];

Now, we simplify the 6 coefficients.

Bminus2simp=Bminus2/.%//FullSimplify

B0simp=B0/.%%//FullSimplify

Bplus2simp=Bplus2/.%%%//FullSimplify

Aminus2simp=Aminus2/.%%%%//FullSimplify

A0simp=A0/.%%%%%//FullSimplify

Aplus2simp=Aplus2/.%%%%%%//FullSimplify

y Intercept

It is clear that when none of the predictors are cooperators, the fitness of the focal individual is the population average. Therefore, we can trivially write that c=0.

Relatedness

The relatedness of the focal individual to itself is 1. The relatedness of the individual in position Aminus2 (top left) to the focal individual is also 1. We can calculated relatedness from the case where the cooperators are rare. Therefore, relatedness can simply be calculated as the probability of the individual in any of the positions being cooperators given that the focal individual is a cooperator. Clearly, this increases with k, but does not quite reach one for any of the other predictors of fitness.

rAminus2A0=1;
rA0A0=1;
rAplus2A0=(k+p5image+(p4plus/2)+(p3plus/2)+(p2plus/2)+(p1plus/2))/(k+(p3plus/2)+(p4plus/2)+p5image+(p2/2)+(p3/2)+(p4plus/2)+(p1/2)+(p2/2)+(p3plus/2)+p0+(p1/2)+(p2plus/2)+p0+(p1/2)+(p1plus/2)+(p2plus/2)+(p1plus/2));
rBminus2A0=(k+(p2/2)+(p3/2)+(p4plus/2)+(p1/2)+(p2/2)+(p3plus/2)+p0+(p1/2)+(p2plus/2)+p0+(p1/2)+(p1plus/2)+(p2plus/2)+(p1plus/2))/(k+(p3plus/2)+(p4plus/2)+p5image+(p2/2)+(p3/2)+(p4plus/2)+(p1/2)+(p2/2)+(p3plus/2)+p0+(p1/2)+(p2plus/2)+p0+(p1/2)+(p1plus/2)+(p2plus/2)+(p1plus/2));
rB0A0=(k+p0+(p1/2)+(p2plus/2)+p0+(p1/2)+(p1plus/2)+(p2plus/2)+(p1plus/2))/(k+(p3plus/2)+(p4plus/2)+p5image+(p2/2)+(p3/2)+(p4plus/2)+(p1/2)+(p2/2)+(p3plus/2)+p0+(p1/2)+(p2plus/2)+p0+(p1/2)+(p1plus/2)+(p2plus/2)+(p1plus/2));
rBplus2A0=(k+(p2plus/2)+(p1plus/2))/(k+(p3plus/2)+(p4plus/2)+p5image+(p2/2)+(p3/2)+(p4plus/2)+(p1/2)+(p2/2)+(p3plus/2)+p0+(p1/2)+(p2plus/2)+p0+(p1/2)+(p1plus/2)+(p2plus/2)+(p1plus/2));

Inclusive Fitness Calculation

IFcalculation=Bminus2simp*rBminus2A0+B0simp*rB0A0+Bplus2simp*rBplus2A0+Aminus2simp*rAminus2A0+A0simp+Aplus2simp*rAplus2A0//FullSimplify

The condition for this to be greater than 0 is exactly the same as what we calculated in the population genetics framework, although it does not use simplifications. Therefore, for example, the function is decreasing in k, which is unsurprising because if k is large then almost all of the cooperators have a fitness equal to 1. However, the postive/negative condition is unchanged.

Altruism between species?

We can easily check that the within species effect cannot be positive when individuals in both species are used as predictors

withinspecieseffect=Aminus2simp*rAminus2A0+A0simp+Aplus2simp*rAplus2A0//FullSimplify

withinspecieseffect[[1]];

Reduce[%>0&&1>c>0&&b>0&&k>0,{b,c,k}]