# Finding the probability of a type II error for a binomial distribution

For a binomial distribution, the hypothesis $$H_0: p = 0.2$$ and $$H_1: p\ne0.2$$ are tested at the $$10%$$ level. $$20$$ trials are performed and the critical region is $$X = 0$$ or $$X > 7$$. Calculate the probability of a type II error and the power when the true value of $$p$$ is $$0.3$$:

My workings: $$X - B(20, 0.3)$$

The probability of a type II error is the probability of getting a result outside of the critical region when $$p = 0.3$$.

Hence $$P(\text{Type II error}) = P(1 \le X \le 7)$$

Hence $$P = 0.771$$

The textbook says $$P = 0.772$$, which is the $$P X \ge 7$$

The book did indeed provided the value of $$P(X \le 7)$$ and it seems that they forget to subtract $$P(X=0)$$.
> pbinom(7,20, 0.3)