We want to test if our population average is different from twenty.

We therefore specify the follow zero hypothesis.

\[H_0: \mu = 20\]

The alternative hypothesis is

\[H_a: \mu \neq 20\]

Accepting

mu <- 40
sd <- 8
n  <- 20
ci <- qnorm(0.975)*sd/sqrt(n)
(left <- mu - ci)
## [1] 36.49391
(right <- mu + ci)
## [1] 43.50609

Updated: