You are on page 1of 4

MATH4333 Solution to Homework 3

1. By direct substitution, show that

P (x, t) = ebt f (xebt )

is a solution of
Pt + b(xPx + P ) = 0.
Solution
f (xebt ) ebt
Pt (x, t) = ebt + f (xebt )
t t
xebt
= ebt f (xebt ) bebt f (xebt )
t
= bxe2bt f (xebt ) bebt f (xebt )
= bebt xebt f (xebt ) + f (xebt )
 

f (xebt )
Px (x, t) = ebt
x
xebt
= ebt f (xebt )
x
= e2bt f (xebt )

So,

Pt + b(xPx + P ) = bebt xebt f (xebt ) + f (xebt ) + b xe2bt f (xebt ) + ebt f (xebt )


   

= bebt xebt f (xebt ) + f (xebt ) + bebt xebt f (xebt ) + f (xebt )


   

=0

2. Consider a population of initial size N0 with average per capita birth and death rates b and d,
respectively.
(a) Determine the differential equation for the probability mass function pN (t).
(b) Determine the expected value and variance of N .
(c) Determine the pde for the probability density function P (x, t) in the limit of infinite population
size, and show that the solution recovers the deterministic result.
(d) Perform numerical simulations of one-hundred realizations of a population of initial sized 10,
100, and 1000. Choose b = 1.0 and perform the simulations for interesting choices of d (say,
d = 0, 1/2, 1, and 2).
Solution
(a) For a population to be of size N > 0 at a time t + t, either it was of size N 1 at time t
and one birth occurred, or it was of size N + 1 at time t and one death occurred, or it was
of size N at time t and one birth and one death occurred, or it was of size N at time t and
there were no births nor deaths, that is

pN (t + t) =pN 1 (t)b(N 1)t + pN +1 (t)d(N + 1)t + pN (t)bN t dN t


+ pN (t)(1 bN t)(1 dN t)
=pN 1 (t)b(N 1)t + pN +1 (t)d(N + 1)t + pN (t)(1 bN t dN t + 2bdN 2 t2 )

Subtracting pN (t) from both sides, dividing by t, and taking the limit t 0 gives

dpN
= b(N 1)pN 1 + d(N + 1)pN +1 (b + d)N pN (1)
dt

1
(b) To obtain the governing equation of hN i, multiplying equation (1) by the constant N , summing
over all possible values of N , we have

dhN i X X X
=b N (N 1)pN 1 + d N (N + 1)pN +1 (b + d) N 2 pN
dt
N =1 N =0 N =0
2
Since N (N 1) = (N 1) + (N 1), the first term of the right-hand-side is

X
X
X
N (N 1)pN 1 = (N 1)2 pN 1 + (N 1)pN 1
N =1 N =1 N =1
X
X
= N 2 pN + N pN
N =0 N =0
2
= hN i + hN i
Similarly as N (N + 1) = (N + 1)2 (N + 1), the second term of the right-hand-side is

X
X
X
N (N + 1)pN +1 = (N + 1)2 pN +1 (N + 1)pN +1
N =0 N =0 N =0
X
X
= N 2 pN N pN
N =1 N =1
2
= hN i hN i
Therefore, the differential equation of hN i becomes
dhN i
= b hN 2 i + hN i + d hN 2 i hN i (b + d)hN 2 i = (b d)hN i
 
dt
Together with the initial condition hN i(0) = N0 , we can find the solution
hN i(t) = N0 e(bd)t
The governing equation for hN 2 i can be found similarly by multiplying equation (1) by N 2
and summing over all possible values of N :

dhN 2 i X X X
=b N 2 (N 1)pN 1 + d N 2 (N + 1)pN +1 (b + d) N 3 pN
dt
N =1 N =0 N =0
2 3 2
Using the equality N (N 1) = (N 1) 2(N 1) + (N 1), we can simplify the differential
equation of hN 2 i in the same way as above to
dhN 2 i
= 2(b d)hN 2 i + (b + d)hN i
dt
with an initial condition hN 2 i(0) = N02 .
For the case when b 6= d, solving this differential equation using an integrating factor gives
 Z t 
2 2(bd)t 2 2(bd)s
hN i = e N0 + (b + d) e hN i(s) ds
0
 Z t 
2(bd)t 2 2(bd)s (bd)s
=e N0 + (b + d) e N0 e ds
0
 
b+d  
= e2(bd)t N02 + N0 1 e(bd)t
bd
Using 2 = hN 2 i hN i2 , the population mean and variance are
b+d  
hN i = N0 e(bd)t , 2 = N0 1 e(bd)t
bd
If b = d, we have hN 2 i = N02 + 2bN0 t, so the population mean and variance are
hN i = N0 , 2 = 2bN0 t

