the initial number of kangaroo is 40, the population of kangaroo decays with a decay rate of p per week

a)write a program to compute the number of kangaroo remaining after 1 week , 2 week and so on up tp 52 weeks, based on p = 0.02,
should treat this as a simulation and not as a theoretical calculation.
present the data as a bar plot

b)modify the code from a) to plot the number of remaining kangaroo as circles, superimpose on this data the analytic result
N(t) = N *e^(-p*t)
N(t)---number of remaining at time t
N------initial number
p------decay constant

c)modify the program from a) to compute the time required for half kangaroo to be dead

d)enclose ur program from c)in a loop to run many realisations, this will enable u to obtain a statistically useful value of t.


here is my code

p = 0.02;
I = 40;
t = 0:52;
R = round(I*(1-0.02).^t);

wtf is simulation but not theoretical calculation???how am i supposed to simulate it?

N0 = 40;
p = 0.02;
t = 0:52;
N = round(N0*exp(-p*t));
hold on

what should i pick for p(decay constant)? can i use the same p from a) or make 1 up? otherwise how can i solve it?

p = 0.02;
I = 40;
t = 0;
R = 40;
while R >= 20
R = round(I*(1-0.02).^t);
disp([t R])

dont have much problems with this part

have no ideas at all!!!no matter how many time i tried, it gave me the same solution.or am i missing something?
what is the "loop" in the question supposed to be? for loop? while loop?

thank you