#Soluton to problem 1
xbar <- 1300 #mean
var <- 40000 #variance
std <- sqrt(var) #standard deviation
q <- 979
prob <- round(pnorm(q, mean = xbar, sd = std, lower.tail = FALSE),4)
sprintf("The probability that a randomly selected steer is greater than %s is %s",q,prob)
## [1] "The probability that a randomly selected steer is greater than 979 is 0.9458"
#Solution to problem 2
xbar <- 11000 #mean
var <- 1960000 #variance
std <- sqrt(var) #standard deviation
q <- 8340
prob <- round(pnorm(q, mean = xbar, sd = std, lower.tail = FALSE),4) #probability
sprintf("The probability that a randomly selected SVGA monitor is greater than %s hours is %s",q, prob)
## [1] "The probability that a randomly selected SVGA monitor is greater than 8340 hours is 0.9713"
#Solution to problem 3
xbar <- 80 #Mean in million dollars
std <- 3 #Standard deviation in million dollars
q2 <- 85
q1 <- 83
prob <- round(pnorm(q2, mean = xbar, sd = std, lower.tail = TRUE)- pnorm(q1, mean = xbar, sd = std, lower.tail = TRUE),4)
sprintf("The probability that a randomly selected firm will earn between %s and %s million dollars is %s", q1,q2,prob)
## [1] "The probability that a randomly selected firm will earn between 83 and 85 million dollars is 0.1109"
#Solution to problem 4
xbar <- 456 #Mean of GRE Verbal scores
std <- 123 #Standard deviation of Verbal scores
p <- 0.14
min.score <- round(qnorm(p, mean = xbar, sd = std, lower.tail = FALSE),0)
paste0("The minimum score required for the job offer is ", min.score)
## [1] "The minimum score required for the job offer is 589"
#Solution to problem 5
xbar <- 6.13 #Mean of nail lengths
std <- 0.06 #Standard deviation of nail lengths
p <- 0.07
min.length <- round(qnorm(p, mean = xbar, sd = std, lower.tail = TRUE),2)
max.length <- round(qnorm(p, mean = xbar, sd = std, lower.tail = FALSE),2)
sprintf("The lower and upper limit of nail lengths are %s and %s respectively", min.length, max.length)
## [1] "The lower and upper limit of nail lengths are 6.04 and 6.22 respectively"
#Solution to problem 6
xbar <- 78.8 #Mean scores
std <- 9.8 #Standard deviation of scores
p1 <- 0.2 #Probability for scores above the bottom 20%
p2 <- 0.45 #Probability for scores below top 45%
q1 <- round(qnorm(p1, mean = xbar, sd = std, lower.tail = TRUE),0)
q2 <- round(qnorm(p2, mean = xbar, sd = std, lower.tail = FALSE),0)
sprintf("The numerical limits for a C grade are %s and %s", q1, q2)
## [1] "The numerical limits for a C grade are 71 and 80"
#Solution to problem 7
xbar <- 21.2 #Mean ACT score
std <- 5.4 #Standard deviation of ACT scores
p <- 0.45
score <- round(qnorm(p, mean = xbar, sd = std, lower.tail = TRUE),0)
paste0("The minimum score required for admission is ",score)
## [1] "The minimum score required for admission is 21"
#Solution to problem 8
n <- 151
q <- 10 # for less than 11, q = 10
x <- 0.09
p <- round(pbinom(q = q, size = n, prob = x),4)
paste0("The probability that less than 11 out of 151 students will graduate on time is ", p)
## [1] "The probability that less than 11 out of 151 students will graduate on time is 0.192"
#Solution to problem 9
xbar <- 48 #Mean lifetime of a tire in months
std <- 7 #Standard deviation of lifetime of a tire in months
n <- 147
se <- std/sqrt(n) #Standard Error is the standard deviation of the sampling distribution
q <- 48.83
p <- round(pnorm(q = q, mean = xbar, sd = se, lower.tail = FALSE),4)
sprintf("The probability that the mean of the sample would be greater than %s months is %s", q,p)
## [1] "The probability that the mean of the sample would be greater than 48.83 months is 0.0753"
#Solution to problem 10
xbar <- 91 #Mean life of a computer
std <- 10 #Standard deviation of the mean life of a computer
n <- 68 #Number of samples in the sampling distribution
se <- std/sqrt(n) #Standard Error which is the standard deviation of the sampling distribution
q <- 93.54
p <- round(pnorm(q = q, mean = xbar, sd = se, lower.tail = FALSE),4)
sprintf("The probability that the mean of a sample of %s computers would be greater than %s is %s", n, q, p)
## [1] "The probability that the mean of a sample of 68 computers would be greater than 93.54 is 0.0181"
#Solution to problem 11
x <- 0.07 #Mean proportion
n <- 540 #Number of samples
d <- 3 # difference (plus or minus)
se <- sqrt((x*(1-x))/n) #Standard deviation of a population proportion
q1 <- x - d/100 #lower limit
q2 <- x + d/100 #upper limit
p <- round((pnorm(q = q2, mean = x, sd = se, lower.tail = TRUE)-pnorm(q = q1, mean = x, sd = se, lower.tail = TRUE)),4)
sprintf("The probability that the proportion of no-shows in a sample of %s ticketed passengers would differ from the population proportion by less than %s percent is %s",n,d,p)
## [1] "The probability that the proportion of no-shows in a sample of 540 ticketed passengers would differ from the population proportion by less than 3 percent is 0.9937"
#Solution to problem 12
x <- 0.23 #Mean of defective bottles
n <- 602
d <- 4 # difference (plus or minus)
se <- sqrt((x*(1-x))/n) #Standard deviation of a population proportion
q1 <- x - d/100 #lower limit
q2 <- x + d/100 #upper limit
p <- round((pnorm(q = q1, mean = x, sd = se, lower.tail = FALSE)-pnorm(q = q2, mean = x, sd = se, lower.tail = FALSE)),4)
sprintf("The probability that the proportion of defective bottles in a sample of %s bottles would differ from the population proportion by less than %s percent is %s",n, d, p)
## [1] "The probability that the proportion of defective bottles in a sample of 602 bottles would differ from the population proportion by less than 4 percent is 0.9803"
The confidence interval is :CI = xbar ± t*se where se = σ / (√n);
#Solution to problem 13
xbar = 3.9 #Mean
var = 0.8 #Variance
x = 48
n = 208 #sample size
cl = 0.8 #confidence level
df = n - 1
std = sqrt(var) #Standard deviation
t = abs(qt((1-cl)/2, df)) #t that corresponds to an 80% confidence
se = std/sqrt(n) #Standard Error
CI.lower =round((xbar - t*se),1) #Lower limit of the 80% confidence interval
CI.upper = round((xbar + t*se),1) #Upper limit of the 80% confidence interval
paste0("The lower limit is ", CI.lower)
## [1] "The lower limit is 3.8"
paste0("The upper limit is ", CI.upper)
## [1] "The upper limit is 4"
#Solution to problem 14
xbar = 16.6
n = 7472 #sample size
cl = 0.98 #confidence level
df = n - 1
std = 11 #Standard deviation
t = abs(qt((1-cl)/2, df)) #t that corresponds to an 98% confidence
se = std/sqrt(n) #Standard Error
CI.lower =round((xbar - t*se),1) #Lower limit of the 98% confidence interval
CI.upper = round((xbar + t*se),1) #Upper limit of the 98% confidence interval
paste0("The lower bound is ", CI.lower)
## [1] "The lower bound is 16.3"
paste0("The upper bound is ", CI.upper)
## [1] "The upper bound is 16.9"
Step 1. Choose the picture which best describes the problem. Step 2. Write your answer below.
#Solution to problem 15
#Step 1:
print("Step 1: Answer is Picture B")
## [1] "Step 1: Answer is Picture B"
#Step 2:
print("Step 2:")
## [1] "Step 2:"
p = 0.05
df = 26
t = round(abs(qt(p = p, df = df)),4)
paste0("The value of t is ",t)
## [1] "The value of t is 1.7056"
Step 1. Calculate the sample mean for the given sample data. (Round answer to 2 decimal places) Step 2. Calculate the sample standard deviation for the given sample data. (Round answer to 2 decimal places) Step 3. Find the critical value that should be used in constructing the confidence interval. (Round answer to 3 decimal places) Step 4. Construct the 90% confidence interval. (Round answer to 2 decimal places)
#Solution to problem 16
lab <- c(383.6, 347.1, 371.9, 347.6, 325.8, 337)
#Step 1: Calculate the mean of the given sample data
Mean <- round(mean(lab),2)
paste0("The mean of the sample data is ", Mean)
## [1] "The mean of the sample data is 352.17"
#Step 2: Calculate the sample standard deviation for the given sample data
std <- round(sd(lab),2)
paste0("The standard deviation for the given sample data is ",std)
## [1] "The standard deviation for the given sample data is 21.68"
#Step 3: Calculate the critical value that should be used in constructing the confidence interval
cl <- 0.9 #confidence level
n <- 6
df <- n-1
t <- round(abs(qt((1-cl)/2, df)),3)
se <- std/sqrt(n) #standard error
paste0("The critical value is ",t)
## [1] "The critical value is 2.015"
#Step 4: Construct the 90% confidence interval
CI.lower =round((Mean - t*se),1) #Lower limit of the 98% confidence interval
CI.upper = round((Mean + t*se),1) #Upper limit of the 98% confidence interval
paste0("The lower bound of the confidence interval is ", CI.lower)
## [1] "The lower bound of the confidence interval is 334.3"
paste0("The upper bound of the confidence interval is ", CI.upper)
## [1] "The upper bound of the confidence interval is 370"
Step 1. Find the critical value that should be used in constructing the confidence interval. (Round answer to 3 decimal places) Step 2. Construct the 80% confidence interval. (Round answer to 1 decimal place)
#Solution to problem 17
xbar <- 46.4 #Mean yield of field in bushels per acre
n <- 16 #Number of samples
df <- n - 1
std <- 2.45 #Standard deviation of field in bushels per acre
cl <- 0.8 #confidence level
se <- std/sqrt(n) #standard error
#Step 1: Find the critical value that should be used in constructing the confidence interval
t <- round(abs(qt((1-cl)/2, df)),3)
paste0("The critical value is ",t)
## [1] "The critical value is 1.341"
#Step 2: Construct the 80% confidence interval
CI.lower =round((xbar - t*se),1) #Lower limit of the 98% confidence interval
CI.upper = round((xbar + t*se),1) #Upper limit of the 98% confidence interval
paste0("The lower bound of the confidence interval is ", CI.lower)
## [1] "The lower bound of the confidence interval is 45.6"
paste0("The upper bound of the confidence interval is ", CI.upper)
## [1] "The upper bound of the confidence interval is 47.2"
#Solution to problem 18
xbar <- 8 #Mean of toys per year bought by children
std <- 1.9 #standard deviation of the toys bought
error <- 0.13 #Error of estimation
cl <- 0.99 #confidence level
z <- round(abs(qnorm((1-cl)/2)),2) #z score for 99% confidence level
n <- round((z*std/error)^2,0)
paste0("The sample size would be ", n)
## [1] "The sample size would be 1422"
#Solution to problem 19
xbar <- 12.6 #Mean of bacterial production per hour
var <- 3.61 #Variance of the bacterial production
std <- sqrt(var) #standard deviation of the bacterial production
error <- 0.19 #Error of estimation
cl <- 0.95 #confidence level
z <- round(abs(qnorm((1-cl)/2)),2) #z score for 99% confidence level
n <- round((z*std/error)^2,0)
paste0("The sample size would be ", n)
## [1] "The sample size would be 384"
Step 1. Suppose a sample of 2089 tenth graders is drawn. Of the students sampled, 1734 read above the eighth grade level. Using the data, estimate the proportion of tenth graders reading at or below the eighth grade level. (Write your answer as a fraction or a decimal number rounded to 3 decimal places) Step 2. Suppose a sample of 2089 tenth graders is drawn. Of the students sampled, 1734 read above the eighth grade level. Using the data, construct the 98% confidence interval for the population proportion of tenth graders reading at or below the eighth grade level. (Round your answers to 3 decimal places)
#Solution to problem 20
#Step 1:
n <- 2089 #Size of sample drawn
x <- 1734 #Number of 10th graders that read above 8th grade level
prop_above <- x/n #Proportion of 10th graders that read above 8th grade level
prop_below <- 1 - prop_above #Proportion of 10th graders that reat at or below 8th grade level
paste0("The proportion of tenth graders that read at or below eight grade level is ",round(prop_below,3))
## [1] "The proportion of tenth graders that read at or below eight grade level is 0.17"
#Step 2: Construct 98% confidence interval for the population proportion
cl <- 0.98
se <- sqrt(prop_below*(1-prop_below)/n)
z <- abs(qnorm((1-cl)/2)) #z score for 98% confidence level
CI.lower =round((prop_below - z*se),2) #Lower bound of the 98% confidence interval
CI.upper = round((prop_below + z*se),2) #Upper bound of the 98% confidence interval
paste0("The lower bound of the confidence interval is ", CI.lower)
## [1] "The lower bound of the confidence interval is 0.15"
paste0("The upper bound of the confidence interval is ", CI.upper)
## [1] "The upper bound of the confidence interval is 0.19"
Step 1. Suppose a sample of 474 tankers is drawn. Of these ships, 156 had spills. Using the data, estimate the proportion of oil tankers that had spills. (Write your answer as a fraction or a decimal number rounded to 3 decimal places)
Step 2. Suppose a sample of 474 tankers is drawn. Of these ships, 156 had spills. Using the data, construct the 95% confidence interval for the population proportion of oil tankers that have spills each month. (Round your answers to 3 decimal places)
#Solution to problem 21
#Step 1:
n <- 474 #Size of sample drawn
x <- 156 #Number of tankers that had spills
p <- x/n #Proportion of oil tankers that had spills
paste0("The proportion of oil tankers that had spills is ",round(p,3))
## [1] "The proportion of oil tankers that had spills is 0.329"
#Step 2: Construct 95% confidence interval for the sample proportion
cl <- 0.95
se <- sqrt(p*(1-p)/n)
z <- abs(qnorm((1-cl)/2)) #z score for 95% confidence level
CI.lower =round((p - z*se),3) #Lower bound of the 95% confidence interval
CI.upper = round((p + z*se),3) #Upper bound of the 95% confidence interval
paste0("The lower bound of the confidence interval is ", CI.lower)
## [1] "The lower bound of the confidence interval is 0.287"
paste0("The upper bound of the confidence interval is ", CI.upper)
## [1] "The upper bound of the confidence interval is 0.371"