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

Solution

Let’s represent as follows:

Description R W B Total
Marbles in a Box 54 9 75 138

Defining function that find the probability of a color based on total quantity!

P <- function(C, Total){
  p <- C / Total
  return(p)
}
Description R W B Total
Probabilities of being selected 0.3913 0.0652 0.5435 1.0000

Since the marble is randomly selected from the box and we want to know the probability of red or blue, we have as follows:

\[P(R \cup B) = P(R) + P(B)\] \(P(R \cup B)\) = 0.3913 + 0.5435

\(P(R \cup B)\) = 0.9348

Answer: The probability that the marble is red or blue is 0.9348 or 93.48%.

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

Solution

Let’s represent as follows:

Description G R B Y Total
Golf balls in the Machine 19 20 24 17 80

Defining function that find the probability of a color based on total quantity!

P <- function(C, Total){
  p <- C / Total
  return(p)
}
Description G R B Y Total
Probabilities of being selected 0.2375 0.2500 0.3000 0.2125 1.0000

Since the marble is randomly selected from the machine and we want to know the probability of red, we have as follows:

\[P(R) = \frac{\#\:Red\:golf\:balls}{Total\:number\:of\:golf\:balls\:in\:the\:machine}\]

\(P(R)\) = 0.25

Answer: The probability that the golf ball is a red is 0.25 or 25%.

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

Residence Males Females
Apartment 81 228
Dorm 116 79
With Parents(s) 215 252
Sorority/Fraternity House 130 97
Other 129 72

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.

Solution

Let’s calculate our totals as follows:

Residence Males Females Total
Apartment 81 228 309
Dorm 116 79 195
With Parents(s) 215 252 467
Sorority/Fraternity House 130 97 227
Other 129 72 201
Total 671 728 1399

Since we are being asked the probability that a customer is not male or does not live with parents, we have as follows:

\(P(Not\:Male) = 1 - P(Male)\)

\(P(Not\:living\:with\:parents)\) = 1 - \(P(living \: with \: parents)\)

\(P(Not\:Male \: \cup \: Not \: living \: With \: Parents) = (1 - P(Male)) + (1 - P(living\:with\:parents)) - (1 - P(Not \: Male \: \cap \: Not \: living\:With\:Parents\)

Answer: The probability that a customer is not male or does not live with parents is 0.5327 or 53.27%.

Problem 4

Determine if the following events are independent.

Solution

1. Going to the gym.

Answer: Independent

2. Losing weight.

Answer: Dependent

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

Solution

We can choose 56 different combinations for our vegetables.

We can choose 35 different combinations for our condiments.

We can choose 3 different combinations for our tortillas.

Answer: The wrap can be made in 5880 different ways.

Problem 6

Determine if the following events are independent.

Solution

Jeff runs out of gas on the way to work.

Answer: Dependent

Liz watches the evening news.

Answer: Independent

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

Solution

Table of positions:

C1 C2 C3 C4 C5 C6 C7 C8 Total
14 13 12 11 10 9 8 7 121080960

Answer: The members of the cabinet can be appointed in 121080960 different ways; but since rank matters the number of ways will be 3003 different ways.

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

Solution

Let’s represent as follows:

Description R O G Total
Jellybeans 9 4 9 22

Defining function that find the probability of a color based on total quantity!

Description R O G Total
Probabilities of being selected 0.4091 0.1818 0.4091 1.0000
Description Red_9C0 Orange_4C1 Green_9C3
Available to Choose from 9 4 9
Choose 0 1 3
Number of ways for selecting a jelly bean 1 4 84

Since we have to withdraw 4 jelly beans, the resulting probability of the output will be as follows:

Individual probability:

\(p = P(O) \times P(G) \times P(G) \times P(G)\)

Combined probability:

#p <- pO * pG * pG * pG # Individual probabilities
p <- ( choose(R, 0) * choose(O, 1) * choose(G, 3) ) / choose(R + O + G, 4) # Combined probabilities

Answer: 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 is 0.0459 or 4.59%.

Problem 9

Evaluate the following expression. \[\frac{11!}{7!}\]

Solution

\[\frac{11!}{7!}= \frac{11 \times 10 \times 9 \times 8 \times 7 \times 6 \times 5 \times 4 \times 3 \times 2 \times 1}{7 \times 6 \times 5 \times 4 \times 3 \times 2 \times 1}\]

\[\frac{11!}{7!}= 11 \times 10 \times 9 \times 8\]

Answer: \(\frac{11!}{7!}\) = 7920

Problem 10

Describe the complement of the given event.

\(67\%\) of subscribers to a fitness magazine are over the age of \(34\).

Solution

\(p(Age > 34) = 0.67\)

\(p(Age \le 34) = 1 - p(Age > 34)\)

\(p(Age \le 34) = 1 - 0.67\)

\(p(Age \le 34) = 0.33\)

Answer: \(33\%\) of subscribers to a fitness magazine are under or equal the age of \(34\).

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

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

Solution

1. Find the expected value of the proposition. Round your answer to two decimal places.

By assuming that it is a fair coin and by applying Bernoulli, we have as follows:

n <- 4 # Number of trials
j <- 3 # Number of success times
p <- 1/2   # Probability of winning on every trial is the same
q <- 1 - p   # Probability of failure on every trial is the same
dollar_win <- 97 # Dollar amount if wining
dollar_loose <- -30  # Dollar amount if loosing

Bernoulli formula.

bernoulli <- function(n,p,j){
  b <- choose(n,j) * p ^ (j) * (1 - p) ^ (n - j)
  return(b)
}
b <- bernoulli(n,p,j)
# dbinom(j,n,p) # Binomial distribution function from R.

The probability of getting exactly three heads is 0.25.

Now, in order to calculate our dollar values, we can do as follows:

Winning

\(E(Win) = bernoulli(n,p,j) \times dollar\_win\)

\(E(Win) = 0.25 \times 97\)

\(E(Win)\) = 24.25

Loosing

\(E(Loose) = (1 - bernoulli(n,p,j)) \times dollar\_loose\)

\(E(Loose) = 0.75 \times -30\)

\(E(Loose)\) = -22.5

Answer: Based on the above results and the given dollar values, the expected amount to be made is higher than the amount to be paid out.

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

\(E(Pay) = E(Win) + E(Loose)\)

ntimes <- 559 
EWin <- bernoulli(n,p,j) * dollar_win * ntimes
ELoose <- (1 - bernoulli(n,p,j)) * dollar_loose * ntimes
Expected_Pay <- EWin + ELoose

Answer: After 559 times I would expect to win $13555.75; loose $-12577.5 and end up with a profit of $978.25.

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

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

Solution

1. Find the expected value of the proposition. Round your answer to two decimal places.

By assuming that it is a fair coin and by applying Bernoulli, we have as follows:

n <- 9 # Number of trials
j <- 4 # Number of success times must be equal to or less than 4
p <- 1/2   # Probability of winning on every trial is the same
q <- 1 - p   # Probability of failure on every trial is the same
dollar_win <- 23 # Dollar amount if wining
dollar_loose <- -26  # Dollar amount if loosing

Bernoulli formula.

bernoulli <- function(n,p,j){
  b <- choose(n,j) * p ^ (j) * (1 - p) ^ (n - j)
  return(b)
}
b0 <- bernoulli(n,p,0) # Probability of 0
b1 <- bernoulli(n,p,1) # Probability of 1
b2 <- bernoulli(n,p,2) # Probability of 2
b3 <- bernoulli(n,p,3) # Probability of 3
b4 <- bernoulli(n,p,4) # Probability of 4
b <- b0 + b1 + b2 + b3 + b4
#pbinom(j,n,p) # Binomial distribution function from R.

The probability of getting 4 tails or less is 0.5.

Now, in order to calculate our dollar values, we can do as follows:

Winning

\[E(Win) = dollar\_win \times \sum{bernoulli(n,p,j_i)}\]

\[E(Win) = 23 \times 0.5 \]

\(E(Win)\) = 11.5

Loosing

\[E(Loose) = dollar\_loose \times (1 - \sum{bernoulli(n,p,j_i)}) \]

\[E(Loose) = -26 \times 0.5 \]

\(E(Loose)\) = -13

Answer: Based on the above results and the given dollar values, the expected amount to be made is lower than the amount to be paid out.

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

\(E(Pay) = E(Win) + E(Loose)\)

ntimes <- 994 
EWin <- b * dollar_win * ntimes
ELoose <- (1 - b) * dollar_loose * ntimes
Expected_Pay <- EWin + ELoose

Answer: After 994 times I would expect to win $11431; loose $-12922 and end up with a loss of $-1491.

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

p_liar <- 0.59 # Probability of detecting a liar
n_liar <- 1 - p_liar # Probability of NOT detecting a lie
p_truth <- 0.90 # Probability of detecting a truth
n_truth <- 1 - p_truth # Probability of NOT detecting the truth
liars <- 0.2 # Probability estimation of individuals will lie
truth <- 1 - liars #Probability estimation of individuals will tell the truth

Solution

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

options Tell Lies Tell Truth Total
Positive liar 0.1180 0.0800 0.1980
Negative liar 0.0820 0.7200 0.8020
Total 0.2000 0.8000 1.0000
pLiarGivenLiar <- liars_table$`Tell Lies`[1] / liars_table$Total[1]

Answer: The probability that an individual is actually a liar given that the polygraph detected him/her as such is 0.596 or 59.6%.

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

options Tell Lies Tell Truth Total
Positive liar 0.1180 0.0800 0.1980
Negative liar 0.0820 0.7200 0.8020
Total 0.2000 0.8000 1.0000
pTruthGivenTruth <- liars_table$`Tell Truth`[2] / liars_table$Total[2]

Answer: The probability that an individual is actually a truth-teller given that the polygraph detected him/her as such is 0.8978 or 89.78%.

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.

options Tell Lies Tell Truth Total
Positive liar 0.1180 0.0800 0.1980
Negative liar 0.0820 0.7200 0.8020
Total 0.2000 0.8000 1.0000
pliar <- liars_table$`Tell Lies`[3] +  liars_table$Total[1] - liars_table$`Tell Lies`[1]

Answer: The probability that a randomly selected individual is either a liar or was identified as a liar by the polygraph is 0.28 or 28%.

END.