Sample size for a z confidence interval: Which way should I round?

Audentes

Junior Member
Joined
Jun 8, 2020
Messages
187
Hi all, I have a minor but complex question which relates to rounding when determining sample size for a z confidence interval.

Say p = 0.9 and (1-p) is 0.1, and the z score for a 95% confidence interval is 1.96.

We don't want the margin of error to exceed 2% each way (+/-)

z* times Standard Error is less than or equal to Margin of Error.......
So I set up the equation as

1.96 * ( √ ((0.9*0.1) / n) ) ≤ ± 0.02

Divide by both sides to remove 1.96.

( √ ((0.9*0.1) / n) ) ≤ 0.01020408163

Now square each side.

(0.9*0.1)/n ≤ 1.04123282 * 10 ^(-4)

0.09/n ≤ 1.04123282 * 10 ^(-4)

0.09/1.04123282 * 10 ^(-4) ≤ n

864.36 ≤ n
for a margin of error that is no more than ± 0.02, the sample size, n, must be no more than 864.36.

Now here is my question: do I round 864.36 to 865, or round it down to 864 as it is mathematically? Because clearly the sample size must be a whole number.
I have received conflicting information as to whether I should round up or down.

If I plug 864 into the original equation,
1.96 * ( √ ((0.9*0.1) / 864) ) ≤ 0.02

I get the following: 0.02000416623 ≤ 0.02.
That is a categorically untrue statement.

If I plug 865 into the equation,
1.96 * ( √ ((0.9*0.1) / 865) ) ≤ 0.02

I get the following: 0.01999259979 ≤ 0.02.
This statement is true.
Khan Academy, though, I believe, rounded down to 864 (producing an untrue inequality)
but my teacher has always rounded up (producing a true inequality)

which way? is it 864 or 865?

Thanks,
Audentes
 
864.36 ≤ n
for a margin of error that is no more than ± 0.02, the sample size, n, must be no more than 864.36.
You mean "no less than", or "at least", right?

Since 864 is less than 864.36, that's clearly not the number you need to use. The smallest integer that satisfies the inequality is 865.

And you've shown that 864 leads to a wrong margin of error.

So why are you not convinced that (assuming you've reported everything correctly), Khan is wrong and you and your teacher and the math are all right?
Now here is my question: do I round 864.36 to 865, or round it down to 864 as it is mathematically? Because clearly the sample size must be a whole number.
Perhaps your concern is that you learned too well the convention of rounding down for 864.36 in order to round to the nearest integer.

But this is not a case where you want to round to the nearest integer (which may well be what Khan did reflexively); it is a case for rounding always up, because that is what the math calls for.

In the same way, if you found that you needed 5.25 buses to hold a group of kids, I hope you would know to round up, even though 5 is closer.
 
Top