Q1.) There are 540 identical plastic chips numbered 1 through 540 in a box. What is the probability of reaching into the box and randomly drawing the chip numbered 505? Express your answer as a fraction or a decimal number rounded to four decimal places.

Total sample space is 540 plastic chips. 

Total chips labeled 505 = 1 

\(P(C) = \frac{1}{540}\)

P <- round(1/540, 4)
cat("The probability is: ", P)
## The probability is:  0.0019

Q2.) Write out the sample space for the given experiment. Separate your answers using commas.

When deciding what you want to put into a salad for dinner at a restaurant, you will choose one of the following extra toppings: asparagus, cheese.  Also, you will add one of following meats: eggs, turkey.  Lastly, you will decide on one of the following dressings: French, vinaigrette.  (Note: Use the following letters to indicate each choice: A for asparagus, C for cheese, E for eggs, T for turkey, F for French, and V for vinaigrette.)
toppings <- c("A","A","A","A","C","C","C","C")
meats <- c("E","E","T","T","E","E","T","T")
dressings <- c("F","V","F","V","F","V","F","V")
salad <- data.frame(toppings, meats, dressings)
salad
##   toppings meats dressings
## 1        A     E         F
## 2        A     E         V
## 3        A     T         F
## 4        A     T         V
## 5        C     E         F
## 6        C     E         V
## 7        C     T         F
## 8        C     T         V

Q3.) A card is drawn from a standard deck of 52 playing cards. What is the probability that the card will be a heart and not a face card? Write your answer as a fraction or a decimal number rounded to four decimal places.

Total # of hearts: 14 

Total # of Face cards: 12 

Total # of hearts that are a face card: 3 

Total # of hearts that aren’t a face card: 10 

Sample size: 52

P <- round(10/52, 4)
cat("The probability is: ", P)
## The probability is:  0.1923

Q4.) A standard pair of six-sided dice is rolled. What is the probability of rolling a sum less than 6? Write your answer as a fraction or a decimal number rounded to four decimal places.

TOtal possibilities per die is 6. 6*6 = 36 total outcomes. 

10 out of the possible 36 would equal less than a sum of 6. \({\frac {10}{36}} = 0.2778\) or 27.78%

P <- round(10/36, 4)
cat("The probability is: ", P)
## The probability is:  0.2778

Q5.) A pizza delivery company classifies its customers by gender and location of residence. The research department has gathered data from a random sample of 2001 customers. The data is summarized in the table below.

males <- 233 + 159 + 102 + 220 + 250
females <- 208 + 138+ 280 + 265 +147

males
## [1] 964
females
## [1] 1038
total <- males + females
total
## [1] 2002
P <- round(males/total, 4)
cat("The probability is: ", P)
## The probability is:  0.4815

\(P(M) = \frac {964}{2001}\) = 0.4818

Q6 Three cards are drawn with replacement from a standard deck. What is the probability that the first card will be a club, the second card will be a black card, and the third card will be a face card? Write your answer as a fraction or a decimal number rounded to four decimal places.

\(P (A \cap B) = P (A) P (B)\)

S = Sample Space = 52 cards in a deck 

C = Total # of cubs in a deck = 13 

B = Total # of black cards in a deck = 26 

F= Total # of face cards in a deck = 12 

\(P(C)\cap P(B) \cap P(F) = \frac{13}{52} * \frac{26}{52} * \frac {12}{52}\) = 2.88%

PC <- 13/52
PB <- 26/52
PF <- 12/52

P <- round(PC * PB * PF, 4)
cat("The probability is: ", P)
## The probability is:  0.0288

Q7.)Two cards are drawn without replacement from a standard deck of 52 playing cards. What is the probability of choosing a spade for the second card drawn, if the first card, drawn without replacement, was a heart? Write your answer as a fraction or a decimal number rounded to four decimal places.

 

Sample space for 1st card drawn = 52 cards 

Sample space for 2nd card drawn = 51 cards 

Total # of spades for 1st drawing = 13 

Total # of spades for 2nd drawing = 13 

P <- round(13/51, 4)
cat("The probability is: ", P)
## The probability is:  0.2549

Q8.) Two cards are drawn without replacement from a standard deck of 52 playing cards. What is the probability of choosing a heart and then, without replacement, a red card? Write your answer as a fraction or a decimal number rounded to four decimal places.

