 Welcome to our lecture on determining sample size when making inferences. Here's an issue we haven't really talked about much up until this point. How do we know how large a sample to take? When we're making inferences about mu, we're using the sample mean x-bar as a point estimator of mu. The sample size is n, but how large should n be? One thing we know is that as n goes up, the size of the interval shrinks by a factor of the square root of n. So if we know beforehand what our precision is, which we've been calling margin of error, if we know beforehand before we start what we want the half-width of the confidence interval to be, or at least what it should be at a maximum, not more than, then we can pretty well figure everything else out. We know v because we know what confidence level we want. Sigma would have to be known for this exercise. So either it is known or we have some really, really good guesses based on previous studies. E is known. That's the precision or the margin of error or the half-width of the interval. We're calling it E. So the only thing left is to solve for n, and that's just algebra. An x-bar doesn't count because that's at the center, and it doesn't go into precision at all. X-bars in the center, we have a little bit on one side and a little bit on the other side. So here it is. We use E in order to solve for n. E is precision or margin of error, and it's equal to z times sigma divided by the square root of n. And then we turn everything around. We have the square root of n all by itself on the left side of the equation as equal to z times sigma divided by E. To solve for n, we need to square everything on both sides. So n turns out being equal to z squared times sigma squared divided by E squared, and now we can solve for n. So here's a simple problem. Suppose we know that sigma, remember that's the population standard deviation. We know that it's 20 based on previous studies. We want to estimate the population mean. That's called, you know, confidence interval. We're going to construct. We want to be within plus and minus 10 of its true value. Those who want the margin of error to be 10 on both sides. Okay? And we're going to use alpha rule 5. So 95 percent confidence interval. What sample size should we take? You see the formula, remember, z is 1.96, sigma is 20, right? The E, the precision, we said 10. That's what we're given. So we just do n equals 1.96 squared times 20 squared over 10 squared. It works out to be 15.4. This tells us that we need to sample size of at least 15.4. That's called 16. So we want n to be 16. And that'll give us the margin of error that we wanted of 10. And those E will be 10. So when we finally calculate x bar, that should give us a margin of error of 10. So this one, this problem is, again, sample size determination, but for P, a proportion. When working with a proportion, the formula is very similar. Notice it's z squared. But here we have P times 1 minus P over the precision that we want, e squared. Now, again, we don't have P to use. So we generally assume the worst-case scenario that'll blow it up as large as it can, which means P is 0.5. If P is 0.5, that'll give you the largest possible n to use. So that's what we're going to do. Well, and this problem may have a critical pole. The poster doesn't want the margin of error to be more than 1% with 95% confidence interval, right? So the variance using the highest possible P is 0.5. We pretend that P is 0.5. It may not be that, but that's, we take the worst-case scenario. All right? So now we take the z value of 1.96, remember that's 95% confidence, n equals 1.96 squared times, which, depending P is the worst-case scenario, is 0.5. 0.5 times 1 minus 0.5. And the precision that we wanted is 0.01, 1%. We want to be within 1% with 95% confidence. So 0.01 squared, that's the denominator. You do the arithmetic. That means you need a sample size of 9,604. That may be a large sample, but that will give you, that's in the worst-case scenario. So that'll give you the precision that you want, that you'll be within 1% of the, of the true, there's only one true population proportion, the true P. Now those are, you know, anything about polling. You'll see most posters work with sample sizes of 1,000. Well, that's the problem that we had before, but let's make the precision 3%, that we don't mind having a margin of error of 3%. All right, so now I'll do the same problem. n equals 1.96 squared times 0.5 times 1 minus 0.5 over 0.03 squared. Now we get an n of 1,067. And indeed, that's the sample size that most posters work with, because we know the margin of error ends up being around 3%, maybe less sometimes, but you know, roughly 3%. And that's why most polls, most marketing research studies, you'll find you need a sample of 1,000. And it's surprising that the United States with 310 million people need a good sample size of most things for 1,000. That's all you need. So the next time you read an article in the paper about a political poll, and it says something like about 1,000 people were surveyed for this poll, but you're my wife.