1. A box contains 54 red marbles, 9 white marbles, and 75 blue marbles. If a marble is randomly selected from the box, what is the probability that it is red or blue? Express your answer as a fraction or a decimal number rounded to four decimal places.
# Probability red
pr <- 54 / (54 + 9 + 75)
# Probability white
pw <- 9 / (54 + 9 + 75)
# Probability blue
pb <- 75 / (54 + 9 + 75)
# P(red or blue) = P(red) + P(blue)
round(pr + pb, 4)
## [1] 0.9348
2. You are going to play mini golf. A ball machine that contains 19 green golf balls, 20 red golf balls, 24 blue golf balls, and 17 yellow golf balls, randomly gives you your ball. What is the probability that you end up with a red golf ball? Express your answer as a simplified fraction or a decimal rounded to four decimal places.
# Probability red
pr <- 20 / (19 + 20 + 24 + 17)
round(pr, 4)
## [1] 0.25
3. A pizza delivery company classifies its customers by gender and location of residence. The research department has gathered data from a random sample of 1399 customers. The data is summarized in the table below.
What is the probability that a customer is not male or does not live with parents? Write your answer as a fraction or a decimal number rounded to four decimal places.
# Total number of males and females
n <- 81 + 116 + 215 + 130 + 129 + 228 + 79 + 252 + 97 + 72
# The only combination which does not satisfy either "not male"
# or "not living with parents" are males living with their parents
p03 <- (n - 215)/n
round(p03, 4)
## [1] 0.8463
4. Determine if the following events are independent. Going to the gym. Losing weight. Answer: A) Dependent B) Independent
A (Dependent). Unless of course, you go to the gym and don’t exercise. Unless perhaps you ride your bike to the gym.
5. A veggie wrap at City Subs is composed of 3 different vegetables and 3 different condiments wrapped up in a tortilla. If there are 8 vegetables, 7 condiments, and 3 types of tortilla available, how many different veggie wraps can be made?
# Number of ways you can choose 3 vegetables from 8 vegetable options
v <- choose(8, 3)
# Number of ways you can choose 3 condiments from 7 condiment options
c <- choose(7, 3)
# number of ways you can choose a tortilla from 3 tortilla options
t <- choose(3, 1)
# Number of total possible combinations
v * c * t
## [1] 5880
6. Determine if the following events are independent. Jeff runs out of gas on the way to work. Liz watches the evening news. Answer: A) Dependent B) Independent
B (Independent) Unless of course Jeff and Liz are married, and somehow his running out of gas on the way to work makes it more likely Liz watches evening news. Let’s say Jeff works late because he missed work in the morning handling his gas situation, and Liz never watches the evening news when Jeff is home because Jeff hates it, then she might watch it solely because Jeff is still at work, in which case they would not be independent.
7. The newly elected president needs to decide the remaining 8 spots available in the cabinet he/she is appointing. If there are 14 eligible candidates for these positions (where rank matters), how many different ways can the members of the cabinet be appointed?
# Because rank matters, this is a permutations question 14 P 8
factorial (14) / factorial (14-8)
## [1] 121080960
8. A bag contains 9 red, 4 orange, and 9 green jellybeans. What is the probability of reaching into the bag and randomly withdrawing 4 jellybeans such that the number of red ones is 0, the number of orange ones is 1, and the number of green ones is 3? Write your answer as a fraction or a decimal number rounded to four decimal places.
# Combinations of 0 red out of 9
r <- choose(9, 0)
# Combinations of 1 orange out of 4
o <- choose(4, 1)
# Combinations of 3 green out of 9
g <- choose(9, 3)
# Multiply combinations together and divide by all possible combinations
dc <- r * o * g
all <- choose((9 + 4 + 9), 4)
# Probability of 1 orange and 3 green when seleting 4 from 22
round(dc/all, 4)
## [1] 0.0459
9. Evaluate the following expression. \(\frac{11!}{7!}\)
factorial (11) / factorial (7)
## [1] 7920
10. Describe the complement of the given event. 67% of subscribers to a fitness magazine are over the age of 34.
Compliment: 33% of subscribers to a fitness magazine are 34 or younger.
11. If you throw exactly three heads in four tosses of a coin you win $97. If not, you pay me $30.
Step 1. Find the expected value of the proposition. Round your answer to two decimal places.
v <- pbinom(3, size=4, prob=0.5) - pbinom(2, size=4, prob=0.5)
v
## [1] 0.25
Step 2. If you played this game 559 times how much would you expect to win or lose? (Losses must be entered as negative.)
# Probability of not tossing exactly 3 heads
n <- 1 - v
# Winnings for 559 plays
559 * ((v*97) - (n*30))
## [1] 978.25
12. Flip a coin 9 times. If you get 4 tails or less, I will pay you $23. Otherwise you pay me $26. Step 1. Find the expected value of the proposition. Round your answer to two decimal places.
v <- pbinom(4, size=9, prob=0.5)
v
## [1] 0.5
Step 2. If you played this game 994 times how much would you expect to win or lose? (Losses must be entered as negative.)
# Probability of not tossing 4 tails or less
n <- 1 - v
# Winnings for 994 plays
994 * ((v*23) - (n*26))
## [1] -1491
13. The sensitivity and specificity of the polygraph has been a subject of study and debate for years. A 2001 study of the use of polygraph for screening purposes suggested that the probability of detecting a liar was .59 (sensitivity) and that the probability of detecting a “truth teller” was .90 (specificity). We estimate that about 20% of individuals selected for the screening polygraph will lie.
a. What is the probability that an individual is actually a liar given that the polygraph detected him/her as such? (Show me the table or the formulaic solution or both.)
# Chance that someone selected for polygraph is lying
liar <- 0.2
# Chance that the sensitivity test will detect a liar
det <- 0.59
# Chance that someone who's lying will be detected as a liar
liar * det
## [1] 0.118
b. What is the probability that an individual is actually a truth-teller given that the polygraph detected him/her as such? (Show me the table or the formulaic solution or both.)
# Chance that someone selected for polygraph is being truthful
tf <- 0.8
# Chance that the specificity test will detect truth-telling
det <- 0.9
# Chance that someone who's lying will be detected as a liar
tf * det
## [1] 0.72
c. What is the probability that a randomly selected individual is either a liar or was identified as a liar by the polygraph? Be sure to write the probability statement.
# Chance that someone selected for polygraph is lying
liar <- 0.2
# Chance that the sensitivity test will detect a liar
det <- 0.59
# Chance that someone who's lying will be detected as a liar
liar * det
## [1] 0.118
# Chance that someone is a liar or the sensitivity test
# will identify them as a liar minus the intersection of
# someone who is a liar who was also detected as a liar;
# P(liar) + P(detected as liar) - P(is a liar and is detected as a liar)
p13c <- liar + det - (liar * det)
p13c
## [1] 0.672