Sample for 1st card: 52 cards 

Total hearts: 13 

\(P(H): \frac {13}{52}\)

 

Sample for 2nd card: 51 cards 

Red card for 2nd sample: 25 

\(P(R)=\frac {25}{51}\)

PH <- 13/52
PR <- 25/51

P <- round(PH*PR,4)
cat("The probability is: ", P)
## The probability is:  0.1225

Q9.) There are 85 students in a basic math class. The instructor must choose two students at random

males <- c(12, 19, 12, 7)
females <- c(12, 15, 4, 4)

total <- sum(males + females)
total
## [1] 85

Total students for 1st random choosing: 85 

Total students for 2nd random choosing: 84 

TOtal junior females: 4 

Total freshmen males: 12

JF <- 4/85
FM <- 12/84

P <- round(JF * FM, 4)
cat("The probability is: ", P)
## The probability is:  0.0067

Q10.) Out of 300 applicants for a job, 141 are male and 52 are male and have a graduate degree. 

Step 1: What is the probability that a randomly chosen applicant has a graduate degree, given that they are male? Enter your answer as a fraction or a decimal rounded to four decimal places.

Total sample: 300 applicants 

Graduate degree male applicants: 52  \(P(G) = \frac{52}{300}\)

Total male applicants: 141 \(P(M) = \frac{141}{300}\)

G <- 52/300
M <- 141/300

P <- round(G/M, 4)
cat("The probability is: ", P)
## The probability is:  0.3688

Step 2: If 102 of the applicants have graduate degrees, what is the probability that a randomly chosen applicant is male, given that the applicant has a graduate degree? Enter your answer as a fraction or a decimal rounded to four decimal places.

Total Sample: 300 applicants 

Graduate degree applicants: 102 

Graduate degree male applicants: 52 

M <- 52/300
G <- 102/300

P <- round(M/G, 4)
cat("The probability is: ", P)
## The probability is:  0.5098

Q11.) A value meal package at Ron’s Subs consists of a drink, a sandwich, and a bag of chips. There are 6 types of drinks to choose from, 5 types of sandwiches, and 3 types of chips. How many different value meal packages are possible?

drinks <- 6
sandwiches <- 5
chips <- 3

total <- drinks * sandwiches * chips
cat("There are", total, "value meal combos")
## There are 90 value meal combos

Q12.) A doctor visits her patients during morning rounds. In how many ways can the doctor visit 5 patients during the morning rounds?

visit <- factorial(5)
cat("Total number of ways is:", visit)
## Total number of ways is: 120

Q13.)A coordinator will select 5 songs from a list of 8 songs to compose an event’s musical entertainment lineup. How many different lineups are possible?

\[_nP_r = \frac {n!}{(n-r)!} \ = \ _8P_5 = \frac {8!}{(8-5)!}\]

P <- function(n, r){
  factorial(n)/factorial(n-r)
}
permutation <- P(8, 5)
cat("Total number of ways is:", permutation)
## Total number of ways is: 6720

Q14.) A person rolls a standard six-sided die 9 times. In how many ways can he get 3 fours, 5 sixes and 1 two?

$ P = $

P <- factorial(9)/(factorial(3)*factorial(5)*factorial(1))
P
## [1] 504

Q15.) How many ways can Rudy choose 6 pizza toppings from a menu of 14 toppings if each topping can only be chosen once?

n = 14 toppings r = 6 toppings to choose from

\[P(n,r) = \frac {n!}{(n-r)!} \ \ =\ \ P(14,6) =\ \frac {14!}{(14-6)!} \]

P <- function(n, r){
  factorial(n)/factorial(n-r)
}
permutation <- P(14, 6)
cat("Total number of ways is:", permutation)
## Total number of ways is: 2162160

Q16.)3 cards are drawn from a standard deck of 52 playing cards. How many different 3-card hands are possible if the drawing is done without replacement?

n = 52 playing cards r = 3 card hands

\[_nC_r = \frac {n!}{(n-r)!} \ = \ _{52}C_3 = \frac {52!}{(52-3)!*3!}\]

C <- function(n, r){
  factorial(n)/(factorial(n-r)*factorial(r))
}
combination <- C(52, 3)
cat("Total number of ways is:", combination)
## Total number of ways is: 22100

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

TV = 12
Surround_sound = 9
DVD_player = 5

