HW6
Probability of red when drawn = 54/1380 = 0.39
Probability of blue when drawn = 75/138 = 0.54
Now, probability of red or blue = 0.39 + 0.54 = 0.93
Probability of red = 20 / 80 = 0.25
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. Answer: Let, NM represent not male and NP represent doe not live parents
P(NM or NP) = P(NM) + P(NP) - P(NM and NP)
P(NM) = Total Not Males/Total Customers = (228 + 79 + 252 + 97 + 72) / 1399 = 728/1399
P(NP) = Total Not Parents/Total Customers = (81 + 228 + 116 + 79 + 130 + 97 + 129 + 72)/1399 = 932/1399
P(NM and NP) = (228 + 79 + 97 + 72)/1399 = 476/1399
P(NM or NP) = 728/1399 + 932/1399 - 476/1399 = 1184/1399
Therefore, the answer is = 0.8463
Answer: A) Dependent B) Independent
The answer is A) Dependent because by going to the gym and working out leads to losing weight.
Wraps <- choose(8,3) * choose(7,3) * choose(3,1)
Wraps
## [1] 5880
There are total 5880 different kinds of wraps that can be made from this combination.
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
Here, The events are independent, there is no connection between any of these events.
total_spots <- 8
candidates <- 14
factorial(candidates)/(factorial(candidates - total_spots))
## [1] 121080960
There are total 121080960 ways the members can be appointed.
red_jb <- 9
orange_jb <- 4
green_jb <- 9
red_jb <- factorial(red_jb)/(factorial(red_jb - 0)*factorial(0))
orange_jb <- factorial(orange_jb)/(factorial(orange_jb - 1)*factorial(1))
green_jb <- factorial(green_jb)/(factorial(green_jb-3)*factorial(3))
total_jb <- factorial(22)/(factorial(22 - 4)*factorial(4))
round((red_jb * orange_jb * green_jb)/total_jb, 4)
## [1] 0.0459
The answer is 0.0459.
Here, fraction = 11! / 7! = (11 * 10 * 9 * 8 * 7!) / 7!
= 7920
Describe the complement of the given event. 67% of subscribers to a fitness magazine are over the age of 34. Answer: This means that 33% of the subscribers to a fitness magazine are younger than 34 years.
If you throw exactly thre 11. e 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. Answer:
total <- 2^4
zero_heads <- factorial(4)/(factorial(4-0)*factorial(0))/total
one_heads <- factorial(4)/(factorial(4-1)*factorial(1))/total
two_heads <- factorial(4)/(factorial(4-2)*factorial(2))/total
three_heads <- factorial(4)/(factorial(4-3)*factorial(3))/total
four_heads <- factorial(4)/(factorial(4-4)*factorial(4))/total
heads_probability <- data.frame(c(zero_heads, one_heads, two_heads, three_heads, four_heads))
gamble <- c(-30,-30,-30, 97,-30)
(expected_value <- sum(gamble * heads_probability[,1]))
## [1] 1.75
Step 2. If you played this game 559 times how much would you expect to win or lose? (Losses must be entered as negative.) Answer: since the value is positive in above calculation
win <- 559 * expected_value
win
## [1] 978.25
Answer:
for (i in 0:4){
value <- choose(9, i)
value <- value + value
}
four_tails_or_less <- round(value/(2^9), 2)
five_tails_or_more <- 1-four_tails_or_less
(exp_value <- sum(four_tails_or_less * 23, five_tails_or_more * -26))
## [1] -1.99
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: since, the value is negative in above calculation
loss <- 994 * exp_value
loss
## [1] -1978.06
Answer:
liar <- 0.59
truth_teller <- 0.9
percent_will_lie <- 0.20
prob_liar_detected <- (liar * percent_will_lie)/(((1-percent_will_lie) * (1-truth_teller)) + (percent_will_lie * liar))
round(prob_liar_detected, 4)
## [1] 0.596
liar <- 0.59
truth_teller <- 0.9
percent_will_lie <- 0.20
prob_truth_detected <- ((truth_teller) * (1 - percent_will_lie))/(((1 - liar) * (percent_will_lie)) + (truth_teller * (1 - percent_will_lie)))
round(prob_truth_detected, 4)
## [1] 0.8978
percent_will_lie <- .2
liar <- 0.59
prob_liar_detected <- 0.596
liar_or_identified <- (liar + percent_will_lie) - prob_liar_detected
liar_or_identified
## [1] 0.194