我正在使用区域方案拟订语言。
我最近走过了以下几句:
- Suppose there is a pond with 100 fish
- Each day, there is a 5% chance that population of the pond increases by 5% of its current population
- A 5% chance that the population of the pond decreases by 5% of its current population a 90% chance that the population of the pond stays the same
I wrote some R code to represent the size of the pond over 1000 days:
set.seed(123)
n_days <- 1000
pond_population <- rep(0, n_days)
pond_population[1] <- 100
for (i in 2:n_days) {
prob <- runif(1)
if (prob <= 0.05) {
pond_population[i] <- pond_population[i-1] + round(pond_population[i-1] * 0.05)
} else if (prob > 0.05 && prob <= 0.10) {
pond_population[i] <- pond_population[i-1] - round(pond_population[i-1] * 0.05)
} else {
pond_population[i] <- pond_population[i-1]
}
}
plot(pond_population, type = "l", main = "Pond Population Over Time", xlab = "Day", ylab = "Population")
My Question: I am curious about the following modification to this problem - suppose each day you catch 10 distinct fish from this pond, tag these fish, and then put them back into the pond. Naturally, it is possible that some days you will catch fish that you previously caught in the past - and it is also possible that some of the fish you caught in the past will die. After you have finished fishing on the 1000th day - what percent of the current fish pond population will be known to you?
我有兴趣了解如何起草一个模拟程序来回答这一问题,我已经写道,每天可以跟踪鱼类池群的规模以及你已经看到的鱼体内的个人鱼体(例如,想象每个鱼类是否被分配了独特的鱼体)。
我不肯定如何开始这一问题——我认为我可能不得不为这一问题使用“障碍”或“频率”,但我不熟悉这些概念,也不熟悉这些概念。
请允许我向我说明如何这样做?
感谢!