Index: The Book of Statistical Proofs ▷ Statistical Models ▷ Count data ▷ Binomial observations ▷ Exact confidence interval

Theorem: Let $Y$ be the number of successes in $n \geq 1$ independent trials with common success probability $p$, so that $Y$ has a binomial distribution with parameters $n$ and $p$. Write $a = \alpha/2$ for $0 < \alpha < 1$ and let $Q_q(r,s)$ denote the $q$-quantile of the beta distribution with parameters $r$ and $s$. For $Y = y$, the equal-tailed Clopper–Pearson confidence interval is $[L(y), \, U(y)]$ where

\[\label{eq:bin-ci-limits} \begin{split} L(y) &= \begin{cases} 0, & y=0, \\ Q_a(y,n-y+1), & 1\leq y\leq n \; , \end{cases} \\ U(y) &= \begin{cases} Q_{1-a}(y+1,n-y), & 0\leq y<n, \\ 1, & y=n \; . \end{cases} \end{split}\]

Its coverage satisfies $\mathrm{Pr}\left( L(Y) \leq p \leq U(Y) \right) \geq 1-\alpha$ for every $p \in [0,1]$.

Proof: For $1\leq k\leq n$, let $T_k(p) = \mathrm{Pr}(Y \geq k)$. Differentiating the finite binomial sum gives

\[\label{eq:bin-ci-tail} \frac{\mathrm{d}}{\mathrm{d}p} \sum_{j=k}^{n} \binom{n}{j} \, p^j \, (1-p)^{n-j} = n \binom{n-1}{k-1} \, p^{k-1} \, (1-p)^{n-k} \; .\]

Indeed, the positive derivative term at index $j$ cancels the negative term at index $j-1$ for $j > k$. The right-hand side is equal to the beta density with parameters $k$ and $n-k+1$. Since $T_k(0) = 0$, $T_k(p)$ equals the corresponding beta distribution function at $p$. It increases strictly from zero to one.

For $y>0$, invert the upper-tail equation $T_y(L(y)) = a$. For $y < n$, invert the lower-tail equation $\mathrm{Pr}(Y \leq y) = 1 - T_{y+1}(U(y)) = a$. These inversions give the two beta quantiles in \eqref{eq:bin-ci-limits}. At $y = 0$, only the upper limit needs inversion, giving $U(0) = 1 - a^{1/n}$; at $y = n$, only the lower limit needs inversion, giving $L(n) = a^{1/n}$. For $0 < y < n$, $T_{y+1}(L(y)) \leq T_y(L(y)) = a < 1 - a = T_{y+1}(U(y))$, so the lower endpoint is below the upper endpoint.

To check coverage, fix $p$ such that $0<p<1$. If $L(y) > p$, then $\mathrm{Pr}(Y \geq y) < a$, and conversely. Since the tail decreases with $y$, these counts, if any, form an upper tail starting at some $k$. Their total probability is exactly $\mathrm{Pr}(Y \geq k) < a$. Likewise, the counts for which $U(y) < p$ form a lower tail of total probability at most $a$, since $\mathrm{Pr}(Y \leq y)$ increases with $y$. The probability of missing $p$ is therefore at most $2a = \alpha$. At $p = 0$ and $p = 1$, the counts equals $0$ and $n$, respectively, with probability one and the interval includes the true endpoint in each case.

∎
Sources:
  • Clopper, C. J. and Pearson, E. S. (1934): "The use of confidence or fiducial limits illustrated in the case of the binomial"; in: Biometrika, vol. 26, iss. 4, pp. 404–413; DOI: 10.1093/biomet/26.4.404.

Metadata: ID: P576 | shortcut: bin-ci | author: Ljx000888 | date: 2026-11-24, 23:26.