problem-7.22

problem-7.22  The following will do the simulation:
> zs = c(); ts = c()
> for(i in 1:200) {
+ X = rnorm(10,0,2)
+ zs[i] = qnorm(.95)*2/sqrt(10); ts[i] = qt(.95,8)*sd(X)/sqrt(10)
+ }
> sum(ts > zs)
[1] 126
> sum(ts > zs)/200
[1] 0.63
    
The z one is usually smaller, but not as often as might have been guessed.