# A question about survey sample size

I am looking at the formula on this page, it says the formula for estimating the sample size of a survey is:

$$Sample\;size = \frac{\frac{z^2 \;\times \;p(1-p)}{e^2}}{1 + (\frac{z^2 \; \times \; p(1-p)}{e^2N})}$$

where
- $e$ is the margin of error
- $N$ is the population size.

I have the following questions:

1. What does $p$ represents?
2. Why is the variance of a Bernoulli distribution (i.e. $p(1-p)$) used here?
3. Let's say

How would you interpret the result? I am 95% confident that by surveying 965 people, it will be enough to present the entire population? (what about the margin of error?)

1. $p$ represents the proportion in the population that has the characteristic you're studying. The calculator probably assumes $p=0.5$ since this gives the most conservative (largest) sample size.
2. The variance of a Bernoulli random variable is used because each unit in the population is either has the characteristic you're studying or doesn't. If you're not just calculating proportions - for example if you're trying to estimate average height, then you replace the $p(1-p)$ with an estimate of the variance of the characteristic you're collecting (e.g. do some initial research to estimate the variance of heights in your population).