In terms of the numbers you selected above, the sample size n and margin of error
E are given by
x
=
Z(c/100)2r(100-r)
n
=
N x/((N-1)E2 + x)
E
=
Sqrt[(N - n)x/n(N-1)]
where N is the population size, r is the fraction of
responses that you are interested in, and Z(c/100) is
the critical
value for the confidence level c.
If you'd like to see how we perform the calculation, view the page
source. This calculation is based on the Normal
distribution, and assumes you have more than about 30 samples.