Code
n <- 400; p <- 0.01
sigma <- sqrt(n * p * (1 - p))
# |Y - 4| < 2(1.99) means 0.02 < Y < 7.98, i.e. Y = 1, ..., 7
data.frame(quantity = c("E(Y) = np", "V(Y) = npq", "P(Y >= 9), binomial",
"P(Y >= 9), Poisson(4)", "Tchebysheff bound, k = 2",
"exact P(1 <= Y <= 7)"),
value = round(c(n * p, n * p * (1 - p), 1 - pbinom(8, n, p),
1 - ppois(8, 4), 1 - 1/2^2,
pbinom(7, n, p) - pbinom(0, n, p)), 4)) quantity value
1 E(Y) = np 4.0000
2 V(Y) = npq 3.9600
3 P(Y >= 9), binomial 0.0208
4 P(Y >= 9), Poisson(4) 0.0214
5 Tchebysheff bound, k = 2 0.7500
6 exact P(1 <= Y <= 7) 0.9318


