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

Solution:

Total space is 540.

Action of drawing one chip.

\(C_{505}\) Number of chips labeled 505 = 1.

\(P(C_{505})=\) Number of chips labeled 505 divided by the total space.

\[P(C_{505})=\frac{1}{540}\]

round(1/540, 4)
## [1] 0.0019

Answer: The probability of drawing the chip numbered 505 is 0.19%

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

Solution:

A = Asparagus

C = Cheese

E = Eggs

T = Turkey

F = French

V = Vinaigrette

S = Sample space will be building a salad.

Answer:

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

Solution:

S = Space is the total cards in a deck = 52.

H = Number of hearts in a deck = 14.

F = Number of faces in a deck = 12.

\(H^F\) = Number of hearts that are face = 3

\(H^{Fc}\) = Number of hearts that are NOT face = 10

\(F^c\) = Complement of the Number of faces in a deck = 40.

\[P(H^{Fc})=\frac{10}{52}=0.1923\]

round(10/52,4)
## [1] 0.1923

Answer: The probability that the card will be a heart and not a face card will be 19.23%.

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

Solution:

Let’s define as follows:

x = number of dots represented on the dice. P(X) = The resulting probability of obtaining x dots in a dice.

Possible Probabilities:

Dice 1

P1(X=1)=1

P1(X=2)=2

P1(X=3)=3

P1(X=4)=4

P1(X=5)=5

P1(X=6)=6

Dice 2

P2(X=1)=1

P2(X=2)=2

P2(X=3)=3

P2(X=4)=4

P2(X=5)=5

P2(X=6)=6

With the above, we can deduct that the total of possible combinations will be a total of 36.

We are being ask for the probability of the sum being less than 6.

Possible combinations:

P1(x=1) + P2(x=1) = 2

P1(x=2) + P2(x=1) = 3

P1(x=3) + P2(x=1) = 4

P1(x=4) + P2(x=1) = 5

P1(x=1) + P2(x=2) = 3

P1(x=2) + P2(x=2) = 4

P1(x=3) + P2(x=2) = 5

P1(x=1) + P2(x=3) = 4

P1(x=2) + P2(x=3) = 5

P1(x=1) + P2(x=4) = 5

By counting the total number of possibilities we find out that there are 10 different options to obtain such results.

With that, in order to find our probability, we can proceed as follows:

\(P(P_1(X)+P_2(X))<6\)

\(P(P_1(X)+P_2(X))=\frac{10}{36}=0.2778\)

round(10/36,4)
## [1] 0.2778

Answer: The probability of rolling a sum less than 6 will be 27.78%.

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

What is the probability that a customer is male? Write your answer as a fraction or a decimal number rounded to four decimal places.

Solution:

M = Total number of Males

F = Total number of Females

S = Space total

Males <- c(233, 159, 102, 220, 250)
Females <- c(208, 138, 280, 265, 146)
PM <- round(sum(Males)/(sum(Males) + sum(Females)),4)
cat("Probability of Customer being a Male", PM)
## Probability of Customer being a Male 0.4818

M = 964

F = 1037

S = 2001

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

Answer: The probability that a customer is a male is 48.18%

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

Solution:

Important: WITH REPLACEMENT!

S = Space is the number of cards in a deck = 52

C = Number of clubs in a deck = 13

B = Number of black cards in a deck = 26

F = Number of faces in a deck = 12

\(P(C)=\frac{13}{52}=0.25\)

\(P(B)=\frac{26}{52}=0.5\)

\(P(F)=\frac{12}{52}=0.2308\)

\[P(C) \cap P(B) \cap P(F) = \frac{13}{52} \cdot \frac{26}{52} \cdot \frac{12}{52} = 0.0288\]

PC <- 13/52
PB <- 26/52
PF <- 12/52
round( PC * PB * PF, 4)
## [1] 0.0288

Answer: The probability will be 2.88%

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

Solution:

Important: WITHOUT REPLACEMENT

By using the Theorem of Conditional Probability, we need to do as follows:

\[P(C_2 | C_1) = \frac{P(C_2 \cap C_1)}{P(C_1)}\] We can deduct that \[P(C_2 | C_1) = \frac{P(C_2) P(C_1)}{P(C_1)}=P(C_2)\]

\(S_1\) = Total space for the first card is 52 cards

\(S_2\) = Total space for second card is 51 cards

