Q1. A researcher wishes to conduct a study of the color preferences of new car buyers. Suppose that 50% of this population prefers the color red. If 20 buyers are randomly selected, what is the probability that between 9 and 12 (both inclusive) buyers would prefer red?

Round your answer to four decimal places.

plot(x    = 0:20,
     y    = dbinom(x    = 0:20,
                   size = 20,
                   prob = .5
     ),
     type = 'h',
     main = 'Binomial Distribution (n=20, p=0.5)',
     ylab = 'Probability',
     xlab = '# Successes',
     lwd  = 3
)

# pbinom gets same cumulative probability
dbinom(x = 9:12, size = 20, prob = .5)
## [1] 0.1601791 0.1761971 0.1601791 0.1201344
sum(dbinom(x = 9:12, size = 20, prob = .5))
## [1] 0.6166897
round(x = sum(dbinom(x = 9:12, size = 20, prob = .5)), digits = 4)
## [1] 0.6167

0.6167

Q2. A quality control inspector has drawn a sample of 13 light bulbs from a recent production lot. Suppose 20% of the bulbs in the lot are defective. What is the probability that less than 6 but more than 3 bulbs from the sample are defective?

Round your answer to four decimal places.

plot(x    = 0:13, 
     y    = dbinom(x    = 0:13, 
                   size = 13, 
                   prob = .2
                  ), 
     type = 'h',
     main = 'Binomial Distribution (n=13, p=0.2)',
     ylab = 'Probability',
     xlab = '# Successes',
     lwd  = 3
     )

dbinom(x = 4:5, size = 13, prob = .2)
## [1] 0.15354508 0.06909529
sum(dbinom(x = 4:5, size = 13, prob = .2))
## [1] 0.2226404
round(x = sum(dbinom(x = 4:5, size = 13, prob = .2)),digits = 4)
## [1] 0.2226

0.2226

Q3. The auto parts department of an automotive dealership sends out a mean of 4.2 special orders daily. What is the probability that, for any day, the number of special orders sent out will be no more than 3?

Round your answer to four decimal places.

plot(x    = 0:10,
     y    = dpois(x = 0:10,
                  lambda = 4.2
                ),
     type = 'h',
     main = 'Poisson Distribution (lambda=4.2)',
     ylab = 'Probability',
     xlab = '# Special Orders',
     lwd  = 3
)

ppois(3, lambda = 4.2)
## [1] 0.3954034
round(x = ppois(3, lambda = 4.2), digits = 4)
## [1] 0.3954

0.3954

Q4. A pharmacist receives a shipment of 17 bottles of a drug and has 3 of the bottles tested. If 6 of the 17 bottles are contaminated, what is the probability that less than 2 of the tested bottles are contaminated?

Round your answer to four decimal places.

plot(x    = 0:3,
     y    = dhyper(x    = 0:3,
                   m = 6,
                   n = 17-6,
                   k = 3
     ),
     type = 'h',
     main = 'Hypergeometric Distribution',
     ylab = 'Probability',
     xlab = '# Contaminated Bottles',
     lwd  = 3
)

res = sum(dhyper(x = 0:1, m = 6, n = 17-6, k = 3))

round(x = res, digits = 4)
## [1] 0.7279

0.7279

Q5. A town recently dismissed 6 employees in order to meet their new budget reductions. The town had 6 employees over 50 years of age and 19 under 50. If the dismissed employees were selected at random, what is the probability that more than 1 employee was over 50?

Round your answer to four decimal places.

plot(x    = 0:6,
     y    = dhyper(x = 0:6,
                   m = 6,
                   n = 19,
                   k = 6
                ),
     type = 'h',
     main = 'Hypergeometric Distribution (N=25, n=6, S=6)',
     ylab = 'Probability',
     xlab = '# of Employees Over 50',
     lwd  = 3
)

res <- sum(dhyper(x = 2:6, m = 6, n = 19, k = 6))

round(res, 4)
## [1] 0.4529

0.4259

Q6. The weights of steers in a herd are distributed normally. The variance is 90,000 and the mean steer weight is 800 lbs. Find the probability that the weight of a randomly selected steer is between 1040 and 1460 lbs.

Round your answer to four decimal places.

mu <- 800
sigma <- 300

x <- seq(from       =  mu - 3*sigma,
         to         =  mu + 3*sigma,
         length.out =  1000
)

pdf <- dnorm(x    = x,
             mean = mu,
             sd   = sigma
)

plot(x    = x,
     y    = pdf,
     type = 'l',
     col  = 'blue',
     lwd  = 2,
     xlab = 'Weight ',
     ylab = 'Density',
     main = 'Normal Distribution with Mean 800 and SD 300'
)

x_shade <- seq(from = 1040,
               to   = 1460,
               length.out = 1000
)

pdf_shade <- dnorm(x    = x_shade,
                   mean = mu,
                   sd   = sigma
)

polygon(x      =  c(x_shade, rev(x_shade)),
        y      =  c(pdf_shade, rep(x      = 0,
                                   times  = length(pdf_shade)
        )
        ),
        col    = 'red',
        border = NA
)

res <- pnorm(q = 1460, mean = mu, sd = sigma) - pnorm(q = 1040, mean = mu, sd = sigma)
round(res, 4)
## [1] 0.198

