Pg 200, Q22

Assume that we are making raisin cookies. We put a box of 600 raisins into our dough mix, mix up the dough, then make from the dough 500 cookies. We then ask for the probability that a randomly chosen cookie will have 0, 1, 2, . . . raisins. Consider the cookies as trials in an experiment, and let X be the random variable which gives the number of raisins in a given cookie. Then we can regard the number of raisins in a cookie as the result of n = 600 independent trials with probability p = 1/500 for success on each trial. Since n is large and p is small, we can use the Poisson approximation with λ = 600(1/500) = 1.2. Determine the probability that a given cookie will have at least 5 raisins.

\[ P(X=x)=\frac{\lambda^{x}e^{-\lambda}}{x!} \\ E[X]=\lambda \\ Var[X]=\lambda \]

lambda <- 1.2

# Probability of a cookie with at least 5 raisins = P(X>=5) = 1-P(X<5)
prob_poiss <- 1-sum(dpois(x=0:4, lambda))
cat("The probability is: ", prob_poiss)
## The probability is:  0.007745788