Wolfram Alpha:

```Sample Size Determination
-------------------------

The error arising due to drawing inferences about the population
on the basis of sampling is termed as sampling error. The margin
of error is the maximum error expected in stating, at a level of
confidence, an interval within which the population parameter is
supposed to lie.

Margin of Error, MOE = Zα/2σ/√n
_             _
Confidence interval:  x - MOE < μ < x + MOE
_             _
Take x - MOE = μ ∴ x - μ = MOE

Or, for a proportion:

MOE = Zα/2√(pq/n)

Rearranging,
_
n = (Zα/2σ/x - μ)2

= (Zα/2σ/MOE)2

Or, for a proportion:

n = (Zα/2/MOE)2pq  using σ = √(pq/n)

In the case where p is unknown, a value of 0.5 is used to provide
a conservative estimate of the sample size.  The approximated MOE
formula is then:

MOE = ±1.96√(0.5(1 - 0.5)/n)

= ±1.96√(0.25/n)

= ±1.96*0.5√(1/n)

~ ±1/√n

Ex.

In a random survey of 1,000 Floridians, 43% of the respondents liked
Ford pickups over Chevy pickups and 52% liked Chevy pickups over
Ford pickups.  5% had no preference.

First, set n = 1,000 and p = 0.43. Then

±1.96√((0.43*0.52)/1000) = ±0.0293

This means that if you perform the same survey 100 more times, then
95% of the time the number of people who liked Ford more than Chevy
should be between 40.1% and 45.9%.

```