#OK to post homework #Nicholas DiMarzio, 09/06/21, Assignment 1 # #Problem 2 #R(n):The number of females born at time n # #Assumptions: R(0)=c0, R(1)=c1, R(2)=c2 # R := proc(n, p1, p2, p3, c0, c1, c2) option remember; if n = 0 then c0; elif n = 1 then c1: elif n = 2 then c2: else expand(p1*R(n - 1, p1, p2, p3, c0, c1, c2) + p2*R(n - 2, p1, p2, p3, c0, c1, c2) + p3*R(n - 3, p1, p2, p3, c0, c1, c2)): #Recurrence fi: end: #Problem 3 #Using the proc in problem two I called the proc using n=1000 #keeping c0,c1,c2 as 1 I changed p1,p2,p3 to different values to find out when there was extinction, stable population, and population explosion. # #part i - extinction (R(1000,0.01,0.01,0.01,1,1,1)); #This returns an exremely small number which would represent extinction #part ii - stable population (R(900,1/3,1/3,1/3,1,1,1)); =1 (R(1000,1/3,1/3,1/3,1,1,1)); =1 (R(1100,1/3,1/3,1/3,1,1,1)); =1 #Therefore this population is stable for p1,p2,p3 = 1/3 #part iii - population explosion (R(1000,1,1,1,1,1,1)); #This returns and extremely large number which represents a population explosion