If you're seeing this message, it means we're having trouble loading external resources on our website.

If you're behind a web filter, please make sure that the domains *.kastatic.org and *.kasandbox.org are unblocked.

# Determining sample size based on confidence and margin of error

Determining sample size based on confidence level and margin of error.

## Want to join the conversation?

• Can someone help me walk through how Sal determined that 0.5 will maximize p(1-p)?
• So basically, think of it this way. p(1 - p) = p - p^2. If you graph this, you will have roots at 0 and 1. This means the vertex is at x = 0.5. Since the graph is opening downwards with an a value that is less than one, the vertex will be a maximum point. Plug in 0.5, and you get 0.5-0.5^2 = 0.25. You will never get a value that is larger than that.
• Why we need to maximize this term "p_hat(1 - p_hat)"?
• You need to maximize this term so that you basically handle the worst case scenario when the margin of error is largest. After you maximize the margin of error, you can now find n accordingly so that you're 100% sure that the margin of error won't exceed 2.
• When we maximize the term, p_hat(1-p_hat), is that value, 0.5, always the same?
• `0.5` is always the maximum of `p_hat(1-p_hat)`.
• Did not quite understand how you found p hat to be 0.5?
• You can multiply:
``p̂ * (1 - p̂)``
and get
``p̂ - p̂²``
After that, find the derivative and get `1 - 2 phat`. If you find extremе point(s) by solving
``1 - 2p̂ = 0``
you will get `p̂ = 0.5`. This is maximum point. Hope this helps.
• Don't z-scores tell you have many standard deviations from the mean you are? Why is the z-score 1.96 and not 2 for 95% confidence?
• Yes z is the number of standard deviations from the mean. In a normal distribution, approximately 95% of the data is within 2 standard deviations from the mean.

So for 95% confidence, 2 is an approximation of the z-score. However, 1.96 is a more precise approximation of this z-score.
• Doesn't the empirical rule say that 95% is two standard deviations? That means that the z* critical value is two, not 1.96. Am I right?
• No, 2 is the number of standard deviations. When finding the Z* values they use a formula involving infinity and the number becomes 1.96.
• How do we interpret the 2% margin of error here? Does it mean that if Della's survey yields, let's say, that 30% of the sample supports the tax increase, then we can say that we are 95% sure that between 28% and 32% of the entire population support the tax increase?
• Is there a formula to find the minimum sample size?
• You can obtain a formula by solving for `n` without plugging in numbers.
• You are interested in estimating the the mean weight of the local adult population of female white-tailed deer (doe). From past data, you estimate that the standard deviation of all adult female white-tailed deer in this region to be 25 pounds. What sample size would you need to in order to estimate the mean weight of all female white-tailed deer, with a 96% confidence level, to within 9 pounds of the actual weight?
• A 96% confidence level means probability [(100-96)/2] * 100% = 2% in each of the two tails.

From the normal table, the z-score associated with a right tail of 2% (cumulative probability 98%) is 2.05. By symmetry, the z-score associated with a left tail of 2% is -2.05.

So the margin of error (the distance from either endpoint of the confidence interval to the center) is 2.05 times the standard deviation of the sample mean.

The standard deviation of the sample mean is 25/sqrt(n) pounds.

Since the margin of error needs to be 9 pounds, we have

2.05*25/sqrt(n) = 9
1/sqrt(n) = 9/(2.05*25)
sqrt(n) = 2.05*25/9
n = (2.05*25/9)^2 = 32.43.

To make sure not to exceed the needed margin, we round up. So we need sample size at least n = 33.

Have a blessed, wonderful day!