Finding the probability of a Type II error or the power, as specified 
For the given significance test, determine the probability of a Type
  II error or the power, as specified.
Suppose we wish to test $H_{0}: p = 0.5$ against $H_{1}: p < 0.4$ using $α = 0.05$.
  If $p$ is actually equal to $0.4$, what is the probability of a type II
  error assuming $n = 150$?

How do i find the probability of a Type II error? 
I've only managed to find the z-score to be -2.45, and its corresponding p-value to be 0.0071. Thanks. 
 A: In order to calculate the power of an alternative hypothesis, one should first formulate it as a simple hypothesis: For example, $H_1:p<40$ is a complex hypothesis as it refers to multiple possible values of $p$. A simple hypothesis would be something like $H_1:p=39.9$.
The process of calculating the power (for simple hypotheses) is as follows:


*

*Identifying the discussed probability (preferably normal or approximated to normal)

*Building the Likelihood Ratio Test

*Extracting the test statistic $T(x)$ from the LRT

*Formulating the test shape, something like $\delta(x):T(x)>c$ or $\delta(x):T(x)<c$

*Solving the equation $P_{H_0}(\delta(x))=\alpha$ in order to find the critical value $c_\alpha$, which will make the equation $P_{H_0}(T(x)\leq c_\alpha)=1-\alpha$ hold (this is just an example for the case of $\delta(x):T(x)>c$). 

*Finding the power by solving the equation $\pi=1-\beta=P_{H_1}(T(x)>c_\alpha)$


Please note that $P_{H_0}$ refers to the distribution under the null assumption whereas $P_{H_1}$ refers to the distribution under the specified alternative.
