1. 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. Use the round() function in R.
# A Binomial
pr <- .5
N <- 20
mSet <- 9:12
round(sum(dbinom(mSet, N, pr)),4)
## [1] 0.6167
2. 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.
# A Binomial Distribution
pd <- .2
N <- 13
mSet <- 4:5  # Assuming Less than 3, more than 6 is 4 or 5
round(sum(dbinom(mSet, N, pd)),4)
## [1] 0.2226
mSet <- 3:6  # If 3 to 6 is inclusive
round(sum(dbinom(mSet, N, pd)),4)
## [1] 0.4913
3. 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.
# A Poisson Distribution
r <- 4.2 # orders per day
n <- 0:3 # no more than 3 orders on any given day
round(sum(dpois(x = n, lambda = 4.2)),4)
## [1] 0.3954
4. 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.
# A Hypergeometric Distribution
pop <- 17
s <- 6 # successes
f <- 11 # failures
x <- 2 # what we are looking for
k <- 3 # sample size
round(dhyper(x, s, f, k),4)
## [1] 0.2426
5. 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.
# A Hypergeometric Distribution
pop <- 25
s <- 6 # successes
f <- 19 # failures
x <- 1
k <- 6
round(1-phyper(x, s, f, k),4) # 1 - cumulative probabilities at 1
## [1] 0.4529
6. 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.
# A Normal Distribution
v <- 90000
stdev <- sqrt(v)
mu <- 800
mRange <- 1040:1460
round(sum(dnorm(mRange,mu,stdev)),4) # probability steer is between 1040 and 1460
## [1] 0.1985
7. 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.
# A Normal Distribution
mu <- 106
sd <- 4
mSet <- 103:111. # Assuming inclusive of 103 and 111
round(sum(dnorm(mSet,mu,sd)),4)
## [1] 0.7258
8. 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), if necessary.
You will have to use the quantile function1, qnorm() here. In fact, we have seen a little bit of quintiles already when we talked about median and boxplots.
# A Normal Distribution
mu <- 3.34
sd <- 0.07
pl <- 0.03 # Low Probability
ph <- 0.97 # High Probability
c(round(qnorm(pl,mu,sd),2),round(qnorm(ph,mu,sd),2))
## [1] 3.21 3.47
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.
# A Normal Distribution
mu <- 75.8
sd <- 8.1
mPA <- .91 # Probability of 91% or higher
round(qnorm(mPA,mu,sd),0)
## [1] 87
# Adding a plot here to visualize that the answer might be correct
xseq <- 50:100
yVals <- dnorm(xseq,75.8,sd)
plot(xseq, yVals, type="l", lty=1, xlab="Scores", ylab="Probability", main="Normal Distribution")
# Shading - credit to Michelle Hamann's Week 3 Discussion Post
xshade <- seq(from=qnorm(mPA,mu,sd), to=100, length.out=100)
pdf_shade <- dnorm(x=xshade, mean=75.8, sd=8.1)
polygon(x=c(xshade,rev(xshade)),y=c(pdf_shade,rep(x=0, times=length(pdf_shade))),col='red',border=NA)

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.
# A Binomial Distribution Approximated with a Normal Distribution
pOfS <- .61 # not crash
pOfF <- .39 # crash
n <- 155
k <- 96
mu <- n*pOfS
stdev <- sqrt(n*pOfS*pOfF)
round(pbinom(k,n,pOfS),4) # Binomial
## [1] 0.6238
round(pnorm(k,mu,stdev),4)  # Approximation using Normal Distribution
## [1] 0.5944