3.2 I. What percent of a standard normal distribution N(µ =0,= 1) is found in each region? Be sure to draw a graph.
m <- 0
sd <- 1
z <- -1.13
# find x
x <- (z * sd * m) %>%
print
## [1] 0
# probability x > -1.13
1 - pnorm(x, mean = 0, sd = 1)
## [1] 0.5
# probability plot
normalPlot(mean = 0, sd = 1, bounds = c(x, 1e+06), tails = FALSE)

m <- 0
sd <- 1
z <- 0.18
# finding x
x <- (z * sd * m) %>%
print
## [1] 0
# probability x < .18
pnorm(x, mean = 0, sd = 1)
## [1] 0.5
# probability plot
normalPlot(mean = 0, sd = 1, bounds = c(-1e+06, x), tails = FALSE)

m <- 0
sd <- 1
z <- 8
# finding x
x <- (z * sd * m) %>%
print
## [1] 0
# probability x > 8
1 - pnorm(x, mean = 0, sd = 1)
## [1] 0.5
# probability plot
normalPlot(mean = 0, sd = 1, bounds = c(x, 1e+06), tails = FALSE)

m <- 0
sd <- 1
z <- .5
# finding x
x <- (z * sd * m) %>%
print
## [1] 0
# probability |x| < .5
x1 <- pnorm(-x, mean = 0, sd = 1)
x2 <- pnorm(x, mean = 0, sd = 1)
print(x2 - x1)
## [1] 0
# probability plot
normalPlot(mean = 0, sd = 1, bounds = c(-x, x), tails = FALSE)

3.4
- a.) Group Men, Ages 30 - 34: N(4313, 583) Group Women, Ages 25-29: N(5261, 807)
- b.)
# leo zscore
ltime <- 4948
lm <- 4313
lsd <- 583
zleo <- ((ltime - lm)/lsd) %>%
print
## [1] 1.089194
# mary zscore
mtime <- 5261
mm <- 4313
msd <- 807
zmary <- ((mtime - mm)/msd) %>%
print
## [1] 1.174721
- c.) Mary performed better in her group than Leo because she was in the top 12% of her group as opposed to Leo at 13.80% in his.
# leo rank
leo <- 1 - pnorm(ltime, mean = lm, sd = lsd) %>%
print
## [1] 0.8619658
# mary rank
mary <- 1 - pnorm(mtime, mean = mm, sd = msd) %>%
print
## [1] 0.8799469
pnorm(ltime, mean = lm, sd = lsd) %>%
print
## [1] 0.8619658
pnorm(mtime, mean = mm, sd = msd) %>%
print
## [1] 0.8799469
- f.) The answer to B would not change because Z-scores can be calculated for non-normal distributions. Part E would be difficult to calculate do to it not being a normal distribution.
3.18 The data does follow the 68-95-99.7 rule for the most part.
heights <- c(54,55,56,56,57,58,58,59,60,60,60,61,61,62,62,63,63,63,64,65,65,67,67,69,73)
m <- 61.52
sd <- 4.58
zScores <- (heights - m) / sd
hist(zScores, col="white", freq=F, xlim=c(-5, 5))
curve(dnorm, -3, 3, add=T, col="blue") # 99.7% Rule
curve(dnorm,-2,2,add=T, col="red") # 95% Rule
curve(dnorm,-1,1,add=T, col="orange") # 68% Rules

3.22
- a.) The probability is almost 0% that the 10th transitor will be produced with a defect.
# Rate of success and failure definition
pf <- 0.02
ps <- 1 - pf
n <- 10
# This is a geometric distribution
round(dgeom(n, ps), 4)
## [1] 0
round(ps * (1 - ps)^(n - 1), 4) %>%
print
## [1] 0
- b.) There is a 13.26% chance the machines produces zero defective transitors.
# Rate of success and failure definition
pf <- 0.02
ps <- 1 - pf
n <- 100
# This is a geometric distribution
round(ps^n, 4) %>%
print
## [1] 0.1326
- c.) On average, there should be 50 transitors produced before the first defect, with a standard deviation of 49.50.
# Expected value of a geometric distribution
pf <- 0.02
Ex <- (1/pf) %>%
print
## [1] 50
# standard deviation
sd <- (((1 - pf)/pf^2)^(1/2)) %>%
print
## [1] 49.49747
- d.) On average, there should be 20 transitors before the first defect, with a standard deviation of 19.50.
# Expected value of a geometric distribution
pf <- 0.05
Ex <- (1/pf) %>%
print
## [1] 20
# standard deviation
sd <- (((1 - pf)/pf^2)^(1/2)) %>%
print
## [1] 19.49359
- e.) Increasing the probability of failure decreases the trials before a defect and therefore the waiting time before a failure (success) and standard deviation are smaller.
3.38
n <- 3
k <- 2
pboy <- 0.51
pboy2 <- (choose(n, k) * (1 - pboy)^(n - k) * (pboy)^k) %>%
print
## [1] 0.382347
children <- data.frame(c("BBG", "BGB", "GBB"))
children$p <- c(pboy * pboy * (1 - pboy), pboy * (1 - pboy) * pboy, (1 - pboy) *
pboy * pboy)
names(children) <- c("Kids", "p")
sump <- sum(children$p) %>%
print
## [1] 0.382347
(pboy2 - sump) %>%
print
## [1] 0
children %>%
print
## Kids p
## 1 BBG 0.127449
## 2 BGB 0.127449
## 3 GBB 0.127449
- c.) The second method will be more tedious because a combination of 56 different possibilities will have to be made. This would create a great deal of redundancy.
3.42
# Negative Binomial distribution
p <- 0.15
n <- 10
k <- 3
(choose(n - 1, k - 1) * (1 - p)^(n - k) * p^k) %>%
print
## [1] 0.03895012
- b.) The probability that her 10th serve will be successful is 15% since they are independent events.
- c.) The probability are different because part A was the calculation of a specific scenario with 3 successes in 10 attempts. The probability of B is calculated for only one attempt.