pr <- 54 / (54 + 9 + 75)
pw <- 9 / (54 + 9 + 75)
pb <- 75 / (54 + 9 + 75)
round(pr + pb, 4)
## [1] 0.9348
pr <- 20 / (19 + 20 + 24 + 17)
round(pr, 4)
## [1] 0.25
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.
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.
n <- 81 + 116 + 215 + 130 + 129 + 228 + 79 + 252 + 97 + 72
p3 <- (n - 215)/n
round(p3, 4)
## [1] 0.8463
Solution: A (Dependent). Unless of course, you go to the gym and don’t exercise. Unless perhaps you ride your bike to the gym.
v <- choose(8, 3)
c <- choose(7, 3)
t <- choose(3, 1)
v * c * t
## [1] 5880
Solution:B (Independent) Unless of course Jeff and Liz are married, and somehow his running out of gas on the way to work makes it more likely Liz watches evening news. Let’s say Jeff works late because he missed work in the morning handling his gas situation, and Liz never watches the evening news when Jeff is home because Jeff hates it, then she might watch it solely because Jeff is still at work, in which case they would not be independent.
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
r <- choose(9, 0)
o <- choose(4, 1)
g <- choose(9, 3)
all <- r * o * g
total <- choose((9 + 4 + 9), 4)
round(all/total, 4)
## [1] 0.0459
factorial (11) / factorial (7)
## [1] 7920
Solution: Compliment: 33% of subscribers to a fitness magazine are 34 or younger.
v <- pbinom(3, size=4, prob=0.5) - pbinom(2, size=4, prob=0.5)
v
## [1] 0.25
Step 2. If you played this game 559 times how much would you expect to win or lose? (Losses must be entered as negative.)
n <- 1 - v
559 * ((v*97) - (n*30))
## [1] 978.25
Step 1. Find the expected value of the proposition. Round your answer to two decimal places.
v <- pbinom(4, size=9, prob=0.5)
v
## [1] 0.5
Step 2. If you played this game 994 times how much would you expect to win or lose? (Losses must be entered as negative.)
n <- 1 - v
994 * ((v*23) - (n*26))
## [1] -1491
liar <- 0.2
dt <- 0.59
liar * dt
## [1] 0.118
tf <- 0.8
dt <- 0.9
tf * dt
## [1] 0.72
liar <- 0.2
dt <- 0.59
liar * dt
## [1] 0.118
p13 <- liar + dt - (liar * dt)
p13
## [1] 0.672