home_theater <- TV * Surround_sound * DVD_player
cat("The total # of ways to build a home theater system is: ", home_theater)
## The total # of ways to build a home theater system is:  540

Q18.) You need to have a password with 5 letters followed by 3 odd digits between 0 - 9 inclusively. If the characters and digits cannot be used more than once, how many choices do you have for your password?

26 letters in alphabet 

3 odd digits between 0-9 (1,3,5,7,9) - 5 total 

password = 8 (5 letters, 3 odd digits) 

choice_password = P(26,5) * P(5,3) 

\[_nP_r = \frac {n!}{(n-r)!} \ =\ \ \ \frac {26!}{(26-5)!} * \frac {5!}{(5-3)!} \]

P <- function(n, r){
  factorial(n)/(factorial(n-r))
}
permutation <- P(26, 5) * P(5, 3)
cat("Total number of ways is:", permutation)
## Total number of ways is: 473616000

Q19.) Evaluate the following expression.

 $$_9 P_4$$
P <- function(n, r){
  factorial(n)/factorial(n-r)
}
probability <- P(9, 4)
cat("Total number of ways is:", probability)
## Total number of ways is: 3024

Q20. Evaluate the following expression.

$$_{11} C_8$$
C <- function(n, r){
  factorial(n)/(factorial(n-r)*factorial(r))
}
combination <- C(11, 8)
cat("Total number of ways is:", combination)
## Total number of ways is: 165

Q21.) Evaluate the following expression.

$$( _{12} P_8)/( _{12} C_4 )$$
P <- function(n, r){
  factorial(n)/factorial(n-r)
}
C <- function(n, r){
  factorial(n)/(factorial(n-r)*factorial(r))
}

permutation <- P(12, 8)
combination <- C(12, 4)

permutation/combination
## [1] 40320

Q22.) The newly elected president needs to decide the remaining 7 spots available in the cabinet he/she is appointing. If there are 13 eligible candidates for these positions (where rank matters), how many different ways can the members of the cabinet be appointed?

\[_{13} P_7\]

P <- function(n, r){
  factorial(n)/(factorial(n-r))
}
permutation <- P(13, 7)
cat("Total number of ways is:", permutation)
## Total number of ways is: 8648640

Q23.) In how many ways can the letters in the word ‘Population’ be arranged?

The word ‘Population’ has a total of 10 letters with 2 sets of duplicates - 2 P’s and 2 O’s.  We divide to avoid having duplicate letters in the same spot

\[total\ ways = \frac{10!}{2!*2!}\]

total_ways <- factorial(10)/(factorial(2)*factorial(2))
cat("The total ways the word population can be arranged is:", total_ways, "ways.")
## The total ways the word population can be arranged is: 907200 ways.

Q24.) Consider the following data:

x <- c(5, 6, 7, 8, 9)
px <- c(0.1, 0.2, 0.3, 0.2, 0.2)
df <- data.frame(x, px)
names(df) <- c("x", "P(x)")
df
##   x P(x)
## 1 5  0.1
## 2 6  0.2
## 3 7  0.3
## 4 8  0.2
## 5 9  0.2

Step 1. Find the expected value E( X ). Round your answer to one decimal place.

ex <- round(sum(x*px), 1)
ex
## [1] 7.2

Step 2. Find the variance. Round your answer to one decimal place.

variance <- sum((x - ex)^2 *px)
round(variance, 1)
## [1] 1.6

Step 3. Find the standard deviation. Round your answer to one decimal place.

sd <- round(sqrt(variance), 1)
sd
## [1] 1.2

Step 4. Find the value of P(X >= 9). Round your answer to one decimal place.

step4 <- round(sum((x >= 9) * px), 1)
step4
## [1] 0.2

Step 5. Find the value of P(X <= 7). Round your answer to one decimal place.

step5 <- round(sum((x <= 7) * px), 1)
step5
## [1] 0.6

Q25.)Suppose a basketball player has made 188 out of 376 free throws. If the player makes the next 3 free throws, I will pay you $23. Otherwise you pay me $4.

Step 1. Find the expected value of the proposition. Round your answer to two decimal places. Probability of the player making the first shot is 188/376. The probability of the player making the first 2 shots is (188/376)^2. The probability of the first 3 shots is (188/376)^3 or 1/8.

