probability (red or blue):
red <- 54
white <-9
blue <- 75
Sum <- red + white + blue
Prob <- round((red + blue)/Sum, 4)
Prob
## [1] 0.9348
probability (red):
greeng <- 19
redg <-20
blueg <- 24
yellowg <- 17
Sumg <- greeng + redg + blueg + yellowg
Probg <- round((redg /Sumg), 4)
Probg
## [1] 0.25
P(M∪P)=1-P(M∩P)
Sum2 <- 81+116+215+130+129+228+79+252+97+72
ProbMP <- 215 / Sum2
ProbMOP <- round(1-ProbMP, 4)
ProbMOP
## [1] 0.8463
Going to the gym. Losing weight. Answer: B) Independent
Going to gym with losing weight is dependent, it will burn energy during exercise.
vegetablesC <- choose(8, 3)
condimentsC <- choose(7, 3)
tortillaC <- choose(3, 1)
Veggie <- vegetablesC * condimentsC * tortillaC
Veggie
## [1] 5880
Answer: A) Dependent B) Independent
It is independent between the relationships jeff’s rununing out of gas and Liz watching everning news.
Using Permutation:
ways <- factorial(14)/factorial(14-8)
ways
## [1] 121080960
jellybeans <- round(choose(9,0)*choose(4,1)*choose(9,3)/choose(22,4), 4)
jellybeans
## [1] 0.0459
\[ \frac{11!}{7!}\]
=11???10???9???8 =7920
Test:
result<- factorial(11)/factorial(7)
result
## [1] 7920
The other 33% of subscribers to a fitness magazine are 34 or younger than.
win <- choose(4,3) / 2^4
win
## [1] 0.25
loss <- 1-win
loss
## [1] 0.75
Expected <- 0.25 * 97 + 0.75 *-30
Expected
## [1] 1.75
Expected value x Times =
# expected value is positive 1.75
Expectedwin <- Expected * 559
Expectedwin
## [1] 978.25
Probwin <- pbinom(4, size=9, prob=0.5)
Probwin
## [1] 0.5
Probloss <- 1- Probwin
Probloss
## [1] 0.5
Expect <- Probwin*23 + Probloss*-26
Expect
## [1] -1.5
Expected value x Times =
# expected value is negative - 1.5
Expectedloss <- Expect * 994
Expectedloss
## [1] -1491
Prob_lie <-0.2
Prob_truth <- 0.8
Prob_possitive_lie <- 0.59 * Prob_lie
Prob_negative_lie <- 0.41 * Prob_lie
Prob_possitive_truth <- 0.9 * Prob_truth
Prob_negative_truth <- 0.1 * Prob_truth
lier <- round(Prob_possitive_lie /(Prob_possitive_lie + Prob_negative_truth), 4)
lier
## [1] 0.596
truth <- round( Prob_possitive_truth / (Prob_negative_lie + Prob_possitive_truth) , 4)
truth
## [1] 0.8978
P(AUB) = 1- P(Notliar N possitive_truth)
AUB <- 1-Prob_possitive_truth
AUB
## [1] 0.28