Chapter 5 Important Distribution and Densities : Exercise 22

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.

Let X be the number of raisin in the cookie.

if X has a Poisson distribution, then success is probability that raisin will be in cookie.

p=1/500

n=600

\[\lambda\ = n.p = 600/500\] \[P(X=0)=e^-\lambda\ \lambda^k / k! \] \[\begin{equation} P(X=0)= e^{-1.2} * (1.2)^0 / 0! \end{equation}\]
ppois(0, lambda = 1.2)
## [1] 0.3011942
  1. Find the probability that a randomly picked cookie will have exactly two chocolate chips.

Let Y be the number of chocolate chips in the cookie.

if Y has a Poisson distribution, then success is probability that chocolate chip will be in cookie.

p=1/500 n=400

\[ \lambda\ _y = n.p = 400/500 \]

\[ P(Y=2)=e^-\lambda\ _Y \lambda^2 _Y / 2! \]

(exp(-0.8) * 0.8^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.

1000 bits in 500 cookies means an average of 2 bits per cookies

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

p=1/500 n=1000

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