Page 88 #4
To calculate this, we first calculate the probabailities that presidents all died on different days. We then use the complement to calculate the probability that they died on the same date.
89.1% probability that at least 2 presidents died on same date. I would have a good chance of winning a bet,
# total number of days in a year
days_in_year <- 365
# total number of deceased presidents
presidents_deceased <- 40 # 6 of 46 presidents alive
# use prod() to calculate the probability of all dying on different days for all 40 presidents
probability_different_days <- prod((days_in_year - (0:(presidents_deceased - 1))) / days_in_year)
# calculate the probability of at least 2 dying on the same day using compliment
probability_same_day <- 1 - probability_different_days
# Print the probability
print(probability_same_day)
## [1] 0.8912318