\(C_1\) = Heart

\(C_2\) = Spade

\(Sp_1\) = Number of spades in the first Space = 13.

\(Sp_2\) = Number of spades in the second Space = 13.

\[P(C_2 | C_1)=\frac{13}{51}=0.2549\]

round( 13/51, 4)
## [1] 0.2549

Answer: The probability of choosing a spade for the second card drawn, if the first card, drawn without replacement, was a heart is 25.49%

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

Solution:

Important: WITHOUT REPLACEMENT

\(S_1\) = Total space for the first card is 52 cards

\(S_2\) = Total space for second card is 51 cards

\(H_1\) = Number of hearts available in the first space = 13

\(P(H_1)=\frac{13}{52}\) This is the probability of choosing a heart in the first pick.

Since there’s no replacement and since hearts are red, this means that the number of red cards on the second space has decreased by 1.

\(R_2\) = Red card in the second space.

\(R_2\) = 25

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

In order to get the final probability, we can deduct as follows:

\(P(R_2 | H_1) = P(H_1) \cdot P(R_2)\)

\[P(R_2 | H_1) = \frac{13}{52} \cdot \frac{25}{51} = \frac{325}{2652} = 0.1225\]

# conditional, but not B|A
PH1 <- 13/52
PR2 <- 25/51
round( PH1 * PR2, 4)
## [1] 0.1225

Answer: The probability of choosing a heart and then, without replacement, a red card is 12.25%.

  1. There are 85 students in a basic math class. The instructor must choose two students at random. What is the probability that a junior female and then a freshmen male are chosen at random? Write your answer as a fraction or a decimal number rounded to four decimal places.
Males <- c(12, 19, 12, 7)
Females <- c(12, 15, 4, 4)
Grade <- c("Freshmen", "Sophomores", "Juniors", "Seniors")
MyTable <- data.frame("Grade" = Grade, "Males" = Males, "Females" = Females)
MyTable
##        Grade Males Females
## 1   Freshmen    12      12
## 2 Sophomores    19      15
## 3    Juniors    12       4
## 4    Seniors     7       4

Solution:

\(S_1\) = First space total = 85

\(S_2\) = Second space total = 84

Males = 50

Females = 35

\(P(J_F) \cap P(F_M) = P(J_F) \cdot P(F_M)\)

\(P(J_F) \cap P(F_M) = \frac{4}{85} \cdot \frac{12}{84}=0.0067\)

P <- round( 4 / 85 * 12 /84,4)
cat("Probability is", P)
## Probability is 0.0067

Answer: The probability that a junior female and then a freshmen male are chosen at random is 0.67%

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

Solution:

\[P(G|M)=\frac{P(G \cap M)}{P(M)}\]

\[P(G \cap M)=\frac{52}{300}\]

\[P(M)=\frac{141}{300}\]

Going back to our original equation:

\[P(G|M)=\frac{\frac{52}{300}}{\frac{141}{300}}=0.3688\]

P <- round( (52 / 300) / (141 / 300),4)
cat("Probability is", P)
## Probability is 0.3688

Answer: The probability that a randomly chosen applicant has a graduate degree, given that they are male is 36.88%.

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.

Solution:

\[P(M|G)=\frac{P(M \cap G)}{P(G)}\]

\[P(M \cap G)=\frac{52}{300}\]

\[P(G)=\frac{102}{300}\]

Going back to our original equation:

\[P(G|M)=\frac{\frac{52}{300}}{\frac{102}{300}}=0.5098\]

P <- round( (52 / 300) / (102 / 300),4)
cat("Probability is", P)
## Probability is 0.5098

Answer: The probability that a randomly chosen applicant is male, given that the applicant has a graduate degree is 50.98%.

  1. 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?

Solution:

Let’s define as follow:

D = 6 different kind of drinks.

S = 5 different types of sandwiches.

C = 3 different types of chips.

This is basically a combination as follows:

Combination = D * S * C

D <- 6
S <- 5
C <- 3
Combination <- D * S * C
Combination
## [1] 90

Answer: There are 90 different value meal packages possible.

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

Solution:

This can be done in 5! ways.

Ways <- factorial(5)
Ways
## [1] 120

The doctor can visit 5 patients during the morning rounds in 120 different ways.

  1. 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?

Solution:

Since we have n=8 songs and want to find the number of ways k=5 songs that can be ordered:

\[P(n,k)= \frac{n!}{(n-k)!}\]

\[P(8,5) = \frac{8!}{(8-5)!}\]

P <-function(n,k){
  factorial(n) / (factorial(n-k))
}
Lineup <- P(8,5)
Lineup
## [1] 6720

Answer: There will be 6720 possible lineups.

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

Solution:

In this case, we have \(n=9\) ways of obtaining any side, we can deduct as follows:

\[Ways = \frac{9!}{3! \cdot 5! \cdot 1!}\]

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

Answer: there are 504 different ways to get get 3 fours, 5 sixes and 1 two

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

Solution:

Since we have \(n=14\) different toppings and want to chose \(k=6\) toppings without repeating it, we can do as follows:

\[P(n,k)= \frac{n!}{(n-k)!}\]

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

P <-function(n,k){
  factorial(n) / (factorial(n-k))
}
Ways <- P(14,6)
Ways
## [1] 2162160

Answer: Rudy can chose 6 toppings in 2162160 different ways.

  1. 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?

Solution:

Important: WITHOUT REPLACEMENT

Since we have \(n=52\) different cards and want to chose \(k=3\) card hands without repeating it, we can do as follows:

\[C(n,k)= \frac{P(n,k)}{k!}\]

\[C(52,3)= \frac{P(52,3)}{3!}\] \[C(52,3)=\frac{52!}{(52-3)! \cdot 3!}\]

C <-function(n,k){
  factorial(n) / (factorial(n-k)*factorial(k))
}
Ways <- C(52,3)
Ways
## [1] 22100

Answer: There are 22100 different 3-card hands possible if the drawing is done without replacement.

  1. 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?

Solution:

Let’s take as follows:

TV = 12 different choices for TVs.

SS = 9 different choices for surround sound systems.

DVD = 5 different choices for DVDs.

Ways = TV * SS * DVD

\(Ways = 12 * 9 * 5\)

Ways <- 12 * 9 * 5
Ways
## [1] 540

Answer: there are 540 different ways to order a new home theater system.

  1. 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?

Solution:

Important: CHARACTERS AND DIGITS CAN NOT BE REPEATED.

There are 26 letters in the alphabet.

There are 5 different odd number for 0 - 9 = {1,3,5,7,9}

Length of password = 8

\(Ways = P(26,5) \cdot P(5,3)\)

By using: \[P(n,k)= \frac{n!}{(n-k)!}\]

\[Ways =\frac{26!}{(26-5)!} \cdot \frac{5!}{(5-3)!}\]

P <-function(n,k){
  factorial(n) / (factorial(n-k))
}
Ways <- P(26,5) * P(5,3)
Ways
## [1] 473616000

Answer: There are 473616000 possible choices for the password.

Another option will be to consider UPPER CASE different as a lower case.

For that our answer will be considering 52 letter, 26 lower case and 26 UPPER CASE as follows:

P <-function(n,k){
  factorial(n) / (factorial(n-k))
}
Ways <- P(52,5) * P(5,3) 
Ways
## [1] 18712512000

Answer: Considering Upper case as different to lower case we will have 18712512000 possible choices for our password.

  1. Evaluate the following expression \(_9P_4\)

Solution:

By interpreting the above notation as the function for calculating the number of r-permutations of n in the form \(_nP_r\).

We have as follows:

nPr <-function(n,k){
  factorial(n) / (factorial(n-k))
}
nPr(9,4)
## [1] 3024

Answer: \(_9P_4=3024\)

  1. Evaluate the following expression \(_{11}C_8\)

Solution:

By interpreting the above notation as the function for calculating the number of r-combination of n in the form \(_nC_r\).

We have as follows:

nCr <-function(n,k){
  factorial(n) / (factorial(n-k)*factorial(k))
}
nCr(11,8)
## [1] 165

Answer: \(_{11}C_8=165\)

  1. Evaluate the following expression \[\frac{_{12}P_8}{_{12}C_4}\]

Solution:

nPr(12,8)/nCr(12,4)
## [1] 40320

Answer: \[\frac{_{12}P_8}{_{12}C_4}=40320\]

  1. 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?

Solution:

Assuming that one person can hold only one position.

We obtain resolve this, by calculating \(_{13}P_7\)

nPr(13,7)
## [1] 8648640

Answer: The president can appoint his cabinet in 8648640 different ways.

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

Solution:

Population has a total of 10 letters.

There are 2 “P” repeating.

There are 2 “o” repeating.

We have to divide in order to avoid the duplicate letters on the same spot.

Our formula will be \[Ways=\frac{10!}{2! \cdot 2!}\]

factorial(10)/(factorial(2) * factorial(2))
## [1] 907200

Answer: The word “population”" can be arranged in 907200 different ways.

  1. Consider the following data:
x <- c(5, 6, 7, 8, 9) 
Px <- c(0.1, 0.2, 0.3, 0.2, 0.2)
MyTable <- data.frame( x, Px)
names(MyTable) <- c("x", "P(x)")
MyTable
##   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.

Preamble:

Expected Value

The expected value of a random variable indicates its weighted average.

Definition: Let \(X\) be a random variable assuming the values \(x_1, x_2, x_3\), … with corresponding probabilities \(p(x_1), p(x_2), p(x_3)\),….. The mean or expected value of \(X\) is defined by \[E(X) = \sum_{k=0}^n(x_k \cdot p(x_k))\]

Solution:

xPx <- x * Px
xPx
## [1] 0.5 1.2 2.1 1.6 1.8
Ex <- round(sum(x * Px), 1)
cat("E(x) = ", Ex)
## E(x) =  7.2

Answer: \(E(x) = 7.2\)

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

Preamble:

By definition \[Var(x) = \sum_{i} ^{n} \left[ (x_i)^2 \cdot p(x_i) \right] - \left[ E(x) \right]^2\]

xx <- x^2
xxPx <- xx * Px
xxPx
## [1]  2.5  7.2 14.7 12.8 16.2
Vx <- round(sum(xxPx) - Ex^2, 1)
cat("V(x) = ", Vx)
## V(x) =  1.6

Answer: The variance is \(V(x) = 1.6\)

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

Preamble:

The Standard deviation of a random variable is defined:

\[SD(X) = \sqrt{V(X)} \]

Solution:

SDx <- round((Vx)^(1/2),1)
cat("SD(x) = ", SDx)
## SD(x) =  1.3

The standard deviation is \(SD(X) = 1.3\)

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

Solution:

\[E(x \ge 9) = \sum(x \ge 9) \cdot p(x \ge 9))\]

By following the values from our table we have as follows:

NEx <- round(sum((x >= 9) * Px), 1)
cat("E(x) = ", NEx)
## E(x) =  0.2

Answer: \(P(X \ge 9)=0.2\)

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

By following the values from our table we have as follows:

NEx <- round(sum((x <= 7) * Px), 1)
cat("E(x) = ", NEx)
## E(x) =  0.6

Answer: \(P(X \le 7)=0.6\)

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

Solution:

Since the Probability of an Event E is represented as follows:

\[P(E) = \frac{number \: of \: ways \: an \: event \: can \: occur \: (dessired)}{total \: number \: of \: possible \: outcomes \:(total)}\] Where \(0 \le P(E) \le 1\)

Since the probability for a single shot, defined \(p_1\) is as follows:

\[p_1 = \frac{188}{376}=0.5\]

p1 <- 188/376
cat("p1 = ", p1)
## p1 =  0.5

Since losses need to be entered as a negative value and putting our problems in terms of the player; the expected gain for the basketball player turns out to be:

E = (Probability of making three shots) * $23 + (Probability of NOT making three shots) * (-$4)

We can deduct that the probability for three shots will be the probability of one shot multiplied by itself three times:

Probability of three shots: \(P_1*P_1*P1=(p_1)^3\)

p3 <- (p1) ^ 3
cat("p3 = ", p3)
## p3 =  0.125

Since the probability of NOT making the three shots is the complement, we can deduct as follows:

Probability of not making three shots: \(p_{fail} = 1 - p_3\)

pf <- 1 - (p3) 
cat("pf = ", pf)
## pf =  0.875

By Solving our Expected value of the proposition, we have as follows:

\[E = (23 \cdot p_3) + (-4 \cdot p_{fail})\]

E <- round(23 * (p3)  + (-4) * pf,2)
cat("E = ", E)
## E =  -0.62

Answer: The expected value will be $ -$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.)

Solution:

\[E_{994}= 994 \cdot E\]

E994 <- 994 * E
cat("E = ", E994)
## E =  -616.28

Answer: If I played this game 994 times I would lose $616.28.

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

Preamble:

The binomial distribution consists of the probabilities of each of the possible numbers of successes on N trials for independent events that each have a probability of \(\pi\) (the Greek letter pi) of occurring. For the coin flip example, \(N = 2\) and \(\pi = 0.5\). The formula for the binomial distribution is shown below:

\[P(x)=\frac{N!}{x!(N-x)!} \pi^x (1 - \pi )^{N-x}\] where P(x) is the probability of x successes out of N trials, N is the number of trials, and \(\pi\) is the probability of success on a given trial.

Now, applying this to the coin flip example we have as follows:

\[P_{win} = \frac{11!}{8!(11-8)!} (0.5)^8 (1 - 0.5 )^{11-8} \]

Probability of winning:

#Expected probability of winning for multiple cases
spw <- function(n,k,p)
{
    spx <-0
    for (i in 1:k ) {
      px <- factorial(n)/(factorial(i)*factorial(n-i))*(p^i)*(1-p)^(n-i)
      spx <- spx + px
    }
    return(spx)
}

#Expected probability of winning for a single case, comparable to dbinom(k,n,p)
pw <- function(n,k,p)
{
    px <- factorial(n)/(factorial(k)*factorial(n-k))*(p^k)*(1-p)^(n-k)
    return(px)
}

#pw1 <- pb(11,1,0.5)
#pw2 <- pb(11,2,0.5)
#pw3 <- pb(11,3,0.5)
#pw4 <- pb(11,4,0.5)
#pw5 <- pb(11,5,0.5)
#pw6 <- pb(11,6,0.5)
#pw7 <- pb(11,7,0.5)
#pw8 <- pb(11,8,0.5)

#p <- pw1 + pw2 + pw3 + pw4 + pw5 + pw6 + pw7 + pw8

p <- spw(11,8,0.5)
p
## [1] 0.9667969
# Another alternative will be to use dbinom(8,11,0.5) instead of programing the formula

Probability of failure:

pf <- 1 - (p) 
cat("pf = ", pf)
## pf =  0.03320312

Expected value of the proposition:

E <- round(1 * (p)  + (-7) * pf,2)
cat("E = ", E)
## E =  0.73

Answer: The expected value will be \(E=0.73\)

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

Solution:

E615 <- 615 * E
cat("E = ", E615)
## E =  448.95

Answer: If I play 615 times I will expect to win $448.95.

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

Solution:

Number of cards in a standard deck = 52.

Number of clubs in a standard deck = 13.

\(P(E) = \frac{13}{52} \cdot \frac{12}{52}\)

PWin <- 13/52 * 12/51
cat("P(E) = ", PWin)
## P(E) =  0.05882353

Probability of failure:

pf <- 1 - (PWin) 
cat("pf = ", pf)
## pf =  0.9411765

Expected value of the proposition:

E <- round(583 * (PWin)  + (-35) * pf,2)
cat("E = ", E)
## E =  1.35

Answer: The expected value of the proposition is \(E=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.)

Solution:

E632 <- 632 * E
cat("E = ", E632)
## E =  853.2

Answer: If I play 615 times I will expect to win $853.20.

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

Solution:

Sample size = 10 bulbs.

If less than 2 defectives the lot passes inspection.

30 % in the lot are defective.

Probability of passing inspection?

This is very similar to the binomial distribution question #26 for which I will use the same function for \(x \le 2\).

\[P(x)=\sum \frac{N!}{x!(N-x)!} \pi^x (1 - \pi )^{N-x}\]

We will take as follows:

\(n = 10\)

\(k = 2\)

\(p = 0.3\)

p <- round(spw(10,2,0.3),3)
p
## [1] 0.355

Answer: The probability that the lot will pass inspection is 35.5%

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

Solution:

n = 5 Number of bulbs.

p = 30% are defective.

\(EV = n \cdot p\)

n <-5
p <- 0.3
EV <-  n * p
EV
## [1] 1.5

Answer: The expected value of defective bulbs is 1.5.

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

Solution:

Since we know the mean E = 5.5.

We can employ the Poisson distribution as follows:

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

p <- function(k, l)
{
  spoisson <-0
  for (i in 0:k ) {
  poisson <- (l^(i) * exp(-l))/(factorial(i) )
  spoisson <- spoisson + poisson
}
  return(spoisson)
}
p(5,5.5)
## [1] 0.5289187
# Another way of solving this will be employing the ppois(5, 5.5, lower=FALSE) in r.

