Chapter 3: The Logic of Uncertainty

Author

Zane Billings

Published

2022-12-09

options("scipen" = 9999, "digits" = 16)

Q1

What is the probability of rolling a 20 three times in a row on a 20-sided die?

Of course, we could again solve by simulation 😁.

set.seed(375)
n_sims <- 1000000
rolls <- tibble::tibble(
    roll1 = sample(1:20, n_sims, replace = TRUE),
    roll2 = sample(1:20, n_sims, replace = TRUE),
    roll3 = sample(1:20, n_sims, replace = TRUE)
)

with(rolls, mean(roll1 == 20 & roll2 == 20 & roll3 == 20))
[1] 0.000124

But I don’t want anyone to take away my math degree, so we can show the analytical solution as well. (Besides, this event is quite rare, so the simulation will need a lot of samples, as you can see, to converge.)

Since the probability of rolling a 20 on one die is \(\frac{1}{20}\), and the rolls are (assumed) independent, we can calculate \[P(\text{three 20's}) = \left( \frac{1}{20} \right)^3 = \frac{1}{8000} = 0.000125.\]

Q2

The weather report says there’s a 10 percent chance of rain tomorrow, and you forget your umbrella half the time you go out. What is the probability that you’ll be caught in the rain without an umbrella tomorrow?

If these two events are independent (which is kind of weird but seems to be what the question wants), we just multiply the two probabilities to get

\[P(\text{no umbrella} \cap \text{rain}) = (10\%) (50\%) = 5\%.\]

Q3

Raw eggs have a \(1/20000\) probability of having salmonella. If you eat two raw eggs, what is the probability you ate a raw egg with salmonella?

We have to use the inclusion-exclusion rule here to avoid double-counting, since the two eggs having salmonella are not mutually exclusive (they could both have salmonella). So we get \[\begin{align*} P(\text{ate a salmonella egg}) &= P(\text{egg one had salmonella}) + P(\text{egg two had salmonella}) \\ &\quad\quad -P(\text{both eggs had salmonella}) \\ &= \frac{1}{20000} + \frac{1}{20000} - \left(\frac{1}{20000}\right) ^2 \\ &= \frac{39,999}{400,000,000} \approx 0.009\%. \end{align*}\]

Q4

Note

What is the probability of either flipping two heads in two coin tosses or rolling three 6s in three six-sided dice rolls?

I hate how vaguely worded this question is, so I’ll list the assumptions that I think we are making.

We are doing one experiment that involves us flipping a coin twice (or flipping two coins) and also rolling a d6 three times (or rolling 3d6 one time). These two things are all mutually independent from each other, both coin flips are independent, and all three die rolls are independent. The die rolls and coin flips do not affect each other. Once we have done all of these things during the experiment, we want to know the probability that we flipped two heads OR (inclusize) we rolled three sixes.

So, we use inclusion-exclusion again. We get that

\[P(\text{two heads}) = \frac{1}{2}\cdot \frac{1}{2} = \frac{1}{4},\] \[P(\text{three sixes}) = \left(\frac{1}{6}\right)^3 = \frac{1}{216},\] and thus \[P(\text{two heads} \cup \text{three sixes}) = \frac{1}{4} + \frac{1}{216} - \frac{1}{4 \cdot 216} = \frac{219}{864} \approx 25.35\%.\]