n = 20 k = 2 M = NULL ## Consider different success probabilities. for (p in c(0.01, 0.1, 0.2, 0.3, 0.4, 0.5)) { ## The probability from the normal approximation. N = 1 - pnorm((k-n*p)/sqrt(n*p*(1-p))) ## The probability from the Poisson approximation. P = 1 - ppois(k, n*p) ## The exact value from the binomial distribution. B = 1 - pbinom(k, n, p) M = rbind(M, c(p, B, N, P, (N-B)/B, (P-B)/B)) } print(round(M, 3))