To compute the exact binomial probabilities in this problem, you could use (i) the binomial PDF formula, (ii) a statistical calculator
programmed with the binomial PDF and CDF, or (iii) statistical software on a computer.
I will illustrate the use of R statistical software, and indicate
how to use the binomial PDF.
Type I error. Suppose $X \sim \mathsf{Binom}(n=20, p=.9).$
Then $\alpha = P(X < 15) = P(X \le 14) = 0.0113.$
In R statistical software pbinom
is a binomial CDF.
pbinom(14, 20, .9)
[1] 0.01125313
The same result can be obtained by adding terms of the binomial PDF
function dbinom
; the notation 0:14
is shorthand for a list of
the numbers $k = 0, \dots, 14.$ These are the numbers in the 'Rejection region' of your test.
sum(dbinom(0:14, 20, .9))
[1] 0.01125313
By either computation, this differs slightly from the answer given in your Question, and the first computation in R
agrees with @Mau314's Comment.
Using the binomial PDF would require summing terms
$P(X = k) = {20 \choose k}(.9)^k(.1)^{n-k},$
for $k = 15, \dots, 20,$ and subtracting the sum from $1.$
Type II error. Suppose $X \sim \mathsf{Binom}(n=20, p=.6).$
Then $\beta(p=.6) = P(X \ge 15) = 1 - P(X \le 14) = 0.1256.$
1 - pbinom(14, 20, .6)
[1] 0.125599
Using the binomial PDF would require summing terms
$P(X = k) = {20 \choose k}(.6)^k(.4)^{n-k},$
for $k = 15, \dots, 20.$
The 'power' of the test against the specific alternative
$p = .6$ is $\pi(p=.6) = 1 - \beta(p=.6) = 1 - 0.1256
= 0.8744.$
The figure below shows the PDFs of the two binomial
distributions used above. The Rejection region is to the
left of the vertical broken line and the Acceptance region
is to the right.
Best Answer
Note that the critical region is $W=\{{x: |x| \geq c}\}$.
So the power function of the test is $$\begin{align}\beta(\theta) &=P[|X| \geq c|\theta] \\ &=1-\frac{c}{\theta}\end{align}$$
So Probability of Type I Error $=P[X\in W|\theta=3]=1-\frac{c}{3}$
So Probability of Type II Error $=P[X\in W'|\theta=4]=1-P[X\in W|\theta=4]=\frac{c}{4}$