# Sample size calculation for a normal distributed population with known standard deviation, to have a chance of type 2 error of at most 5%

How do you do exactly a sample size calculation for a normal distributed population with known standard deviation, to have a chance of type 2 error of at most 5%. .

Zero hypothesis is:

$$\mu_0 = 20, \sigma = 1$$

Actual mean of the population is known by the researcher:

$$\mu = 19.5$$

With the same standard deviation.

Type II error is not-rejecting a false zero hypothesis.

If the chance of a type II error is at most 5%, what is the minimal sample size you have to have for a alpha of 5%?

I would say it is the calculation of:

$$P(a

Where

$$Z = \frac{\bar x - \mu}{\sigma/\sqrt(n)}$$

I don't know how to progress. Could someone show how it goes?

• $Z$ has a Normal distribution. You have to work out values for $a$ and $b$ based on the test size, and then you can easily find a formula for the power in terms of $n.$ Find the values of $n$ that attain that power (or greater). Where are you stuck in this workflow?
– whuber
Commented Jun 7, 2022 at 17:48
• I don't know the test size, I have to find the sample size. I am stuck Commented Jun 7, 2022 at 19:04
• You told us the test size in your question: it's $\alpha=5\%.$
– whuber
Commented Jun 7, 2022 at 19:30
• Ah I didn't know that was called the test size I thought you referred to number of samples $n$. Commented Jun 7, 2022 at 20:04
• A web search on hypothesis test size would have sorted that out for you; e.g. see en.wikipedia.org/wiki/Size_(statistics) (that definition at the start is slightly inaccurate but works fine for your case); more generally it's given correctly toward the end of this question stats.stackexchange.com/questions/183800/… ... Commented Jun 8, 2022 at 2:12