a Galton-Watson riddle
The Riddler of this week has an extinction riddle which summarises as follows:
One observes a population of N individuals, each with a probability of 10⁻⁴ to kill the observer each day. From one day to the next, the population decreases by one individual with probability
K√N 10⁻⁴
What is the value of K that leaves the observer alive with probability ½?
Given the sequence of population sizes N,N¹,N²,…, the probability to remain alive is
where the sum stops with the (sure) extinction of the population. Which is the moment generating function of the sum. At x=1-10⁻⁴. Hence the problem relates to a Galton-Watson extinction problem. However, given the nature of the extinction process I do not see a way to determine the distribution of the sum, except by simulation. Which returns K=27 for the specific value of N=9.
[sourcecode language=”r” gutter=”false”]
N=9
K=3*N
M=10^4
vals=rep(0,M)
targ=0
ite=1
while (abs(targ-.5)>.01){
for (t in 1:M){
gen=vals[t]=N
while (gen>0){
gen=gen-(runif(1)<K*sqrt(gen)/10^4)
vals[t]=vals[t]+gen}
}
targ=mean(exp(vals*log(.9999)))
print(c(as.integer(ite),K,targ))
if (targ<.5){ K=K*ite/(1+ite)}else{
K=K/(ite/(1+ite))}
ite=ite+1}
[/sourcecode]
The solution proposed on The Riddler is more elegant in that the fixed point equation is
with a solution around K=27.
December 30, 2016 at 12:10 pm
[…] leave a comment for the author, please follow the link and comment on their blog: R – Xi’an’s Og.R-bloggers.com offers daily e-mail updates about R news and tutorials on topics such as: Data […]
December 30, 2016 at 11:54 am
[…] article was first published on R – Xi'an's Og, and kindly contributed to […]