Statistical hypothesis testing. A z-test to see if an engine shipment is bad Question: A car manufacturer agreed with its engine provider to supply them with type-A engines. But they suspect its engine provider is sending type-B  engines. The A-type engine is supposed to have on average 480 HP with a standard deviation of 10 HP and a normal distribution. While the B-type engines are supposed to have on average 420 HP with a standard deviation of 10 HP and a normal distribution.
Suppose they received a shipment with 50 engines with a mean of 440 HP. Considering a significance level of 0.05, are the engines type-B?
How do I find the null hypothesis, should it be the average between the means or should it be the if the mean of the A-type engines, I don't get it.
 A: I will get you started with this and let you finish it.
Your null hypothesis is that the engines are as specified $H_0 = 480$ and
your alternative hypothesis is that the engines are $H_a: < 480$ (perhaps as low as 420).
Because you know $\sigma = 10$ for the A-Type engines in $H_0,$ this is a z-test with test statistic. Then we would reject at the 5% level because 440
$$Z = \frac{\bar X - \mu_0}{\sigma/\sqrt{n}} = \frac{440- 480}{10/\sqrt{50.}} = \;??.$$
[You should look in your text or notes to see if you can find an explanation of z-tests, and a formula similar to this one. Maybe you can match up my explanation with theirs. Also, compute the value of this $Z$-statistic.]
Obviously, $\bar X = 440 < 480,$ so you are intitled to be suspicious that something is wrong. The issue is whether $\bar X = 440$ is enough smaller than $\mu_0 = 480$ to be 'statistically significant'. 
If $H_0$ is true then the statistic $Z$ has a standard normal distribution.
Testing at the 5% level means that you would 'Reject $H_0$' if the computed value $Z < -1.645,$ where the 'critical value' $-1.645$ is chosen to cut 5% from
the lower tail of the standard normal distribution (which you should verify).
In the figure below: The left-hand panel shows the null distribution of
the sample mean $\bar X,$ and the right-hand panel shows the standard normal
distribution. Vertical dotted lines show the 5% critical value in terms of
$\bar X$ and the z-score, respectively. [The z-score is used because there
are no printed tables of the distribution $\mathsf{Norm}(\mu = 480, \sigma
= 10/\sqrt{50}).$]

With R statistical software, it is possible to find the critical value $477.67,$ in terms of $\bar X.$  Then in terms of the sample mean, we would reject $H_0$ because $\bar X = 440$ is (much) smaller than $477.67.$
qnorm(.05, 480, 10/sqrt(50))
## 477.6738

