#OK to post homework; #Anusha Nagar, 9.6.2021, Assignment 1; # "Problem 1" #Assumptions: (1) Only one-year-old, two-year-old, and three-year-old females are fertile, (2) the probability that a one-year-old, two-year-old, or three-year-old female gives birth to a female are p1, p2, and p3*(respectively), (3) there were c0 females born at n=0, c1 females born at n=1, and c2 females born at n=2; #Recurrance; R(n, p1, p2, p3, c0, c1, c2) = 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)*with*initial*conditions*R(0) and 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)*with*initial*conditions*R(0) = c0, R(1) = c1, R(2) = c2; #At*n = 4, expected*number*of*females*born*is*p1*R(3) + p2*R(2) + p3*R(1); #R(3) = p1*R(2) + p2*R(1) + p3*R(0) and p1*R(2) + p2*R(1) + p3*R(0) = c0*p3 + c1*p2 + c2*p1; #Therefore, at*n = 4, R(4) = p1*(c0*p3 + c1*p2 + c2*p1) + p2*c2 + p3*c1; #Problem 2; #Assumptions: (1) Only one-year-old, two-year-old, and three-year-old females are fertile, (2) the probability that a one-year-old, two-year-old, or three-year-old female gives birth to a female are p1, p2, and p3*(respectively), (3) there were c0 females born at n=0, c1 females born at n=1, and c2 females born at n=2; #Initial*Conditions; #Rg(0) = c0, Rg(1) = c1, Rg(2) = c2; #Rg(n, p1, p2, p3, c0, c1, c2); #THE*EXPECTED*NUMBER*OF*FEMALES*BORN*AT*YEAR*n; Rg := 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*Rg(n - 1, p1, p2, p3, c0, c1, c2) + p2*Rg(n - 2, p1, p2, p3, c0, c1, c2) + p3*Rg(n - 3, p1, p2, p3, c0, c1, c2)); fi: end: #Problem 3; #seq(evalf(Rg(i, 0.3333333, 0.3333333, 0.3333333, 1, 1, 1)), i = 1 .. 100); 1., 1., 0.9999999, 0.9999998667, 0.9999998223, 0.9999997631, 0.9999997174, 0.9999996676, 0.9999996160, 0.9999995670, 0.9999995169, 0.9999994667, 0.9999994169, 0.9999993668, 0.9999993167, 0.9999992667, 0.9999992167, 0.9999991667, 0.9999991167, 0.9999990667, 0.9999990167, 0.9999989667, 0.9999989167, 0.9999988667, 0.9999988167, 0.9999987667, 0.9999987167, 0.9999986667, 0.9999986167, 0.9999985667, 0.9999985167, 0.9999984667, 0.9999984167, 0.9999983667, 0.9999983167, 0.9999982667, 0.9999982167, 0.9999981667, 0.9999981167, 0.9999980667, 0.9999980167, 0.9999979667, 0.9999979167, 0.9999978667, 0.9999978167, 0.9999977667, 0.9999977167, 0.9999976667, 0.9999976167, 0.9999975667, 0.9999975167, 0.9999974667, 0.9999974167, 0.9999973667, 0.9999973167, 0.9999972667, 0.9999972167, 0.9999971667, 0.9999971167, 0.9999970667, 0.9999970167, 0.9999969667, 0.9999969167, 0.9999968667, 0.9999968167, 0.9999967667, 0.9999967167, 0.9999966667, 0.9999966167, 0.9999965667, 0.9999965167, 0.9999964667, 0.9999964167, 0.9999963667, 0.9999963167, 0.9999962667, 0.9999962167, 0.9999961667, 0.9999961167, 0.9999960667, 0.9999960167, 0.9999959667, 0.9999959167, 0.9999958667, 0.9999958167, 0.9999957667, 0.9999957167, 0.9999956667, 0.9999956167, 0.9999955667, 0.9999955167, 0.9999954667, 0.9999954167, 0.9999953667, 0.9999953167, 0.9999952667, 0.9999952167, 0.9999951667, 0.9999951167, 0.9999950667 # (i) Extinction values: p1=p2=p3=0.2 led to extinction; # (ii) Stable Population values: p1=p2=p3 = .3333 leads to stable population; # (iii) Population Explosion Values: p1 = p2 = p3 = 0.9 led to population explosion;