> #OK to post Homework > #Timothy Nasralla, 9/6/21, Homework 1 > #For question 2, I wrote the equation found in question 1 in a recursive format that calculates the number of females birthed per year based on probabilities, the initial amount of females who can give birth, and the time passed. ; > F := proc(c0, c1, c2, p0, p1, p2, n) option remember; if n = 0 then c0; elif n = 1 then c1; elif n = 2 then c2; else expand(p0*F(c0, c1, c2, p0, p1, p2, n - 1) + p1*F(c0, c1, c2, p0, p1, p2, n - 2) + p2*F(c0, c1, c2, p0, p1, p2, n - 3)); end if; end proc; > #For question 3, since c0 = c1 = c2 = 1, meaning there are 3 females, I tested the probabilities where p1=p2=p3 and started with 1/3 probability. This led to a stable population. ; > F(1, 1, 1, 1/3, 1/3, 1/3, 100); 1 ; > F(1, 1, 1, 1/3, 1/3, 1/3, 90); 1 ; > F(1, 1, 1, 1/3, 1/3, 1/3, 110); 1 ; > #When p > 1/3, the population increased dramatically and eventually exploded. ; > F(1, 1, 1, 0.35, 0.35, 0.35, 100); 11.21045116 ; > F(1, 1, 1, 0.37, 0.37, 0.37, 100); 180.1832529 ; > F(1, 1, 1, 0.40, 0.40, 0.40, 100); 9277.369156 ; > F(1, 1, 1, 0.40, 0.40, 0.40, 90); 3675.512923 ; > F(1, 1, 1, 0.40, 0.40, 0.40, 110); 23417.02514 ; > #When p < 1/3, the population declined until virtual extinction. ; > F(1, 1, 1, 0.31, 0.31, 0.31, 100); 0.02847413326 ; > F(1, 1, 1, 0.29, 0.29, 0.29, 100); 0.001122348542 ; > F(1, 1, 1, 0.27, 0.27, 0.27, 100); 0.00003646262147 ; > #So, 3i is < 1/3, 3ii is = 1/3, and 3iii is > 1/3 ;