Rao-Blackwell estimator of a geometric failure probability (source code)

= Rao-Blackwell estimator of a geometric failure probability
{c}
{title2=$\widehat p=(T-n)/(T-1),\quad T=\sum_{j=1}^nX_j,\quad n\geq2$}

For <independent random variables>[independent] <geometric distribution>[geometric observations] with mass $p^{r-1}(1-p)$ on $r=1,2,\ldots$, where $0\leq p<1$, the total $T$ is sufficient. Conditional on $T=t$, positive-integer compositions are uniformly distributed. The indicator $1_{\{X_1>1\}}$ is unbiased for $p$, and conditioning it on $T$ gives $\binom{t-2}{n-1}/\binom{t-1}{n-1}=(t-n)/(t-1)$. For one observation, use $1_{\{T>1\}}$ instead, including its zero value at $T=1$.