Suppose we are given a set of n 100 data points from Xi Nm
     Suppose we are given a set of n = 100 data points from X_i, ~ N(mu,sigma^2). Let sigma^2 = 4.  Suppose the true value of mu = 5 anti we want to test the hypothesis  against the alternative hypothesis  We use the test statistic T = and reject  Recall that a Type II error is the probability of failing to reject H_0 when H_0 is false. What is the probability of a Type II error?  Graph the probability of a Type II error as a function of the true value of mu . Consider values of mu  [0,10]. For this part of the problem it is important to keep H_0 fixed; we are not changing the value of mu in H_0. 
  
  Solution
alpha=0.05
 mu0=4
 sem=0.2
 q = qnorm(alpha, mean=mu0, sd=sem, lower.tail=FALSE); q
 mu =c(0:10)
 for(i in 1:length(mu)){
 p[i]=pnorm(q, mean=mu[i], sd=sem)
 }
 plot(mu,p, type=\"l\")

