pdf file - Indiana University Bloomington

Local Mate Competition (LMC). Here we are interested in the question, how does the number of mates
affect selection on the proportion of resources allocated by hermaphrodites (e.g. barnacles) to male
and female function?
Curt Lively (Indiana University) for L567.
Note: the formulation used here is based on that given by Eric Charnov for LMC in barnacles (see page
246 in Charnov’s (1982) book, “The theory of sex allocation.”)
DEFINING THE VARIABLES...
ai = allocation to male function by the ith hermaphrodite in the population.
ares = average allocation to male function in the resident population (this was ares in lecture).
astar= the equilibrium value and candidate for the ESS. (this was a* in lecture)
R = Total resource base for reproduction
K = the number of mates
Wm = individual fitness through male function
Wf = individual fitness though female function (assuming Bateman's principle).
Wi = Fitness of the ith individual (Wf + Wm). Our target individual.
Ceggs = cost of each egg (including all associated costs/egg of female function)
Csperm = cost of sperm (including all associated costs of male function).
the imput below clears all the variables. Put the cursor in the box and hit “shift-return”
In[55]:=
ai =.
ares =.
astar =.
R =.
K =.
V =.
Wm =.
Wf =.
Wi =.
Ceggs =.
Csperm =.
FIRST WE DEFINE FITNESS THROUGH FEMALE FUNCTION, Wf.
2
LMC.7d.nb
FIRST WE DEFINE FITNESS THROUGH FEMALE FUNCTION, Wf.
(Put the cursor anywhere in the bracket below and press "SHIFT-RETURN." This will store Wf in
memory)
In[66]:=
Wf = R*(1 - ai)/Ceggs
H1 - aiL R
Out[66]=
Ceggs
NEXT DEFINE FITNESS THROUGH MALE FUNCTION, Wm.
Fitness through male function is estimated as the number of eggs available to the target individual
K R H1 -aresL
Ceggs
(as there are K mates that each make (1 - ares)/Ceggs)
times
the amount of sperm produced by the target individual divided by the total amount of sperm in local
population.
HR aiLêCsperm
HHHK-1L R aresLêCspermL + HHR aiLêCspermL
(where K - 1 is the number of competitors for the k mates. Remember that there is no self fertilization).
Thus, we have
Wm =
HR aiLêCsperm
K R H1 -aresL
Ceggs
HHHK-1L R aresLêCspermL + HHR aiLêCspermL
(Put the cursor anywhere in the bracket below and press "SHIFT-RETURN.")
In[67]:=
Wm =
K R H1 - aresL
Ceggs
Out[67]=
HR aiL ê Csperm ê HHHHK - 1L R aresL ê CspermL + HHR aiL ê CspermLL
ai H1 - aresL K R2
Ceggs Csperm J
ai R
Csperm
+
ares H-1+KL R
Csperm
N
(Put the cursor anywhere in the bracket below and press "SHIFT-RETURN.")
LMC.7d.nb
In[68]:=
Out[68]=
3
FullSimplify@WmD
-
ai H- 1 + aresL K R
Ceggs Hai + ares H- 1 + KLL
Now we want to calcuate total fintess to the hermaphrodite which is the sum of the gains through male
function and female function.
(Put the cursor anywhere in the bracket below and press "SHIFT-RETURN.")
In[69]:=
Out[69]=
Wi = Wf + Wm
H1 - aiL R
Ceggs
In[70]:=
Out[70]=
ai H1 - aresL K R2
+
Ceggs Csperm J
ai R
Csperm
+
ares H-1+KL R
Csperm
N
FullSimplify@WiD
II- ai2 + ares H- 1 + KL + ai H1 + ares + K - 2 ares KLM RM ë HCeggs Hai + ares H- 1 + KLLL
NOW CALCULATE THE FIRST partial DERIVATIVE OF INDIVIDUAL FITNESS WITH RESPECT TO ALLOCATION TO MALE FUNCTION. (in mathematica D[y, x] gives the partial derivative of y with respect to
x.)
(Put the cursor anywhere in the bracket below and press "SHIFT-RETURN.")
In[71]:=
Out[71]=
In[72]:=
Out[72]=
Firstder = D[Wi, ai]
-
R
Ceggs
-
ai H1 - aresL K R3
Ceggs Csperm2 J
ai R
Csperm
+
ares H-1+KL R
Csperm
N
2
+
H1 - aresL K R2
Ceggs Csperm J
ai R
Csperm
+
ares H-1+KL R
Csperm
N
Simplify@FirstderD
- IIai2 + 2 ai ares H- 1 + KL + ares H- 1 + KL H- K + ares H- 1 + 2 KLLM RM ë
ICeggs Hai + ares H- 1 + KLL2 M
CALCULATE THE SECOND DERIVATIVE OF INDIVIDUAL FITNESS AS A FUNCTION OF ITS ALLOCATION TO MALE FUNCTION. Remember, local stability requires a negative second derivative
4
LMC.7d.nb
CALCULATE THE SECOND DERIVATIVE OF INDIVIDUAL FITNESS AS A FUNCTION OF ITS ALLOCATION TO MALE FUNCTION. Remember, local stability requires a negative second derivative
(Put the cursor anywhere in the bracket below and press "SHIFT-RETURN.")
In[73]:=
Out[73]=
Secondder = D[Firstder, ai]
2 ai H1 - aresL K R4
Ceggs Csperm3 J
ai R
Csperm
+
ares H-1+KL R
Csperm
N
3
2 H1 - aresL K R3
-
Ceggs Csperm2 J
ai R
Csperm
+
ares H-1+KL R
Csperm
N
2
SIMPLIFY THE SECOND DERIVATIVE.
(Put the cursor anywhere in the bracket below and press "SHIFT-RETURN.")
In[74]:=
Out[74]=
Simplify [Secondder]
2 H- 1 + aresL ares H- 1 + KL K R
Ceggs Hai + ares H- 1 + KLL3
Now let CSS be the derivative of the first derivative with respect to ares.
In[75]:=
Out[75]=
CSS = D@Firstder, aresD
2 ai H1 - aresL H- 1 + KL K R4
Ceggs Csperm3 J
ai R
Csperm
+
ares H-1+KL R
Csperm
N
3
Ceggs Csperm2 J
H1 - aresL H- 1 + KL K R3
Ceggs Csperm2 J
In[76]:=
Out[76]=
ai R
Csperm
+
ares H-1+KL R
Csperm
N
ai K R3
+
2
ai R
Csperm
+
ares H-1+KL R
+
ares H-1+KL R
Csperm
N
2
-
K R2
Ceggs Csperm J
ai R
Csperm
Csperm
N
Simplify@CSSD
- HHai H- 1 + 2 aresL + ares H- 1 + KLL H- 1 + KL K RL ë ICeggs Hai + ares H- 1 + KLL3 M
Now we want to solve for equilibrium to get our candidate for the ESS
(Put the cursor anywhere in the bracket below and press "SHIFT-RETURN.")
LMC.7d.nb
In[79]:=
5
ai = ares;
ares = astar;
FullSimplify[Firstder]
Out[82]=
H- 1 + astar + K - 2 astar KL R
astar Ceggs K
SET THE FIRST DERIVATIVE EQUAL TO ZERO AND SOLVE FOR astar.
(Put the cursor anywhere in the bracket below and press "SHIFT-RETURN.")
In[83]:=
Out[83]=
Solve [Firstder == 0, astar]
::astar Ø
-1 + K
-1 + 2 K
>>
Now set the candidate for the ESS, astar, to (K - 1)/(2K - 1)
(Put the cursor anywhere in the bracket below and press "SHIFT-RETURN.")
In[84]:=
astar = (K - 1)/(2 K - 1)
Out[85]=
-1 + K
-1 + 2 K
In[86]:=
Out[86]=
Simplify@SecondderD
H2 - 4 KL R
Ceggs H- 1 + KL K
In[87]:=
Out[87]=
Simplify@CSSD
I- 3 + 8 K - 4 K2 M R
Ceggs H- 1 + KL K
So, the second derivative is negative at the equilibrium for all values of K > 1. So the candidate for the
ESS is in fact an ESS.
The candidate is also convergence stable.
Now let the individual allocation, ai, be a variable again. So (ai) is no longer equal to (astar). The
purpose is to graph individual fitness as a function of ai when the population is at the ESS. We would
6
LMC.7d.nb
So, the second derivative is negative at the equilibrium for all values of K > 1. So the candidate for the
ESS is in fact an ESS.
The candidate is also convergence stable.
Now let the individual allocation, ai, be a variable again. So (ai) is no longer equal to (astar). The
purpose is to graph individual fitness as a function of ai when the population is at the ESS. We would
expect that Wi is maximized under this condition when ai converges on astar.
We are also going to set the Resources equal to 1 unit. And the cost eggs to 0.01.
(Put the cursor anywhere in the bracket below and press "SHIFT-RETURN.")
In[88]:=
ai = .
R=1;
Ceggs=0.01;
Now, for the crux of the bisquit. Let there be two mates (k = 2).
(Put the cursor anywhere in the bracket below and press "SHIFT-RETURN.")
In[91]:=
K = 2;
The ESS can be found for two mates by simplifying the population allocation, a.
(Put the cursor anywhere in the bracket below and press "SHIFT-RETURN.")
In[92]:=
Out[92]=
Simplify [astar]
1
3
Hence, the ESS is at 0.333.
Now, let's plot the relationship between fitness through male function and the allocation by the ith
individual to male function.
(Put the cursor anywhere in the bracket below and press "SHIFT-RETURN.")
LMC.7d.nb
In[93]:=
Out[93]=
7
FullSimplify@WmD
133.333 ai
0.333333 + 1. ai
In[94]:=
Plot [{Wm}, {ai, 0, 1},
AxesLabel->{"ai","Wm"}]
W\_\Hm\L
100
80
Out[94]=
60
40
20
0.2
0.4
0.6
0.8
1.0
a\_\Hi\L
Right. Diminishing returns, just as expected.
Now, let's plot the relationship between fitness through female function and the allocation by the ith
individual to male function.
(Put the cursor anywhere in the bracket below and press "SHIFT-RETURN.")
8
LMC.7d.nb
In[95]:=
Plot [{Wf}, {ai, 0, 1},
AxesLabel->{"ai","Wf"}]
W\_\Hf\L
100
80
Out[95]=
60
40
20
0.2
0.4
0.6
0.8
1.0
a\_\Hi\L
Right. Linear decrease in fitness gains through female function with increasing allocation to male
function. (This is a consequence of our assumtion that female function is limited only by resources.)
REMEMBER: allocation to female fitness increases from right to left; it's equal to 1 - ai.
Now let's plot the relationship between total fitness and the allocation by the ith individual to male
function. It should be hump shaped.
(Put the cursor anywhere in the bracket below and press "SHIFT-RETURN.")
LMC.7d.nb
In[96]:=
9
Plot [{Wi}, {ai, 0, 1},
AxesLabel->{"ai","Wi"}]
W\_\Hi\L
130
125
Out[96]=
120
115
110
105
0.2
0.4
0.6
0.8
1.0
a\_\Hi\L
Note that individual fitness, Wi, is maximal when ai = a = 0.33. That is when the individual allocation is
at the ESS.
Now let the local mating population be a bit larger, say = 4 mates.
(Put the cursor anywhere in the bracket below and press "SHIFT-RETURN.")
In[97]:=
K = 4;
The new ESS for 100 mates is found by simplifying the parameter, a.
(Put the cursor anywhere in the bracket below and press "SHIFT-RETURN.")
In[98]:=
Out[98]=
Simplify [astar]
3
7
Hence, the ESS is at 3/7 which is 0.43.
Now, as previously, let's first plot the relationship between fitness through male function and the
allocation by the ith individual to male function.
(Put the cursor anywhere in the bracket below and press "SHIFT-RETURN.")
10
In[99]:=
LMC.7d.nb
Plot [{Wm}, {ai, 0, 1},
AxesLabel->{"ai","Wm"}]
W\_\Hm\L
100
80
Out[99]=
60
40
20
0.2
0.4
0.6
0.8
1.0
a\_\Hi\L
Note the gains still show dimishing returns, but not as dramatically as for K=2.
Now, let's plot the relationship between fitness through female function and the allocation by the ith
indiviudal to male function.
(Put the cursor anywhere in the bracket below and press "SHIFT-RETURN.")
LMC.7d.nb
In[100]:=
11
Plot @8Wf<, 8ai, 0, 1<,
AxesLabel -> 8"ai", "Wf"<D
Wf
100
80
Out[100]=
60
40
20
0.2
0.4
0.6
0.8
1.0
ai
Again we see a linear decrease in fitness gains through female function with increasing allocation to
male function. (This is a consequence of our assumtion that female function is limited only by
resources.) REMEMBER: allocation to female fitness increases from right to left; it's equal to 1 - ai.
Finally, let's plot the relationship between total fitness and the allocation by the ith individual to male
function.
(Put the cursor anywhere in the bracket below and press "SHIFT-RETURN.")
12
In[101]:=
LMC.7d.nb
Plot [{Wi}, {ai, 0, 1},
AxesLabel->{"ai","Wi"}]
W\_\Hi\L
114
112
110
Out[101]=
108
106
104
102
0.2
0.4
0.6
0.8
1.0
a\_\Hi\L
Note that individual fitness, Wi, is maximal when ai = astar = 0.43.
Notice that the y axis shows a smaller range. So the fitness curve has flattened out a bit.
Now, set K to a large value, say 100. Simply type in a number after the "K =" sign.
In[102]:=
K =
100;
The new ESS for k mates is found by simplifying the parameter, astar.
In[103]:=
Out[103]=
Simplify [astar]
99
199
Hence the expected allocation a the ESS is very near 0.5.
Plot the relationship between fitness through male function and the allocation by the ith individual to
male function.
LMC.7d.nb
In[104]:=
13
Plot [{Wm}, {ai, 0, 1},
AxesLabel->{"ai","Wm"}]
W\_\Hm\L
100
80
Out[104]=
60
40
20
0.2
0.4
0.6
0.8
1.0
a\_\Hi\L
Note that the gains curve looks very linear.
Now, plot the relationship between fitness through female function and the allocation by the ith indiviudal to male function.
In[105]:=
Plot [{Wf}, {ai, 0, 1},
AxesLabel->{"ai","Wf"}]
W\_\Hf\L
100
80
Out[105]=
60
40
20
0.2
0.4
0.6
0.8
1.0
a\_\Hi\L
Finally, plot the relationship between total fitness and the allocation by the ith individual to male function.
14
LMC.7d.nb
Finally, plot the relationship between total fitness and the allocation by the ith individual to male function.
In[106]:=
Plot [{Wi}, {ai, 0, 1},
AxesLabel->{"ai","Wi"}]
W\_\Hi\L
100.5
100.4
Out[106]=
100.3
100.2
100.1
0.2
0.4
0.6
0.8
1.0
a\_\Hi\L
Is the maximum fitness at the ESS?
Note that the function is humped shaped, but the y axis has a very small range. It is virtually flat as
expected as the gains curve through male function becomes virtually linear.
Now, set K to whatever you want and run through the same steps. Simply type in a number after the "K
=" sign. You can then return to this point, change K to a new value and go again. Have fun.
In[107]:=
K =
10;
The new ESS for k mates is found by simplifying the parameter, astar.
In[108]:=
Out[108]=
Simplify [astar]
9
19
Plot the relationship between fitness through male function and the allocation by the ith individual to
male function.
LMC.7d.nb
15
Plot the relationship between fitness through male function and the allocation by the ith individual to
male function.
In[109]:=
Plot [{Wm}, {ai, 0, 1},
AxesLabel->{"ai","Wm"}]
W\_\Hm\L
100
80
Out[109]=
60
40
20
0.2
0.4
0.6
0.8
1.0
a\_\Hi\L
Now, plot the relationship between fitness through female function and the allocation by the ith indiviudal to male function.
16
In[110]:=
LMC.7d.nb
Plot [{Wf}, {ai, 0, 1},
AxesLabel->{"ai","Wf"}]
W\_\Hf\L
100
80
Out[110]=
60
40
20
0.2
0.4
0.6
0.8
1.0
a\_\Hi\L
Finally, plot the relationship between total fitness and the allocation by the ith individual to male function.
LMC.7d.nb
In[111]:=
17
Plot [{Wi}, {ai, 0, 1},
AxesLabel->{"ai","Wi"}]
W\_\Hi\L
105
104
Out[111]=
103
102
101
0.2
0.4
0.6
0.8
Is the maximum fitness at the ESS?
Note that as you increase K, the fitness function flatterns out.
1.0
a\_\Hi\L