H

a) The value of the power function at the points

p=0,0.1,0.2,...,0.9,1; and sketch the power function.

b) The size of the test. !b2 Solution: Recall that the power is just the probability of rejecting the null as a function of the parameter. Let's call it w(p). Hence, > w := p -> 1-sum(binomial(20,k)*p^k*(1-p)^(20-k),k=0..6)+ > sum(binomial(20,k)*p^k*(1-p)^(20-k),k=0..1); / 6 \ |----- | | \ k (20 - k)| w := p -> 1 - | ) binomial(20, k) p (1 - p) | | / | |----- | \k = 0 / / 1 \ |----- | | \ k (20 - k)| + | ) binomial(20, k) p (1 - p) | | / | |----- | \k = 0 / > seq(evalf(w(j/10),3),j=1..9); .394, .156, .400, .751, .942, .994, 1.000, 1.000, 1.000 > evalf(w(0.01),3); .983 > evalf(w(0.001),3); 1.00 > jpeg(plot(w(p),p=.001..0.999),`j.gif`); # as you can see the picture also solves the other question. The size is just w(0.2) = .156. >