(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.

r <- 54
w <- 9
b <- 75
prob_rb <- round((r+b)/(r+w+b), 4)
prob_rb
## [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.

g <- 19
r <- 20
b <- 24
y <- 17
prob_r <- round((r)/(g+r+b+y), 4)
prob_r
## [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.

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.

# Females + Not living with parents - (Females not living with parents)
Total <- 1399
Females<- (228 + 79 + 252 + 97 + 72)
Not_living_w_parents<- (1399 - (215 + 252))
FNot_living_w_parents <- (728 - 252)
Prob <- round((Females + Not_living_w_parents - FNot_living_w_parents)/Total, 4)
Prob
## [1] 0.8463

(4)

Determine if the following events are independent. Going to the gym. Losing weight.

  1. Dependent B) Independent

Answer: A) Dependent - These events are dependent.

(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?

veggie <- 8
condiments <- 7
tortilla <- 3
veggie_combo <- choose(veggie, 3)
condiments_combo <- choose(condiments, 3)
wraps <- veggie_combo * condiments_combo * tortilla
wraps
## [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.
A) Dependent B) Independent

Answer: Those two events are independant from each other.

(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?

\(P(n,r) = \frac{n!}{(n-r)!}\)

p <- function(n, r){
  return (factorial(n)/factorial(n-r))
}

cabinet <- p(14, 8)
cabinet
## [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. P(o) - probability of orange P(g) - probability of green P(r) - probability of red

r <- 9
o <- 4
g <- 9
total <- (r+o+g)

Prob_1o_3g <- round((choose(r, 0) * choose(o, 1) * choose(g, 3) / choose(total, 4)), 4)
Prob_1o_3g
## [1] 0.0459

(9)

Evaluate the following expression.

\(\frac{11!}{7!}\)

ans <- factorial(11)/factorial(7)
ans
## [1] 7920

(10)

Describe the complement of the given event.
67% of subscribers to a fitness magazine are over the age of 34.

Answer: Based on above satement randomly chosen subscriber being over the age of 34 is 0.67.
And the complement of that is 1-0.67, which is approximately 0.33. This means probability of randomly chosen subscriber is 34 or less is 33% or 0.33

p_above34 <- 0.67
p_34_or_less <- 1 - p_above34
p_34_or_less
## [1] 0.33

(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.

prob_3heads <- pbinom(3, size = 4, prob = 0.5) - pbinom(2, size = 4, prob = 0.5)
comp <- 1 - prob_3heads
exp_val <- round(prob_3heads * 97 - comp * 30, 2)
exp_val
## [1] 1.75

Step 2. If you played this game 559 times how much would you expect to win or lose? (Losses must be entered as negative.)

win <- exp_val * 559
print(paste0('$', win))
## [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.

prob_4orless_tail <- pbinom(4, size = 9, prob = 0.5)
comp <- 1 - prob_4orless_tail
exp_val <- round(prob_4orless_tail * 23 - comp * 26, 2)
exp_val
## [1] -1.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.)

lose <- exp_val * 994
print(paste0('money lost $',-(lose)))
## [1] "money lost $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.

liar <- 0.2
truth_teller <- 0.8
liar_sensitivity <- 0.59
truth_sensitivity <- 0.9
  1. 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.)
P_pos_det_liar <- liar * liar_sensitivity
p_false_det_liar <- truth_teller * (1-truth_sensitivity)

Prob_det_liar_given_liar <- P_pos_det_liar / (P_pos_det_liar + p_false_det_liar)
round(Prob_det_liar_given_liar, 4)
## [1] 0.596
  1. 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.)
p_pos_det_truth <- truth_teller * truth_sensitivity
p_false_det_truth <- liar * (1 - liar_sensitivity)

prob_det_truth_given_truth <- p_pos_det_truth / (p_pos_det_truth + p_false_det_truth)
round(prob_det_truth_given_truth, 4)
## [1] 0.8978
  1. 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.
prob_random_liar <- liar + p_false_det_liar
prob_random_liar
## [1] 0.28

There is a 0.28 probability that a randomly selected individual is either a liar or was identified as a liar by the polygraph.