Page 338 Exercise 1
Let S100 be the number of heads that turn up in 100 tosses of a fair coin. Use the Central Limit Theorem to estimate
n<- 100
p<- 0.5
q<-1-p
mu <- n*p
sigma <- sqrt(n*p*q)
mu
## [1] 50
sigma
## [1] 5
pu <-(45+1/2-50)/5
print(paste0("upper bound = ", pu))
## [1] "upper bound = -0.9"
p <- pnorm(-0.9)
print(paste0("Estimate =: ", p))
## [1] "Estimate =: 0.18406012534676"
#P(Sn > (45-1/2-50)/5)
pl <-(45-1/2-50)/5
print(paste0("lower bound = ", pl))
## [1] "lower bound = -1.1"
pu <-(55+1/2-50)/5
print(paste0("upper bound = ", pu))
## [1] "upper bound = 1.1"
p <- pnorm(1.1) - pnorm(-1.1)
print(paste0("Estimate =: ", p))
## [1] "Estimate =: 0.728667878107235"
pu <- (63+1/2-50)/5
print(paste0("upper bound = ", pu))
## [1] "upper bound = 2.7"
p <- 1- pnorm(2.7)
print(paste0("Estimate =: ", p))
## [1] "Estimate =: 0.00346697380304062"
pu <- (57+1/2-50)/5
print(paste0("upper bound = ", pu))
## [1] "upper bound = 1.5"
p <- pnorm(1.5)
print(paste0("Estimate =: ", p))
## [1] "Estimate =: 0.933192798731142"