Observing an event eight times in ten trials gives a sample proportion of 0.8, but that single fraction does not express sampling uncertainty. A Wilson score interval builds a range by asking which candidate event probabilities satisfy a specified score inequality. Its center generally differs from the observed proportion, and its finite-sample coverage need not equal the normal-reference percentage used to choose the cutoff. The following calculation is a hypothetical binary-trial exercise for robotics modeling, with no real acceptance decision attached.
Declare a binomial sampling experiment
Fix n=10 before observing outcomes. Each trial records either the event or its absence. Assume independent trials with the same unknown event probability p, so the count K has a binomial distribution. The observed count is k=8 and p_hat=k/n=0.8. No trial is discarded, no extra trial is added after seeing the result, and no group correlation is built into this model. These assumptions define the experiment to which the interval calculation applies.
Choose z=2 as an explicit score cutoff. Its central standard-normal reference probability is approximately 95.44997 percent. For a two-sided 95 percent interval, the normal cutoff is about 1.96 instead. Specifying 2 keeps the arithmetic transparent and avoids quietly labeling one cutoff as another. All endpoint and coverage calculations below use this same declared value.
Invert the candidate-probability inequality
For a candidate probability p strictly between 0 and 1, require |p_hat-p|/sqrt[p(1-p)/n]≤z. Squaring and rearranging gives n(p_hat-p)²≤z²p(1-p). Expanding produces (n+z²)p²-(2n p_hat+z²)p+n p_hat²≤0. The allowed candidates lie between the two roots of this upward-opening quadratic. Boundary values 0 and 1 are handled through the equivalent polynomial inequality, rather than by dividing by their zero standard errors.
The resulting endpoints are C±H, where C=(p_hat+z²/(2n))/(1+z²/n) and H=z sqrt[p_hat(1-p_hat)/n+z²/(4n²)]/(1+z²/n). NIST presents this score-test inversion and endpoint expression. Statsmodels identifies Wilson as an explicit interval method and describes its coverage as approximate. The particular counts, cutoff, and repeated-sampling enumeration in this article are original worked examples.
Evaluate the eight-event observation
With n=10,k=8,z=2, the denominator is 1.4. The center is (0.8+0.2)/1.4=5/7, approximately 0.714286. The square-root term is sqrt(0.016+0.01)=sqrt(0.026). The half-width is approximately 0.230350, producing endpoints approximately 0.483935 and 0.944636. The interval is symmetric around 5/7, not around 0.8. Its asymmetry relative to the observed fraction follows from the candidate p inside the score variance.
As a direct check, the quadratic is 14p²-20p+6.4≤0. Substituting either endpoint makes the expression zero within rounding. The candidate p=0.8 satisfies the inequality, while p=0.95 does not. This test can be performed independently of an interval library, and catches an accidental switch to the familiar plug-in variance p_hat(1-p_hat)/n.
Examine the boundary observations
For k=0 with the same n and z, the polynomial becomes 14p²-4p≤0. Its roots are 0 and 2/7, so the interval is [0,2/7]. Seeing zero events does not collapse this score interval to a single probability. A plug-in Wald expression p_hat±z sqrt[p_hat(1-p_hat)/n] would instead give [0,0] for that observation. This difference is algebraic, not a finding about any actual zero-defect manufacturing lot.
For k=10 the reflected Wilson interval is [5/7,1]. The zero-count and all-count cases are mirror images under exchanging event and nonevent. Their endpoint distance from the boundary equals z²/(n+z²)=2/7. That identity applies to these two-sided score bounds with cutoff 2; it should not be relabeled as a one-sided 95 percent result.
Enumerate coverage instead of assuming it
Now imagine repeating the declared ten-trial experiment when the fixed true probability is p=0.1. The Wilson interval contains that probability precisely when |K/10-0.1|≤2sqrt(0.1×0.9/10). The right side is approximately 0.189737. Consequently the accepted integer counts are K=0,1,2. Count 3 already lies outside the inequality, because its sample fraction 0.3 differs from 0.1 by 0.2.
The coverage at this particular p is therefore P(K≤2)=0.9^10+10(0.1)(0.9^9)+45(0.1²)(0.9^8), approximately 0.929809. That 92.9809 percent differs from the 95.44997 percent normal reference. No simulation is needed: the sum enumerates all accepted outcomes exactly under the binomial model. The cutoff supplies a nominal reference, whereas discreteness and the approximation determine actual coverage at each underlying p.
Preserve the interpretation and experiment
Coverage describes the fraction of intervals that would contain a fixed p across repeated samples from the specified experiment. Once one sample has been observed, the frequentist interval is not a posterior probability distribution over p. Nor is it a range containing a stated fraction of individual binary outcomes. A probability parameter and the next event indicator are different objects.
Shared disturbances, changing trial conditions, adaptive stopping, or selectively retained observations would alter the sampling model behind the ten-trial calculation. The Wilson formula cannot by itself repair those changes. An auditable record should retain the event definition, planned n, observed k, cutoff, interval method, endpoints, and declared sampling assumptions. With those pieces visible, the interval remains a reproducible statement about a model rather than an unsupported promise about a robot or production process.
The expanded polynomial also provides a way to audit every possible result without separately implementing the endpoint formula. At the fixed candidate p=0.1, its left side can be written 10(K/10-0.1)²-4(0.1)(0.9). For K=2 this is 0.1-0.36=-0.26, so the candidate lies inside that sample's interval. For K=3 it is 0.4-0.36=0.04, putting the candidate outside. The sign change occurs between adjacent integer counts. A continuous normal reference cannot make that discrete acceptance boundary move smoothly across every desired coverage percentage. This original calculation explains the numerical coverage gap in the example, rather than merely attaching an approximate label to the method. It also distinguishes uncertainty in a fixed probability from uncertainty caused by an unknown or changing trial count.
Sources checked October 24, 2026:
https://www.itl.nist.gov/div898/handbook/prc/section2/prc241.htm
https://www.statsmodels.org/stable/generated/statsmodels.stats.proportion.proportion_confint.html
Concept illustration: A wired fixture on a metal worktable beside a waveform display provides robotics context for this analytical model. The image does not depict the article's numerical example, a verified experiment, a product specification, or deployment evidence.