 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. 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 when 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 now, 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 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 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 a p to use. So we generally assume the worst case scenario that will 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 it's probably a political poll. The pollster doesn't want the margin of error to be more than 1 percent with 95 percent 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. And that's 95 percent confidence. n equals 1.96 squared times what's telling p is the worst case scenario is 0.5. 0.5 times 1 minus 0.5. And the precision that we want it is 0.01, 1 percent. We want to be within 1 percent with 95 percent 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 percent of the, of the true, and there's only one true population proportion, the true p. Now, those of you who know anything about polling, you'll see most pollsters work with sample sizes of 1,000. Why? Well, it's the problem that we had before, but let's make the precision 3 percent, that we don't mind having a margin of error of 3 percent. 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 pollsters work with, because you know the margin of error ends up being around 3 percent, maybe less sometimes, but you know, roughly 3 percent. 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. You know why?