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
Probability of picking a non face heart card = 10/52 = .1923
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
Probability black = 26/52 = .5
Probability face = 12/52 = .231
Final Probability = .25.5.231 = .0289
round((13/52 * 13/51) / (13/52),4)
## [1] 0.2549
Probability red after heart = 25/51 = .49
Final Probability = .25*.49 = .1225
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
factorial(8)/factorial(8-5)
## [1] 6720
factorial(9) / (factorial(3) * factorial(5) * factorial(1))
## [1] 504
factorial(14)/factorial(14-6)
## [1] 2162160
factorial(52) / (factorial(52-3)*factorial(3))
## [1] 22100
Different Systems = (12 TVs)(9 sound systems)(5 DVD players) = 540 systems
(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
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)
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
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
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
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%.
round(ppois(4,5.7,lower.tail=FALSE),4)
## [1] 0.6728
The probability that more than 4 customers will come is 67.28%.
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%