pred_marbles <- 54 / (54 + 9 + 75)
pwhite_marbles <- 9 / (54 + 9 + 75)
pblue_marbles <- 75 / (54 + 9 + 75)
round(pred_marbles + pblue_marbles, 4)
## [1] 0.9348
pred_gold_ball <- 20 / (19 + 20 + 24 + 17)
round(pred_gold_ball, 4)
## [1] 0.25
n <- 81 + 116 + 215 + 130 + 129 + 228 + 79 + 252 + 97 + 72
pno_male_not_parents <- (n - 215)/n
round(pno_male_not_parents, 4)
## [1] 0.8463
Answer: There is no event by going to the gym and losing weight which means that both events are ‘INDEPENDENT’.
vegetables <- choose(8, 3)
condiments <- choose(7, 3)
tortilla <- choose(3, 1)
vegetables * condiments * tortilla
## [1] 5880
Answer: The event is ‘INDEPENDENT’ because there is no causal connection between Jeff running out of gas or Liz watching the evening news.
factorial (14) / factorial (14-8)
## [1] 121080960
red_jellybeans <- choose(9, 0)
orange_jellybeans<- choose(4, 1)
green_jellybeans <- choose(9, 3)
dc <- red_jellybeans * orange_jellybeans * green_jellybeans
all <- choose((9 + 4 + 9), 4)
round(dc/all, 4)
## [1] 0.0459
factorial (11) / factorial (7)
## [1] 7920
Answer: The 33% of suscribers to a fitness magazine are 34 or younger.
#Step 1.
v <- pbinom(3, size=4, prob=0.5) - pbinom(2, size=4, prob=0.5)
v
## [1] 0.25
#Step 2.
n <- 1 - v
559 * ((v*97) - (n*30))
## [1] 978.25
#Step 1.
v <- pbinom(4, size=9, prob=0.5)
v
## [1] 0.5
#Step 2.
n <- 1 - v
994 * ((v*23) - (n*26))
## [1] -1491
#a.
liar <- 0.2
det <- 0.59
liar * det
## [1] 0.118
#b.
tf <- 0.8
det <- 0.9
tf * det
## [1] 0.72
#c.
liar <- 0.2
det <- 0.59
liar * det
## [1] 0.118
prob_sta <- liar + det - (liar * det)
prob_sta
## [1] 0.672