Main content

## Confidence intervals for means

Current time:0:00Total duration:7:42

# Sample size for a given margin of error for a mean

AP Stats: UNC‑4 (EU), UNC‑4.U (LO)

## Video transcript

- [Instructor] 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% 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. So the traditional way that we would construct a margin of
error at 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. And the way we've done that since we're dealing
with means is we say alright, 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 by 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 wanna have a 90% level of confidence. And 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 gonna be n minus one. But we don't know what that's
gonna 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. So instead of that, what
we could think about we know that another
legitimate way to construct a confidence interval
and the margin of error is to say, alright I
can take my sample mean and I can add or subtract a Z score a critical value at
this time using a z table, where 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. So this is 15 kilometers right over here. And then 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. And so then 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. 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. And we can figure out what
z star needs to be for a 90% confidence level and then
so we just solve for n. So let's do that. Now, do figure out z star
I could use the z table but just for a diversity of methodology let's use a calculator here. So 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 three. Let me just select that. And what it'll do is, you give it the area that
you want under normal curve. You can even specify the mean
and the standard deviation. Although you want the mean
to be zero and the standard deviation to be one if you
really want to figure out a z score here. And so it'll do is, it will
give you the z score that will give you that corresponding area. And so I want and actually it's already selected that I want the
center area to be 90%. So I could say .9 right over here. If I use the left tail then
that means if I have 90% of the center that means I
would have a 5% of either tail. So instead of doing it .9 in center I could've 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 90%, the center 90%, I have to go one point, roughly 1.645 standard deviations below the mean and that same
amount above the mean. So it's roughly our critical
value here is approximately 1.6, let's just say 1.645. So we have 1.645 times times 15 over the square root of n is going to be less than or equal to 10. And so now there's a couple of
ways that you could do this. We could do a little bit
of algebra to simplify this inequality and I
encourage you to do so or you could even try out some values here and see which of these
ends would make this true and 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. So let's see. If I divide both sides by 1.645 and 15 what do I get? I get one over the square root of n is less than or equal to 10 over 1.645 over, over 15. And if I take the reciprocal
of both sides I get the square root of n is
greater than or equal to, if I'm taking the
reciprocal of both sides, and so this is going to be 1.645, times 15 times 15. All of that over 10. 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. And then if I square both
sides I would get that n needs to be greater than or equal to 1.645 times... Times 1.5. And then all of that squared. I just squared both sides. All of that squared. And 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 6. Approximately 6.0, 6.09. So n has to be greater
than or equal to 6.09. And 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 seven. So that would be this
choice right over here. This is the smallest
approximate sample size required to obtain the
desired margin of error. And of course we won't
really really know until we actually conduct the study. We obviously here use an estimate of the population standard deviation. And we used a z table but
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.