This Demonstration calculates the sample size (an integer) that produces a sample mean within the given margin of error. For a confidence level of , is the quantile of a standard normal distribution.
The minimum sample size formula can be found in most elementary statistics texts. The formula appears in M. Sullivan, Fundamentals of Statistics, 2nd ed., Upper Saddle Creek, NJ: Pearson Education, Inc., 2008 p. 414.