(Pg 338 Q2) Let \(S_{200}\) be the number of heads that turn up in 200 tosses of a fair coin. Estimate

n = 200
p = 0.5
q = 1-p

phi <- function(x){
  answer <- (1/sqrt(2*pi)) * exp((-x^2)/2)
  return (answer)
}
# P($S_200$ = 100) 
x_100 <- (100 - n*p)/sqrt(n*p*q)
P_100 = 1/sqrt(n*p*q)  * phi((x_100) / sqrt(n*p*q))
print(P_100) # 0.05641896
## [1] 0.05641896
# P($S_200$ = 90)
x_90 <- (90 - n*p)/sqrt(n*p*q)
P_90 = 1/sqrt(n*p*q)  * phi((x_90) / sqrt(n*p*q))
print(P_90) # 0.05530179
## [1] 0.05530179
# P($S_200$ = 80)
x_80 <- (80 - n*p)/sqrt(n*p*q)
P_80 = 1/sqrt(n*p*q)  * phi((x_80) / sqrt(n*p*q))
print(P_80) # 0.05208126
## [1] 0.05208126