Chapter 5, Problem 14:
On the average, only 1 person in 1000 has a particular rare blood type.
Solution:
Part a
Using the Poisson Distribution:
p <- 1 / 1000
n_a <- 10000
lambda_a <- n_a * p
P_a <- dpois(0, lambda_a)
P_a
## [1] 4.539993e-05
Part b
Using the binomial distribution:
n_upper_bound <- 2000 # it's unlikely to be more than a few thousands for the given probability
# sequence of potential n values
n_values <- seq(1, n_upper_bound)
# cumulative p of NOT finding a person with the rate blood type (P of 0 successes in n trials)
cumulative_probs <- pbinom(0, size = n_values, prob = p)
# finding first n for the required p (first n for cumulative P of 0 successes is less than 1/2)
n_required <- which(cumulative_probs < 0.5)[1]
n_required
## [1] 693