The probability of the player not making the first 3 shots is 1 - 1/8 = 7/8

Expected value of the proposition is: (P all 3 shots * $23 + P not making all 3 shots * (-4)) or (1/8) * 23 + 7/8 * -4

round((1/8)*(23) + (7/8)*(-4), 2)
## [1] -0.62

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

(-0.62 * 994)
## [1] -616.28

Q26.)Flip a coin 11 times. If you get 8 tails or less, I will pay you $1. Otherwise you pay me $7.

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

n1 <- 11
k1 <- 8
temp <- 0

while (k1 >= 0){
  temp <- temp + (factorial(n1) / ((factorial(k1) * factorial(n1-k1))))
  k1 <- k1 - 1
}
p1 <- temp/(2^11)
p1
## [1] 0.9672852
pf <- 1 - (p1)
pf
## [1] 0.03271484
E1 <- round(1 * (p1) + (-7) * pf, 2)
E1
## [1] 0.74

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

round(E1 * 615, 2)
## [1] 455.1

Q27.) If you draw two clubs on two consecutive draws from a standard deck of cards you win $583. Otherwise you pay me $35. (Cards drawn without replacement.)

Step 1. Find the expected value of the proposition. Round your answer to two decimal places. # of cards in deck: 52 # of clubs: 13 \(P(E)= \frac{13}{52} *\frac{12}{52}\)

P <- 13/52 * 12/51

PF <- 1 - (P)

E <- round(583 * (P) + (-35) * PF, 2)
E
## [1] 1.35

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

E2 <- 632 * E
E2
## [1] 853.2

Q28.) A quality control inspector has drawn a sample of 10 light bulbs from a recent production lot. If the number of defective bulbs is 2 or less, the lot passes inspection. Suppose 30% of the bulbs in the lot are defective. What is the probability that the lot will pass inspection? (Round your answer to 3 decimal places)

n = 10, k = 2, p = 0.3

P <- round(pbinom(2, size = 10, prob = .3), 3)
P
## [1] 0.383

Q29.)A quality control inspector has drawn a sample of 5 light bulbs from a recent production lot. Suppose that 30% of the bulbs in the lot are defective. What is the expected value of the number of defective bulbs in the sample? Do not round your answer.

5*.3
## [1] 1.5

Q30.) The auto parts department of an automotive dealership sends out a mean of 5.5 special orders daily. What is the probability that, for any day, the number of special orders sent out will be more than 5? (Round your answer to 4 decimal places)

The mean is E = 5.5 P of special orders will be more than 5?

\[p(k) = \frac{\lambda^k \cdot e^{-\lambda}}{k!}\]

round(ppois(5, 5.5, lower.tail = FALSE), 4)
## [1] 0.4711

Q31.) At the Fidelity Credit Union, a mean of 5.7 customers arrive hourly at the drive-through window. What is the probability that, in any hour, more than 4 customers will arrive? (Round your answer to 4 decimal places)

round(ppois(4, 5.7, lower.tail = FALSE), 4)
## [1] 0.6728

Q32.) The computer that controls a bank’s automatic teller machine crashes a mean of 0.4 times per day. What is the probability that, in any 7-day week, the computer will crash no more than 1 time? (Round your answer to 4 decimal places

round(ppois(1, 0.4*7, lower.tail = TRUE), 4)
## [1] 0.2311

Q33.)A town recently dismissed 8 employees in order to meet their new budget reductions. The town had 6 employees over 50 years of age and 19 under 50. If the dismissed employees were selected at random, what is the probability that more than 1 employee was over 50? Write your answer as a fraction or a decimal number rounded to three decimal places.

q <- 1
m <- 6
n <- 19
k <- 8
p <- round(phyper(q, m, n, k, lower.tail = F),3)
p
## [1] 0.651

Q34.)Unknown to a medical researcher, 10 out of 25 patients have a heart problem that will result in death if they receive the test drug. Eight patients are randomly selected to receive the drug and the rest receive a placebo. What is the probability that less than 7 patients will die? Write your answer as a fraction or a decimal number rounded to three decimal places.

# phyper(q, m, n, k, lower.tail = TRUE, log.p = FALSE)
q <- 6
m <- 10
n <- 15
k <- 8
p <- round(phyper(q, m, n, k, lower.tail = T),3)
p
## [1] 0.998