red_m<-54
white_m<-9
blue_m<-75
red_or_blue<-red_m + blue_m
round(red_or_blue / (red_or_blue + white_m),4)
## [1] 0.9348
2.You are going to play mini golf. A ball machine that contains 19 green golf balls, 20 red golf balls, 24 blue golf balls, and 17 yellow golf balls, randomly gives you your ball. What is the probability that you end up with a red golf ball? Express your answer as a simplified fraction or a decimal rounded to four decimal places.
green<-19
red<-20
blue<-24
yellow<-17
round(red/(green+red+blue+yellow),4)
## [1] 0.25
3.A pizza delivery company classifies its customers by gender and location of residence. The research department has gathered data from a random sample of 1399 customers. The data is summarized in the table below.
not_males_with_parents<-228+79+252+97+72+215
males_not_with_parents<-81+116+130+129
round((not_males_with_parents/(not_males_with_parents+males_not_with_parents)),4)
## [1] 0.6741
4.Determine if the following events are independent. Going to the gym. Losing weight. Answer: A) Dependent B) Independent
vegetables<-choose(8,3)
condiments<-choose(7,3)
tortillas<-3
wraps<-vegetables*condiments*tortillas
wraps
## [1] 5880
6.Determine if the following events are independent. Jeff runs out of gas on the way to work. Liz watches the evening news. Answer: A) Dependent B) Independent B)
7.The newly elected president needs to decide the remaining 8 spots available in the cabinet he/she is appointing. If there are 14 eligible candidates for these positions (where rank matters), how many different ways can the members of the cabinet be appointed?
factorial(14)/(factorial(14-8))
## [1] 121080960
red_jb<-9
orange_jb<-4
green_jb<-9
nom<-choose(red_jb,0)*choose(orange_jb,1)*choose(green_jb,3)
denom<-choose(red_jb+orange_jb+green_jb,4)
round(nom/denom,4)
## [1] 0.0459
9.Evaluate the following expression. 11!/7!
(factorial(11)/factorial(7))
## [1] 7920
11.If you throw exactly three heads in four tosses of a coin you win $97. If not, you pay me $30. Step 1. Find the expected value of the proposition. Round your answer to two decimal places. Step 2. If you played this game 559 times how much would you expect to win or lose? (Losses must be entered as negative.)
expected_value<-round((97/4 - 30*.75),2)
expected_value
## [1] 1.75
(expected_value*559)
## [1] 978.25
12.Flip a coin 9 times. If you get 4 tails or less, I will pay you $23. Otherwise you pay me $26. Step 1. Find the expected value of the proposition. Round your answer to two decimal places. Step 2. If you played this game 994 times how much would you expect to win or lose? (Losses must be entered as negative.)
win<-pbinom(4,size = 9, prob = .5)
loss<-1-win
e_value<-round(23*win - 26*loss,2)
e_value
## [1] -1.5
(e_value*994) #You would lose $1491
## [1] -1491
The sensitivity and specificity of the polygraph has been a subject of study and debate for years. A 2001 study of the use of polygraph for screening purposes suggested that the probability of detecting a liar was .59 (sensitivity) and that the probability of detecting a “truth teller” was .90 (specificity). We estimate that about 20% of individuals selected for the screening polygraph will lie. a. What is the probability that an individual is actually a liar given that the polygraph detected him/her as such? (Show me the table or the formulaic solution or both.) b. What is the probability that an individual is actually a truth-teller given that the polygraph detected him/her as such? (Show me the table or the formulaic solution or both.) c. What is the probability that a randomly selected individual is either a liar or was identified as a liar by the polygraph? Be sure to write the probability statement.
If 20% will lie then 80% will tell the truth a.
L<-0.2
T<-0.8
(RL<- (0.2*0.59))
## [1] 0.118
(FL<- (0.2 - 0.118))
## [1] 0.082
(RT<- (0.8*0.9))
## [1] 0.72
(FT<- (0.8 - 0.72))
## [1] 0.08
(FL+RL)
## [1] 0.2
(FT+RT)
## [1] 0.8
Sensitivity and Specificity
(Sensitivity<-(RL/(RL+FL)))
## [1] 0.59
(Specificity<-(RT/(RT+FT)))
## [1] 0.9
(PL<-RL/(RL+FT))#probability that an individual is actually a liar
## [1] 0.5959596
(TT<-RT/(RT+FL)) #probability that an individual is actually telling the truth
## [1] 0.8977556
RL_FL<-0.118+0.08
RL_FL
## [1] 0.198
PRS<-(L+RL_FL)-RL
PRS
## [1] 0.28