SAMPLE SIZE FOR ESTIMATING
mIn the example for finding a confidence interval for a population mean using a z-score, we considered the following problem.
A large hospital wants to estimate the average length of time previous patients who have had surgery have remained in the hospital. The standard deviation of the lengths of stay of all previous surgery patients is known to be 7.4 days. A random sample of 50 surgery patients’ records is obtained, and the mean length of time these patients stayed in the hospital was 6.2 days.

How large a sample would be required to estimate the desired mean to within 1 day using 95% confidence?
SOLUTION
To find the desired sample size, the following formula is employed:
Substituting the appropriate quantities yields
At least 211 patients should be sampled.
COMMENTS ABOUT THE SOLUTION
Notice that to reduce the margin of error by a little more than one-half (from 2.05 to1) requires a sample size that is a bit more than four times as large (50 compared to 211).
Since it is impossible to sample fractions of individuals, the solution to finding a sample size must always be an integer. Also, to be sure to be within the desired maximum error, the value of n calculated by the formula should be rounded up to the next largest integer.