RedMarble <- 54
WhitewMarble <- 9
BlueMarble <- 75
p <- round((RedMarble+BlueMarble)/(WhitewMarble+RedMarble+BlueMarble),4)
p
## [1] 0.9348
The probability that the marble is red or blue is 0.9348
GreenBall <- 19
RedBall <- 20
BlueBall <- 24
YellowBall <- 17
AllTogether <- GreenBall + RedBall + BlueBall + YellowBall
p.RedBall <- round( RedBall/AllTogether,4)
p.RedBall
## [1] 0.25
The probability that you end up with red golf ball is 0.25 or 25%
data.frame(Housing= c("Apartment","Dorm","With Parent(s)","Sorority/Fraternity House","Other"),Males= c(81,116,215,130,129),Females= c(228,79,252,97,72))
## Housing Males Females
## 1 Apartment 81 228
## 2 Dorm 116 79
## 3 With Parent(s) 215 252
## 4 Sorority/Fraternity House 130 97
## 5 Other 129 72
What is the probability that a customer is not male or does not live with parents? Write your answer as a fraction or a decimal number rounded to four decimal places.
AllTogether <- 81 + 116 + 215 + 130 + 129 + 228 + 79 + 252 + 97 + 72
not_male <- 228 + 79 + 252 + 97 + 72
not_live_parent <- 81 + 228 + 116 + 79 + 130 + 97 + 129 + 72
not_male_not_live_parent <- 228 + 79 + 97 + 72
our.p <- not_male/AllTogether + not_live_parent/AllTogether - not_male_not_live_parent/AllTogether
round(our.p, 4)
## [1] 0.8463
The probability that a customer is not male or does not live with parents is 0.8463
Answer: A) Dependent
veggies <- choose(8, 3)
condiments <- choose(7, 3)
tortillas <- choose(3, 1)
veggie.wraps <- veggies * condiments * tortillas
veggie.wraps
## [1] 5880
There can be made 5880 different veggie wraps.
6.Determine if the following events are independent: - Jeff runs out of gas on the way to work. - Liz watches the evening news.
Answer: B) Independent
howMany <- factorial(14)/factorial(14-8)
howMany
## [1] 121080960
121080960 different ways can the memmbers of the cabinet be appointed.
8.A bag contains 9 red, 4 orange, and 9 green jellybeans. What is the probability of reaching into the bag and randomly withdrawing 4 jellybeans such that the number of red ones is 0, the number of orange ones is 1, and the number of green ones is 3? Write your answer as a fraction or a decimal number rounded to four decimal places.
red <- choose(9, 0)
orange <- choose(4, 1)
green <- choose(9, 3)
withdrawing_4_jellybeans <- choose(9 + 4 + 9, 4)
x <- red * orange * green / withdrawing_4_jellybeans
round(x, 4)
## [1] 0.0459
The probability of reaching into the bag and randomly withdrawing 4 jellybeans is 0.0459
factorial(11)/factorial(7)
## [1] 7920
10.Describe the complement of the given event:
33% of subscribers to a fitness magazine are 34 years old or younger.
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.)
Step 1:
win_prob <- dbinom(3, size = 4, prob = 0.5)
loss_prob <- 1 -win_prob
expected <- win_prob * 97 + loss_prob*-30
round(expected, 2)
## [1] 1.75
Expected value to win is $1.75.
Step 2:
559 * 1.75
## [1] 978.25
if I play 559 times, I expected to win: $978.25
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.)
Step 1:
win_prob <- dbinom(4, size = 9, prob = 0.5) + dbinom(3, size = 9, prob = 0.5)+ dbinom(2, size = 9, prob = 0.5)+ dbinom(1, size = 9, prob = 0.5)+ dbinom(0, size = 9, prob = 0.5)
loss_prob <- 1 -win_prob
expected <- win_prob * 23 + loss_prob*-26
expected
## [1] -1.5
The expected value of the proposition is -1.5.
Step 2:
expected * 994
## [1] -1491
If I played this game 994 times, I would expect to lose -1491.
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.)
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.)
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.
p.sensitivity <- 0.59
p.specificity <- 0.90
p.liar <- 0.2
p.truth <- 0.8
p.a <- (p.liar * p.sensitivity) / ((p.liar * p.sensitivity) + (p.truth * (1 - p.specificity)))
round(p.a, 4)
## [1] 0.596
The probability that an individual is actually a liar given that the polygraph detected him/her as such is 0.596
p.b <- (p.truth * p.specificity) / ((p.truth * p.specificity) + (p.liar * (1 - p.sensitivity)))
round(p.b, 4)
## [1] 0.8978
The probability that an individual is actually a truth-teller given that the polygraph detected him/her as such is 0.8978
p.c <- p.liar + (1 - p.specificity) * p.truth
round(p.c, 4)
## [1] 0.28
The probability that a randomly selected individual is either a liar or was identified as a liar by the polygraph is 0.28