2
(c) Define x = NN0 and P (x, t) = N0 pN (t), multiplying equation (1) by N0 and substituting
N = N0 x, pN (t) = N10 P (x, t) and pN 1 (t) = N10 P (x N10 , t) gives

P (x, t) 1 1
= b(N0 x 1)P (x , t) + d(N0 x + 1)P (x + , t) (b + d)N0 xP (x, t) (2)
t N0 N0
Using the Taylor series expansion
 
1 1 1 1 1 1 1
P (x , t) = P (x, t) Px (x, t) + Pxx (x, t) Pxxx (x, t) + O ,
N0 N0 2! N02 3! N03 N04
1
the terms in equation (2) can be grouped into powers of N0 as
     
P (x, t) 1 Pxx Px 1 Pxxx Pxx 1
= (b+d)(P +Px )+ (b+d) + + 2 (b+d) + +O
t N0 2! 1! N0 3! 2! N03

Taking the limit N0 , the zeroth-order pde of the above equation is


(0)
Pt + (b d)(Px(0) + xP (0) ) = 0

With the initial condition P (0) (x, 0) = (x 1), the solution of P (0) (x, t) can be found as

P (0) (x, t) = e(bd)t (xe(bd)t 1) = (x e(bd)t )

Hence, the zeroth-order expected value of x is


Z
hx0 i = xP (0) (x, t) dx
Z0
= x(x e(bd)t ) dx = e(bd)t
0

and the zeroth-order variance is

x20 = hx20 i hx0 i2


Z
= x2 P (0) (x, t) dx e2(bd)t
0
Z
= x2 (x e(bd)t ) dx e2(bd)t
0
= e2(bd)t e2(bd)t = 0

Thus, in the infinite population limit, the random variable x has zero variance, and is therefore
no longer random, but follows e(bd)t deterministically.
(d) At a particular time t with population size N , the simulation below computes the interevent
times of both birth and death, which changes the population size to N + 1 and N 1,
respectively. The event with a smaller interevent time will be executed and the simulation
continues with the new population size until the cumulative sum of interevent times reaches
a designated tmax .
The following MATLAB/Octave codes are used to generate the required figures:
% calculate nreal realizations and plot
b=1.0; d=[0 0.5 1 2]; N0=[10 100 1000];
Nf=10*N0; tmax=3; nreal=100;
for i=1:length(N0)
for j=1:length(d)
for k=1:nreal
[t,N]=growth_death_sim(b,d(j),N0(i),Nf(i),tmax);
subplot(length(N0),length(d),(i-1)*length(d)+j);

3
plot(t,N); hold on;
end
text(0.2,Nf(i)*0.9,[N0=,num2str(N0(i)),, d=,num2str(d(j))]);
axis([0 tmax 0 Nf(i)]);
if j==1; ylabel(N); end;
if i==length(N0); xlabel(t); end;
end
end
function [t, N] = growth_death_sim(b,d,N0,Nf,tmax)
% simulates population growth from N0 with birth rate b and d
N=[N0]; t=[0]; bd=[b d];
Ncur=N0; tcur=0;
while ((tcur<tmax) & (Ncur!=0) & (Ncur<Nf))
y=rand(1,2);
tau=-log(1-y)./(bd*Ncur); % interevent times
if (tau(1)<tau(2)); % occurrence of birth
Ncur=Ncur+1; tcur=tcur+tau(1);
else % occurrence of death
Ncur=Ncur-1; tcur=tcur+tau(2);
end
N=[N Ncur]; t=[t tcur];
end
The followings are the graphs with initial population sizes of 10, 100, and 1000:
100 100 100 100
N0=10, d=0 N0=10, d=0.5 N0=10, d=1 N0=10, d=2
80 80 80 80

60 60 60 60
N

40 40 40 40

20 20 20 20

0 0 0 0
0 0.5 1 1.5 2 2.5 3 0 0.5 1 1.5 2 2.5 3 0 0.5 1 1.5 2 2.5 3 0 0.5 1 1.5 2 2.5 3

1000 1000 1000 1000


N0=100, d=0 N0=100, d=0.5 N0=100, d=1 N0=100, d=2
800 800 800 800

600 600 600 600


N

400 400 400 400

200 200 200 200

0 0 0 0
0 0.5 1 1.5 2 2.5 3 0 0.5 1 1.5 2 2.5 3 0 0.5 1 1.5 2 2.5 3 0 0.5 1 1.5 2 2.5 3

10000 10000 10000 10000


N0=1000, d=0 N0=1000, d=0.5 N0=1000, d=1 N0=1000, d=2
8000 8000 8000 8000

6000 6000 6000 6000


N

4000 4000 4000 4000

2000 2000 2000 2000

0 0 0 0
0 0.5 1 1.5 2 2.5 3 0 0.5 1 1.5 2 2.5 3 0 0.5 1 1.5 2 2.5 3 0 0.5 1 1.5 2 2.5 3
t t t t

You might also like