P_R <- 54
P_W <- 9
P_B <- 75
S <- 54 + 9 + 75
paste0("sample Space is ",S)## [1] "sample Space is 138"
PRB <- round((P_R/S * P_B/S),4)
paste0("Probability of Red or Blue ",PRB)## [1] "Probability of Red or Blue 0.2127"
S <- 19 + 20 + 24 + 17
paste0("sample Space is ",S)## [1] "sample Space is 80"
pr <- 20/S
paste0("probability of red ball ",pr)## [1] "probability of red ball 0.25"
Total <- 1399
P_M <- 215/Total # probability of male living with parents
P <- 1 - P_M
paste0("customer is not male or does not live with parents is = ",P)## [1] "customer is not male or does not live with parents is = 0.846318799142245"
Answer: A) Dependent - Going to gym helps stay fit and loose extra fats
Answer: Total_different_wraps = (selecting 3 vegetables from 8) * (selecting 3 condiments from 7) * (select 1 tortilla from 3)
T <- choose(8,3) * choose(7,3) * choose(3,1)
paste0("Total veg wraps = ",T)## [1] "Total veg wraps = 5880"
Answer :- Independant - Not able to find any connection between running out of gas and watching TV
Answer:-
C <- choose(14,8)
C## [1] 3003
No of ways members can be appointed is 3003
Answer:- Here Sample space S = 9 + 4 + 9 = 22
Now probability of drawing 0 red and 1 orange and 3 green from 4 beans is
r <- choose(9,0)
r## [1] 1
o <- choose (4,1)
g <- choose(9,3)
T <- r * o * g
#Now probability of choosing 4 beans from sample 22
S <- choose(22,4)
T/S## [1] 0.04593301
Answer :- Manually doing this
(11x10x9x8x7x6x5x4x3x2x1)/(7x6x5x4x3x2*1) solving this we get 11x 10x9x8 = 7920
S <- factorial(11)/factorial(7)
S## [1] 7920
Answer:- 1 - 0.67 = 0.33 So complement will be 33% of subscribers of fitness magazine are below age of 34
Answer:- Probability of getting head in 1 toss = 1/2 So P(head in 3 toss) = 1/21/21/2 = 1/8
Step 1. Find the expected value of the proposition. Round your answer to two decimal places.
So expected value = P(win)97+(1-P(win)(-30)
P <- 1/8*97 - ((1-1/8)*30)
paste0("expected value is = ",P)## [1] "expected value is = -14.125"
Step 2. If you played this game 559 times how much would you expect to win or lose? (Losses must be entered asnegative.)
Answer:- we already know the expected value of each possible game. So now you just need to multiply that by 559 to get expected loss on 559 games.
P <- 559 * -14.125
paste0("Loss is = ",P)## [1] "Loss is = -7895.875"
Answer:- Calculating using R
P_tails = pbinom(4,size = 9,prob = 0.5)
P_tails## [1] 0.5
Step 1. Find the expected value of the proposition. Round your answer to two decimal places.
Answer:- So expected value = P(tails)x23+(1-P(tail)x(-26)
Exp_vl <- P_tails*23 - ((1-P_tails)*26)
paste0("expected value is = ",Exp_vl)## [1] "expected value is = -1.50000000000001"
Step 2. If you played this game 994 times how much would you expect to win or lose? (Losses must be entered as negative.)
Answer:-
P <- 994 * Exp_vl
paste0("Loss is = ",P)## [1] "Loss is = -1491.00000000001"
P_Liar <- 0.2
P_Truth <- 0.8
senstivity <- 0.59
specificity <- 0.90
P_detectliar <- 0.59 * P_Liar
P_detectliar## [1] 0.118
P_detecttruth <- 0.90 * P_Truth
P_detecttruth## [1] 0.72
P_falsedetectliar <- (1-0.59)*P_Liar
P_falsedetectliar## [1] 0.082
P_falsedetecttruth <- (1-0.9)*P_Truth
P_falsedetecttruth## [1] 0.08
ANswer:-
liar <- P_detectliar /(P_detectliar + P_falsedetecttruth)
liar## [1] 0.5959596
truth <- P_detecttruth / (P_detecttruth + P_falsedetectliar)
truth## [1] 0.8977556
Answer:- P(Lair\(\cup\)detectliar) = P(Liar) + P(detectliar) - P(Liar\(\cap\)detectliar)
P <- 0.2 + 0.59 - 0.118
P## [1] 0.672