That result will represent the lower tail, since we are being asked for more than 5, what we need to do is as follows: \(Upper = 1-poisson\).

ut <- round(1-p(5, 5.5),4)
cat("Upper Tail", ut)
## Upper Tail 0.4711

Answer: The probability that, for any day, the number of special orders sent out will be more than 5 is 47.11%.

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

Solution:

Since we are being asked for the Upper Tail, by employing the above function; we obtain as follows:

ut <- round(1-p(4, 5.7),4)
cat("Upper Tail", ut)
## Upper Tail 0.6728

Answer: The probability that, in any hour, more than 4 customers will arrive is 67.28%.

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

Solution:

Since we have a daily mean of 0.4 per day and we are looking to obtain a weekly probability, we need to do as follows:

daily lambda = 0.4

Weekly lambda = 0.4 * 7

With this transformation we need to take our k = 1 week as well.

Since we are being asked for the lower Tail, by employing the above function; we obtain as follows:

lt <- round(p(1, 0.4 * 7),4)
cat("Lower Tail", lt)
## Lower Tail 0.2311

Answer: The probability that, in any 7-day week, the computer will crash no more than 1 time is 23.11%

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

Preamble:

Since the above example explain a distributions related to the number of successes in a sequence of draws with no replacement, I will use the hyper geometric distribution as follows:

Definition: The following conditions characterize the hyper geometric distribution:

A random variable \({\displaystyle X}\) follows the hyper geometric distribution if its probability mass function (pmf) is given by:

\[P(X=x)=\frac{{{\displaystyle K} \choose k} {{\displaystyle N-K} \choose {n-k}}}{{{\displaystyle N} \choose n}}\] where

\({\displaystyle N}\) is the population size,

\({\displaystyle K}\) is the number of success states in the population,

\({\displaystyle n}\) is the number of draws,

\({\displaystyle k}\) is the number of observed successes

Solution:

From the above formula, we can rewrite it as follows:

\[P(X=x)=\frac{(_{K}C_{k}) \cdot (_{N-K}C_{n-k})}{(_{N}C_{n})}\]

In order for us to resolve the above question, we will take our values as follows:

N = 25

K = 6

n = 8

k = {0, 1, 2, 3, 4, 5, 6, 7, 8} will be dismissed.

By using our previous defined combinatory function, we can do as follows:

nCr <-function(n,k){
  factorial(n) / (factorial(n-k)*factorial(k))
}

In this case we need to add all the probabilities for the one given that is for more than 1 employee was over 50.

I am defining k1 as my starting point of observed successes > 1; k1 =2 and k2 as my final number of observed successes; k2 = 6.

Px <- function(N, K, n, k1, k2)
{
  sPx <- 0
  for (i in k1:k2 ) {
    sPx <- sPx + nCr(K,i) * nCr(N-K, n-i) / nCr(N,n)
  }
  return(sPx)
}

#Probability function for more than 1 employee who is over 50, staring with 2 ending wit 6
N <- 25
K <- 6
n <- 8
k1 <- 2
k2 <- 6
# Adding all the possibilities > 1 up to 6
round(Px(N, K, n, k1, k2),3)
## [1] 0.651
# Or by addig the possibilities < 1 and taking the complement.
k1 <- 0
k2 <- 1
1- round(Px(N, K, n, k1, k2),3)
## [1] 0.651

Answer: The probability of dismissed employees in which more than 1 employee was over 50 is 65.1%

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

Solution:

Let’s take as follows:

\({\displaystyle N}\) is the population size,

\({\displaystyle K}\) is the number of success states in the population,

\({\displaystyle n}\) is the number of draws,

\({\displaystyle k}\) is the number of observed successes

N = 25

K = 15

n = 8

k = {0, 1, 2, 3, 4, 5, 6, 7, 8} will receive the drug.

#Probability function for less than 7 people; I will define k1 = 0 and k2 = 6
N <- 25
K <- 10
n <- 8
k1 <- 0
k2 <- 6
# Adding all the possibilities > 1 up to 6
round(Px(N, K, n, k1, k2),3)
## [1] 0.998
# Or by addig the possibilities < 1 and taking the complement.
#k1 <- 0
#k2 <- 1
#1- round(Px(N, K, n, k1, k2),3)

Answer: The probability that less than 7 patients will die is 99.8%.