Applying the general formula for a confidence interval, the confidence interval for a proportion, π, is:

p ± z σ

where p is the proportion in the sample, z depends on the level of confidence desired, and σ

where π is the proportion in the population and N is the sample size. Since π is not known, p is used to estimate it. Therefore the estimated value of σ

As an example, consider a researcher wishing to estimate the proportion of X-ray machines that malfunction and produce excess radiation. A random sample of 40 machines is taken and 12 of the machines malfunction. The problem is to compute the 95% confidence interval on π, the proportion that malfunction in the population.