% DeathProcess.m simulates the 'pure death process'. Starting with % nstart individuals, each having probability p of dieing in each % time step, we continue until all have died. The population size % is plotted over time and compared to the deterministic model % for expected population size. % parameters nstart=50; p=0.02; % initialize variables for current population size nnow=nstart; nbarnow=nstart; t=0; % initialize vectors storing the results over time nt=nstart; nbar=nstart; tvals=0; while nnow>0; % update the stochastic population m=rand(nnow,1); ndie=sum(m