Ex. 18, P.199

18 A baker blends 600 raisins and 400 chocolate chips into a dough mix and, from this, makes 500 cookies.

  1. Find the probability that a randomly picked cookie will have no raisins.

X - number of rasins in the cookie

p(rasin in a cookie) = 1/500

n = 600

lambda = n*p = 600/500

P(X=0) = e^-lambda

exp(-600/500)
## [1] 0.3011942
  1. Find the probability that a randomly picked cookie will have exactly two chocolate chips.

Y - number of chocolate chips in the cookie

p(rasin in a cookie)1/500

n = 400

lambda = 400/500

P(Y=2) = e^-lambda*lambda^2/2!

(exp(-400/500)*(400/500)^2)/factorial(2)
## [1] 0.1437853
  1. Find the probability that a randomly chosen cookie will have at least two bits (raisins or chips) in it.

p=1/500

n=1000

lambda = n*p = 1000/500 = 2

P (X >= 2) = 1 - P(X<=1) = 1 - Fx(1)

1- ppois(1, lambda = 2)
## [1] 0.5939942