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 scrollbar. The probability density function of the Bernoulli distribution and the value of \(p\) are shown in the first graph. Three different estimations methods can be used:
The standard normal distribution is shown in the second graph. The confidence level can be varied with a scrollbar and the adjacent label shows the corresponding critical values of the standard normal distribution. The type of interval—two sided, upper bound, or lower bound can be selected with a list box. 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\).
On each run, the sample density function and the confidence interval are shown in the first graph, and the computed value of \(Z\) in the second graph. Note that the confidence interval contains \(p\) in the first graph if and only if \(Z\) falls between the critical values in the second graph.