What is the probability of rolling a sum of 12 on three rolls of six-sided dice? Express your answer as a decimal number only.
Assuming order matters. Sample size 6^3 = 216. Possible combinations to add up to 12 = { (651)x6 , (641)x6 , (633)x3, (543)x6, (525)x3, (444)x1 } for a total of 25 possible ordered outcomes.
A newspaper company classifies its customers by gender and location of residence. What is the probability that a customer is male and lives in ‘Other’ or is female and lives in ‘Other’? Express your answer as a decimal number only.
Sample space: Total Males = 900 Total Females = 800
P(male) & P(other) + P(female) & P(other)
= 9/17 * 2/9 + 8/17 * 1/8
(9/17 * 2/9) + (8/17 * 1/8)
## [1] 0.1764706
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? Express your answer as a decimal number only.
Without replacement there is one less diamond and one less card in the deck so P(second is diamond | first is diamond) is:
12/51
## [1] 0.2352941
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 this is a permutation: P(20,10)
factorial(20) / factorial(20 - 10)
## [1] 670442572800
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?
this one is as simple as: sample space = 20 x 20 x 18
20*20*18
## [1] 7200
A doctor visits her patients during morning rounds. In how many ways can the doctor visit 10 patients during the morning rounds?
each of patients in the set of 10 will get visited. This is as simple as 10!
factorial(10)
## [1] 3628800
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?
(2^7) * (6^3) * (52*51*50*49)
## [1] 179640115200
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?
Thought process: Fix one M/W’s seat, the other three of that gender have 3 possible seats.
```{factorial(3)*factorial(4)}
## Problem 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. What is the probability that a person who tests positive is actually a user P(User\|+)? You may use a tree, table, or Bayes to answer this problem.
*BAYES: P(User \| +) = (P(+ \| User) \* P(User)) / P(+)*
*P(+ \| User) = .95*
P(User) = .03
P(+) = P(+\|User)*P(User) + P(+\|Not User)*\*P(Not User)
= .95\*.03 + .01\*.97
``` r
p_pos <- (0.95 * 0.03) + (0.01 * 0.97)
p_pos
## [1] 0.0382
p_user_given_pos <- (0.95 * 0.03) / p_pos
p_user_given_pos
## [1] 0.7460733
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?
P(brown1 | brown2)
There are 3 kinds of pancakes, each equally likely: gold/gold, brown/brown, and gold/brown. A brown/brown pancake will always show you a brown side, but a gold/brown one only shows brown half the time. Since I saw brown, it’s more likely I grabbed the brown/brown pancake than the mixed one, so the probability the other side is also brown is 2/3, not 1/2.
p_bb <- (1/3); p_gb <- (1/3)
p_brown <- p_bb*1 + p_gb*0.5
p_other_brown <- (p_bb*1) / p_brown
p_other_brown
## [1] 0.6666667