Dsaxton cevabı bir tamamlayıcı olarak, burada örnekleme dağılımını gösteren R bazı simülasyonları q k = 10 ve q, 0 = 0.02 :q^k=10q0=0.02
n_replications <- 10000
k <- 10
failure_prob <- 0.02
n_trials <- k + rnbinom(n_replications, size=k, prob=failure_prob)
all(n_trials >= k) # Sanity check, cannot have 10 failures in < 10 trials
estimated_failure_probability <- k / n_trials
histogram_breaks <- seq(0, max(estimated_failure_probability) + 0.001, 0.001)
## png("estimated_failure_probability.png")
hist(estimated_failure_probability, breaks=histogram_breaks)
abline(v=failure_prob, col="red", lty=2, lwd=2) # True failure probability in red
## dev.off()
mean(estimated_failure_probability) # Around 0.022
sd(estimated_failure_probability)
t.test(x=estimated_failure_probability, mu=failure_prob) # Interval around [0.0220, 0.0223]
E gibi görünüyor [değişkenliğe oldukça küçük bir eğilim görecelidir, q .E[q^]≈0.022q^