A surveying instrument makes an error of −2, −1, 0, 1, or 2 feet with equal probabilities when measuring the height of a 200-foot tower.

(a) Find the expected value and the variance for the height obtained using this instrument once.

act_height <- 200
exp_err <- 1/5*(-2+(-1)+0+1+2)

# expected value for the height obtained using this instrument once
exp_val <- act_height + exp_err
exp_val
## [1] 200
# expected variance for the height obtained using this instrument once
var <- 1/5*((-2)^2+ (-1)^2+ 0^2+ 1^2+ 2^2)
var
## [1] 2

(b) Estimate the probability that in 18 independent measurements of this tower, the average of the measurements is between 199 and 201, inclusive.

# Calculate P(199<=Sn<=201)

# calculate std error 
std_err <- sqrt(var/18)

# lower and upper bound
avg_199 <- (199-act_height) / std_err
avg_201 <- (201-act_height) / std_err

# probability that average of the measurements is between 199 and 201 after 18 independent measurements
round((pnorm(avg_201) - pnorm(avg_199)), 4)
## [1] 0.9973