1. What is the probability of rolling 12 on three six-sided dice?

die <- 1:6
dice <- expand.grid(
  first = die,
  second = die,
  third = die
)
dice_sums <- rowSums(dice)
round(length(dice_sums[dice_sums == 12])/length(dice_sums), digits = 4)
## [1] 0.1157

2. What is the probability that a customer is male and lives in ‘Other’ OR is female and lives in ‘Other’?

df <- data.frame(
    Residence = c("Apartment", "Dorm", "With Parent(s)", "Sorority/Fraternity House", "Other"),
    Males = c(200, 200, 100, 200, 200),
    Females = c(300, 100, 200, 100, 100)
)
 other <- rowSums(df[,2:3])[5]
 total <- sum(colSums(df[,2:3]))
 round(other / total, 4)
## [1] 0.1765

3. Two cards are drawn without replacement from a standard deck of 52 playing cards. What is the probability of choosing a diamond for the second card drawn, if the first card, drawn without replacement, was a diamond?

The probability of drawing two cards from a deck is the probability of drawing the first card multiplied by the probability of drawing the second card.

P_dia_1 = 13/52
P_dia_2 = 12/51
round(P_dia_1 * P_dia_2, 4)
## [1] 0.0588

4. A coordinator will select 10 songs from a list of 20 songs to compose an event’s musical entertainment lineup. How many different lineups are possible?

Order matters, so we’re calculating a permutation. We should assume from the language of the question that repeats aren’t allowed in the list.

factorial(20)/factorial(20-10)
## [1] 670442572800

5. You are ordering a new home theater system that consists of a TV, surround sound system, and DVD player. You can choose from 20 different TVs, 20 types of surround sound systems, and 18 types of DVD players. How many different home theater systems can you build?

If a home theater system consists of one item from each type, that means we have 20 options for the first item, 20 options for the second item, and 18 options for the third item.

20 * 20 * 18
## [1] 7200

6. A doctor visits her patients during morning rounds. In how many ways can the doctor visit 10 patients during the morning rounds?

There are 10 different patients the doctor can visit first, which means there are 9 patients the doctor can visit second, 8 patients she can visit third, and so on. This is a factorial problem.

factorial(10)
## [1] 3628800

7. If a coin is tossed 7 times, and then a standard six-sided die is rolled 3 times, and finally a group of four cards are drawn from a standard deck of 52 cards without replacement, how many different outcomes are possible?

A coin flip has two possible outcomes, and six-sided die has six possible outcomes, and a deck has 52 outcomes for the first card, 51 outcomes for the second card, 50 outcomes for the third card, and 49 outcomes for the fourth card.

2^7 * 6^3 * 52 * 51 * 50 * 49
## [1] 179640115200

8. In how many ways may a party of four women and four men be seated at a round table if the women and men are to occupy alternate seats.

The first seat can have either a man or a woman. In either case, there are four options. In the next chair, there will also be four options for whichever gender wasn’t seated first. The third and fourth chairs will each have three options, and so on. This is a square of factorials.

factorial(4)^2
## [1] 576

9. An opioid urinalysis test is 95% sensitive for a 30-day period, meaning that if a person has actually used opioids within 30 days, they will test positive 95% of the time P( + |User) =.95. The same test is 99% specific, meaning that if they did not use opioids within 30 days, they will test negative P( - | Not User) = .99. Assume that 3% of the population are users. Then what is the probability that a person who tests positive is actually a user P(User | +)?

\[ P(+ \mid \text{User}) = 0.95 \\ P(- \mid \text{User}^c) = 0.99 \\ P(\text{User}) = 0.03 \\ P(\text{User} \mid +) = \frac{P(+ \mid \text{User}) P(\text{User})}{P(+)} \\ P(+) = P(+ \mid \text{User}) P(\text{User}) + P(+ \mid \text{User}^c) P(\text{User}^c) \]

For the purposes of writing variable names in R, I will use the following conventions: - p denotes probability - u denotes user - n denotes non-user - o denotes a positive test result - m denotes a negative (minus) test result - g denotes given

pogu <- 0.95
pmgn <- 0.99
pogn <- 1-pmgn
pu <- 0.03
pn <- 1-pu
po <- pogu*pu+pn*pogn
pugo <- round(pogu*pu/po, 4)
pugo
## [1] 0.7461

\(P(User \mid +) = 0.7461\)

10. You have a hat in which there are three pancakes. One is golden on both sides, one is brown on both sides, and one is golden on one side and brown on the other. You withdraw one pancake and see that one side is brown. What is the probability that the other side is brown? Explain.

There are a total of six sides across three pancakes - three brown, three gold. If we see one brown side, we know right away that we are looking at one of the two pancakes that has at least one brown side (called BG and BB). The reveal that we are looking at a brown side reduces our total possibilities down to three - we’re either looking at BB side 1, BB side 2, or the brown side of BG. If the pancake is BG, the other side cannot be brown, but if the pancake is BB we have two scenarios where the other side could be brown. Therefore, the probability that the other side is brown is \(\frac{2}{3}=0.\overline{6}\).