9.2 - Problem 7

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.

  1. Find the expected value and the variance for the height obtained using this instrument once.
  2. Estimate the probability that in 18 independent measurements of this tower, the average of the measurements is between 199 and 201, inclusive.

a - E(X) = height + error = 200 + \(\frac{(\sum error)}{total \space errors}\), V(X) = \(\frac{\sum error^2}{total \space errors}\)

error <- c(-2, -1, 0, 1, 2)
error_count <- length(error)
height <- 200
expected_value <-200+(sum(error[1:length(error)])/error_count)
variance <- sum((error[1:length(error)])^2)/error_count
cat(sprintf("%s = %f \n", c(" E(x) = expected value","V(x) = variance"), c(expected_value, variance)))
##  E(x) = expected value = 200.000000 
##  V(x) = variance = 2.000000

b - \(S_{18}=\sum_{i=1}^{18}X_i=X_{1}+X_{2}+X_{3}...X_{18}\), \(199 \leq \frac{S^{n}}{n} \leq 201\)

count <- 18
average_expected_value <- expected_value
average_variance <- variance/count
probability_199 <- (199-expected_value)/sqrt(average_variance)
probability_201 <- (201-expected_value)/sqrt(average_variance)
cat(sprintf("%s = %f \n", c(" P(X) = probability"), c((0.5-dnorm(probability_199))+(0.5-dnorm(probability_201)))))
##  P(X) = probability = 0.991136