The experiment is to select a random sample of size \(n\) from the Bernoulli distribution with parameter \(p\), and then to construct an approximate confidence interval for \(p\) at a specified confidence level. The true value of \(p\) can be varied with a scroll bar. The probability density function of the Bernoulli distribution and the value of \(p\) are shown in blue in the first graph.
The confidence level can be varied with a scroll bar. The type of interval--two sided, upper bound, or lower bound can be selected with a list box. The interval is constructed using quantiles from the standard normal distribution. The standard normal probability density function and the critical values are shown in blue in the second graph.
Random variables \(L\) and \(R\) denote the left and right endpoints of the confidence interval and \(I\) indicates the event that the confidence interval contains \(p\). The probability density function of \(I\) is shown in blue in the third graph.
On each run, the sample density function and the confidence interval are shown in red in the first graph, and the computed standard score is shown in red in the second graph. Note that the confidence interval contains \(p\) in the first graph if and only if the standard score falls between the critical values in the second graph. The third graph shows the proportion of successes and failures in red. The record table gives the values of the sample proportion \( M \), the confidence bounds \(L\) and \(R\), the standard score \(Z\), and \(I\) on each run. Finally, the distribution table gives the theoretical and empirical probability density function of \(I\).