Confidence Interval for a Probability

This applet illustrates confidence intervals for a probability. Click on the One Sample button to (a) generate a random sample from a binomial distribution, (b) compute the estimate of the probability as number of successes (1's) divided by the number of trials, and (c) display the 95% confidence interval around the estimate. When the 95% confidence interval correctly includes the true probability, which is indicated by the vertical line and the axis at the top, the line representing the confidence interval is green. If the 95% confidence interval does not include the true probability, then the line is red. Click on the One Sample button until you get one or two confidence intervals that do not include the true probability. Up to 25 confidence intervals are displayed before it resets.

Once you understand the basic process, click on the 25 Samples button to generate 25 samples. To speed up the process even more, click on the 100 Samples button. The display is terse so be sure you understand the basic process before using the 100 Samples button. For both 25 Samples and 100 Samples, the proportion of intervals including the true value is displayed at the top of the applet.

You may drag the line representing the true probability to set it to other values. You may also use the menu for Sample Size to select other sample sizes and you may use the other menu to select different widths of confidence intervals. Note that ".95" corresponds to a 95% confidence interval, etc.