Chapter 5. (Page 210) Question 22 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 five raisins.
Solution:
Firstly, I would like to clarify that this a poisson distribution.
Secondly, we need to calculate the possibility of the cookie with 0 raisin (\(P(x=0)\)), 1 raisin(\(P(x=1)\)), 2 rainsins (\(P(x=2)\)), 3 raisins(\(P(x=3)\)), and 4 raisns(\(P(x=4)\)) using dpois function. Then, we add the possibility together \(P(X<5)\) using a sum function.
calculate the sum of possibilities of x = 0, 1, 2, 3, 4
lambda <- 1.2
p_less_than_5 <- sum(dpois(x=0:4, lambda =1.2))
p_less_than_5
## [1] 0.9922542
Finally, we calculate the possibility of cookie with at least 5 raisins. P(X>=5) = 1 minus P(X<5)
1-sum(dpois(x=0:4, lambda =1.2))
## [1] 0.007745788
Therefore, the probability that a given cookie will have at least five raisins is 0.007745788.