Question 14 page 199

On average, only 1/1000 has a particular rare blood type.

  1. Find the probability that, in a city of 10,000 people no one has this blood type

We can use the Poisson distribution to calculate this probability using

\[ p(X = k) \approx \frac {\lambda^{k}}{k!} \cdot e^{-\lambda} \] \[ p(X = 0) \approx \frac {\lambda^{k}}{k!} \cdot e^{-\lambda} \\ \lambda = 10,000(1/1000) \Rightarrow \lambda = 10 \\ p(X = 0) \approx \frac {10^{0}}{0!} \cdot e^{-10}\\ p(X = 0) \approx 1 \cdot e^{-10} \\ p(X = 0) \approx 0.0000454 \]

lambda <- 10000 * (1/1000)
k <- 0

q14a <- (lambda ** k / factorial(k)) * exp(1) ** -10

q14a
## [1] 4.539993e-05
# alternative way using ppois function
ppois(k, lambda)
## [1] 4.539993e-05
  1. How many people would have to be tested to give a probability greater than 1/2 of finding at least one person with this blood type?

We are looking to solve for the number of people such that

\[ e^{-\lambda} = e^{-0.001n} \\ e^{-0.001n} > 0.5 \\ -0.001n > \ln(0.5) \\ n < \frac{\ln(0.5)}{-0.001} \\ n < 694 \]

where \(n\) is the number of people needed to get a probability of at least one person with the this blood type greater than 0.5.

We can check to see if this is correct using the ppois function with \(\lambda = 0.001 * 693\) and we get p = 0.5000736

k <- 0
lambda = 693 * (1/1000)

ppois(k, lambda)
## [1] 0.5000736