Sample size for a given margin of error for a mean | AP Statistics | Khan Academy
Nadia wants to create a confidence interval to estimate the mean driving range for her company's new electric vehicle. She wants the margin of error to be no more than 10 kilometers at a 90 percent level of confidence. A pilot study suggests that the driving ranges for this type of vehicle have a standard deviation of 15 kilometers.
Which of these is the smallest approximate sample size required to obtain the desired margin of error? So pause this video and see if you can think about this on your own.
The traditional way that we would construct a margin of error on a confidence interval, we take a sample and from that sample we construct the mean and then we add or subtract a margin of error around that to construct the confidence interval. The way that we've done that, since we're dealing with means, is we say, "All right, if we don't know the standard deviation of the population, it's appropriate to use the t statistic."
So our critical value we denote as t star, and you'd multiply that times the sample standard deviation divided by the square root of your sample size. Now this question is all about what is an appropriate sample size given that we want to have a 90 level of confidence.
What's tricky here is when you're using a t-table right over here, not only do you need to know the 90 level of confidence, you also need to know the degrees of freedom, and the degrees of freedom is going to be n minus 1. But we don't know what that's going to be without knowing n. So how would we determine an n? Similarly, you don't know what your sample standard deviation is going to be until you actually take some samples.
Instead of that, what we could think about is we know that another legitimate way to construct a confidence interval and the margin of error is to say, "All right, I can take my sample mean and I can add or subtract a z-score, a critical value, and this time use the z table."
If I multiply that times the true population standard deviation and divide that by the square root of n. Now you might say, "Well, I don't know the true population standard deviation," but they tell us a pilot study suggests that the driving ranges for this type of vehicle have a standard deviation of 15 kilometers.
So we could use this as an estimate of our true population standard deviation. This is 15 kilometers right over here. The good thing about a z table is you don't have to think about degrees of freedom; you could just look up your confidence interval.
We could just say that look, z star times 15 kilometers over our square root of n. This right over here is our margin of error, and this right over here is our margin of error that has to be no more than 10 kilometers. So that has to be less than or equal to 10.
We can figure out what z star needs to be for a 90 percent confidence level, and so then we just solve for n. Let's do that now. To figure out z star, I could use a z table, but just for diversity of methodology, let's use a calculator here.
To figure out the z value that would give us a 90 confidence interval, I can use a function called inverse norm, and you can see that right over here; that's choice 3. Let me just select that, and what it'll do is it will give you the area that you want under a normal curve. You can even specify the mean and the standard deviation, although you want the mean to be 0 and the standard deviation to be 1 if you really want to figure out a z-score here.
So it'll do is it will give you the z-score that will give you that corresponding area. I want, and actually, it's already selected that I want the center area to be 90. So I could say, "Point," right over here. If I use the left tail, then that means if I have 90 percent of the center, that means I would have five percent of either tail.
So instead of doing it .9 in center, I could have done .05 and used the left tail, or used .05 and used the right tail, but this is exactly what I want. So let me just go and paste this, and so this should give me the appropriate z value.
So there you go. If I want this middle ninety percent, the center ninety percent, I have to go one point, roughly one point six four five standard deviations below the mean and that same amount above the mean. So it's roughly our critical value here is approximately 1.645.
Let's just say 1.645. So we have 1.645 times 15 over the square root of n is going to be less than or equal to 10. Now, there are a couple of ways that you could do this. We could do a little bit of algebra to simplify this inequality; I encourage you to do so, or you could even try out some values here and see which of these n's would make this true.
We want the smallest possible one. I'll do it the algebraic way because if you're actually doing this in the real world, Nadia would not have a multiple choice right over here; she'd have to figure out the sample size in order to conduct her study. So let's do that.
Let's see if I divide both sides by 1.645 and 15, what do I get? I get 1 over the square root of n is less than or equal to 10 over 1.645 over 15. If I take the reciprocal of both sides, I get the square root of n is greater than or equal to, from taking the reciprocal of both sides, and so this is going to be 1.645 times 15, all of that over 10.
See, 15 over 10 is just 1.5. So let me just write that as 1.5 right over here. Then, if I square both sides, I would get that n needs to be greater than or equal to 1.645 times 1.5, and then all of that squared. I just squared both sides, all of that squared.
So let's get our calculator back. We are going to have 1.645 times 1.5, and then we want to square it, and we get approximately 6.09. So n has to be greater than or equal to 6.09. Of course, our sample size needs to actually be a whole number.
So what's the smallest whole number that is larger than 6.09? Well, that's going to be 7. So that would be this choice right over here. This is the smallest approximate sample size required to obtain the desired margin of error.
Of course, we won't really know until we actually conduct the study. We obviously, here, used an estimate of the population standard deviation, and we used a z table. It will be interesting when Nadia actually conducts the study to see if her margin of error is indeed no more than 10 kilometers with a 90 level of confidence.