0.198

Q7. The diameters of ball bearings are distributed normally. The mean diameter is 106 millimeters and the standard deviation is 4 millimeters. Find the probability that the diameter of a selected bearing is between 103 and 111 millimeters.

Round your answer to four decimal places.

mu    <- 106
sigma <- 4

x <- seq(from       =  mu - 3*sigma,
         to         =  mu + 3*sigma,
         length.out =  1000
)

pdf <- dnorm(x    = x,
             mean = mu,
             sd   = sigma
)

plot(x    = x,
     y    = pdf,
     type = 'l',
     col  = 'blue',
     lwd  = 2,
     xlab = 'Diameter',
     ylab = 'Density',
     main = 'Normal Distribution with Mean 106 and SD 4'
)

x_shade <- seq(from       = 103,
               to         = 111,
               length.out = 100
)

pdf_shade <- dnorm(x    = x_shade,
                   mean = mu,
                   sd   = sigma
)

polygon(x      = c(x_shade, rev(x_shade)),
        y      = c(pdf_shade, rep(x = 0,
                                  times = length(pdf_shade)
        )
        ),
        col    = 'red',
        border = NA
)

res <- pnorm(q = 111, mean = mu, sd = sigma) - pnorm(q = 103, mean = mu, sd = sigma)
round(res, 4)
## [1] 0.6677

0.6677

Q8. The lengths of nails produced in a factory are normally distributed with a mean of 3.34 centimeters and a standard deviation of 0.07 centimeters. Find the two lengths that separate the top 3% and the bottom 3%. These lengths could serve as limits used to identify which nails should be rejected.

Round your answer to the nearest hundredth (2 decimal places)

mu    <- 3.34
sigma <- 0.07

x <- seq(from       =  mu - 3*sigma,
         to         =  mu + 3*sigma,
         length.out =  1000
)

pdf <- dnorm(x    = x,
             mean = mu,
             sd   = sigma
)

plot(x    = x,
     y    = pdf,
     type = 'l',
     col  = 'blue',
     lwd  = 2,
     xlab = 'Length',
     ylab = 'Density',
     main = 'Normal Distribution with Mean 3.34 and SD 0.07'
)

lower <- qnorm(p = 0.03, mean = mu, sd = sigma)
upper <- qnorm(p = 0.97, mean = mu, sd = sigma)

abline(v = lower, col = 'cyan', lty = 2)
abline(v = upper, col = 'yellow', lty = 2)

round(lower, 2)
## [1] 3.21
round(upper, 2)
## [1] 3.47

3.21, 3.47

Q9.9. A psychology professor assigns letter grades on a test according to the following scheme.

A: Top 9% of scores

B: Scores below the top 9% and above the bottom 63%

C: Scores below the top 37% and above the bottom 17%

D: Scores below the top 83% and above the bottom 8%

F: Bottom 8% of scores

Scores on the test are normally distributed with a mean of 75.8 and a standard deviation of 8.1. Find the minimum score required for an A grade.

Round your answer to the nearest whole number, if necessary

mu    <- 75.8
sigma <- 8.1

x <- seq(from       =  mu - 3*sigma,
         to         =  mu + 3*sigma,
         length.out =  1000
)

pdf <- dnorm(x    = x,
             mean = mu,
             sd   = sigma
)

plot(x    = x,
     y    = pdf,
     type = 'l',
     col  = 'blue',
     lwd  = 2,
     xlab = 'Scores',
     ylab = 'Density',
     main = 'Normal Distribution with Mean 75.8 and SD 8.1'
)

lower <- qnorm(p = 0.91, mean = mu, sd = sigma)
abline(v = lower, col = 'yellow', lty = 2)

round(lower)
## [1] 87

87

Q10. 10. Consider the probability that exactly 96 out of 155 computers will not crash in a day. Assume the probability that a given computer will not crash in a day is 61%. Approximate the (binomial) probability using the normal distribution.

Round your answer to four decimal places.

mu <- 155 * 0.61
sigma <- sqrt(155 * 0.61 * 0.39)

x <- seq(from       =  mu - 3*sigma,
         to         =  mu + 3*sigma,
         length.out =  1000
)

pdf <- dnorm(x    = x,
             mean = mu,
             sd   = sigma
)

plot(x = x,
     y = pdf,
     type ='l',
     lwd = 2,
     col = "blue",
     xlab = "Number of computers",
     ylab = "Density",
     main = "Approximate the (binomial) probability using the normal distribution"
)

x_shade <- seq(from = 95.5,
               to   = 96.5,
               length.out = 1000
)

pdf_shade <- dnorm(x    = x_shade,
                  mean = mu,
                  sd   = sigma
)

polygon(x      = c(x_shade, rev(x_shade)),
        y      = c(pdf_shade, rep(x = 0, times = length(x_shade))),
        col    = 'red',
        border = NA
)

abline(v = 95.5, col = "yellow", lty = 2)
abline(v = 96.5, col = "yellow", lty = 2)

res <- pnorm(96.5, mean=mu, sd=sigma) - pnorm(95.5, mean=mu, sd=sigma)
round(res, 4)
## [1] 0.0638

0.0638