1. Total number of chips = 540

Number of chips labeled 505 = 1

Probability of picking chip 505 = 1/540 = .0019

toppings <- c("A","A","A","A","C","C","C","C")
toppings
## [1] "A" "A" "A" "A" "C" "C" "C" "C"
meats <- c("E","E","T","T","E","E","T","T")
meats
## [1] "E" "E" "T" "T" "E" "E" "T" "T"
dressings <- c("F","V","F","V","F","V","F","V")
dressings
## [1] "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. Number of cards that are heart and not face = 10

Probability of picking a non face heart card = 10/52 = .1923

  1. Total number of commbinations from 2 dice = 6x6 = 36

10 Combinations of less than 6: (1,1)(1,2)(1,3)(1,4)

(2,1)(2,2)(2,3)

(3,1)(3,2)

(4,1)

Probability of rolling sum less than 6 = 10/36 = .2778

m <- 233+159+102+220+250
f <- 208+138+280+265+146
prob_male <- round(m/(m+f),4)
prob_male
## [1] 0.4818
  1. Probability club = 13/52 = .25

Probability black = 26/52 = .5

Probability face = 12/52 = .231

Final Probability = .25.5.231 = .0289

  1. Conditional Probability of picking spade after picking heart without replacement:
round((13/52 * 13/51) / (13/52),4)
## [1] 0.2549
  1. Probability heart = 13/52 = .25

Probability red after heart = 25/51 = .49

Final Probability = .25*.49 = .1225

  1. Total students = 85

Probability junior female = 4/85 = .047

Probability freshman male = 12/84 = .1429

Total Probability = .047*.1429 = .0067

Step 1:

Total Probability = (52/300) / (141/300) = .3688

Step 2:

Total Probability = (52/300) / (102/300) = .5098

Total Different Packages = (6 drinks)(5 sandwiches)(3 chips) = 90 packages

factorial(5)
## [1] 120
  1. Select 5 of 8 songs:
factorial(8)/factorial(8-5)
## [1] 6720
  1. Roll 9 times and get 3 fours, 5 sixes, and 1 two:
factorial(9) / (factorial(3) * factorial(5) * factorial(1))
## [1] 504
  1. Select 6 toppings out of 14
factorial(14)/factorial(14-6)
## [1] 2162160
  1. Select 3 cards of 52 without replacing
factorial(52) / (factorial(52-3)*factorial(3))
## [1] 22100

Different Systems = (12 TVs)(9 sound systems)(5 DVD players) = 540 systems

  1. Select 5 letters from 26 (A-Z) and 3 odd digits from 5 (1,3,5,7,9)
(factorial(26) / factorial(26-5))*(factorial(5) / factorial(5-3))
## [1] 473616000
summary(cars)
##      speed           dist       
##  Min.   : 4.0   Min.   :  2.00  
##  1st Qu.:12.0   1st Qu.: 26.00  
##  Median :15.0   Median : 36.00  
##  Mean   :15.4   Mean   : 42.98  
##  3rd Qu.:19.0   3rd Qu.: 56.00  
##  Max.   :25.0   Max.   :120.00
nPr <-function(n,k){
  factorial(n) / (factorial(n-k))
}
nPr(9,4)
## [1] 3024
nCr <-function(n,k){
  factorial(n) / (factorial(n-k)*factorial(k))
}
nCr(11,8)
## [1] 165
nPr(12,8)/nCr(12,4)
## [1] 40320
nPr(13,7)
## [1] 8648640
  1. 10 letters. 2 p’s and 2 o’s
factorial(10)/(factorial(2) * factorial(2))
## [1] 907200

Step 1:

x <- c(5, 6, 7, 8, 9) 
px <- c(0.1, 0.2, 0.3, 0.2, 0.2)
Ex <- round(sum(x * px), 1)
Ex
## [1] 7.2

Step 2:

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

Step 3:

SDx <- round((Vx)^(1/2),1)
SDx
## [1] 1.3

Step 4:

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

Step 5:

L7 <- round(sum((x <= 7) * px), 1)
  1. Step 1: E = (P_make)*23 + (1-_make)*-4
P_oneshot = 188/376
P_make = P_oneshot^3
E <- round(23 * (P_make)  + (-4) * (1-P_make),2)
E
## [1] -0.62

Expect value = - $0.62

Step 2:

E994 <- 994 * E
E994
## [1] -616.28

Expect to lose $616.28

  1. Step 1:
p <- dbinom(1,11,0.5)+dbinom(2,11,0.5)+dbinom(3,11,0.5)+dbinom(4,11,0.5)+dbinom(5,11,0.5)+dbinom(6,11,0.5)+dbinom(7,11,0.5)+dbinom(8,11,0.5)
p
## [1] 0.9667969
E <- round(1 * (p)  + (-7) * (1-p),2)
E
## [1] 0.73

Expected value = 0.73

Step 2:

E615 <- 615 * E
E615
## [1] 448.95

Expect to win $448.95

  1. Step 1:
win <- 13/52 * 12/51
E <- round(583 * (win)  + (-35) * (1-win),2)
E
## [1] 1.35

Expected value = 1.35

Step 2:

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

Expect to win $853.20

round((dbinom(1,10,0.3)+dbinom(2,10,0.3)),3)
## [1] 0.355

35.5% will pass

E <- 5*.3
E
## [1] 1.5

Expected value = 1.5 bulbs

  1. q = 5 lambda = 5.5 lower.tail is FALSE to get X>5
round(ppois(5,5.5,lower.tail=FALSE),4)
## [1] 0.4711

Probability that the number of special orders will be greater than 5 is 47.11%.

  1. q = 4 lambda = 5.7 lower.tail is FALSE to get X>4
round(ppois(4,5.7,lower.tail=FALSE),4)
## [1] 0.6728

The probability that more than 4 customers will come is 67.28%.

  1. q = 1 lambda = .4*7(days in week) = 2.8 lower.tail is TRUE to get X<=1
round(ppois(1,2.8,lower.tail=TRUE),4)
## [1] 0.2311

The probability that the computer will crash no more than 1 time is 23.11%.

q = 1 (number of employees selected without replacement)

m = 6 (number of employees over 50)

n = 19 (number of employees under 50)

k = 8 (total number of employees selected)

lower.tail=FALSE since we want to see the probability of more than 1 employee over 50 selected

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

The probability that more than 1 employee over 50 is selected is 65.1%

round(phyper(q=6, m=10, n=15, k=8), 3)
## [1] 0.998

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