With a total number of N
, a daily death rate: p1
. I would like to calculate the number of survivors after certain days.
day1 : N - N*p1
day2 : (N - N*p1) - (N - N*p1)*p1
day3 : ((N - N*p1) - (N - N*p1)*p1) - ((N - N*p1) - (N - N*p1)*p1)*p1
...
This is what I have done so far to start to get the number of day 1. Suggestions would be appreciated.
df <- data.frame(day = c(1:30))
N <- 1000
p1 <- 0.06
apply(df,1, function(x) N-N*p1)