%This MATLAB scriptfile plots the power as a function of delta
%and n in  exercise 17 i Eriksen og Lauritzen (2004).

d = -6:.1:6;
n = 50;
beta = 1 - normcdf(1.96-sqrt(n)*d/7.5) + normcdf(-1.96-sqrt(n)*d/7.5);
plot(d,beta)

n = 0:10:700;
d = 1;
beta = 1 - normcdf(1.96-sqrt(n)*d/7.5) + normcdf(-1.96-sqrt(n)*d/7.5);
plot(n,beta)
