Rao-Blackwell Theorem - Best estimator (Statistics) Let $X_1 , ... , X_n$ be a series of independent random variables following a Bernoulli distribution with parameter $\theta$. And let $S_n = \sum_1^n X_i$.
We know an unbiased estimator of the variance for the Bernoulli distribution:
$$1/2 * (X_1 - X_2)^2$$
Using the Rao-Blackwell Theorem find the best estimator: (Improved from Rao BlackWell)
$$Z = E_\theta(1/2*(X_1 - X_2)^2 | S_n)$$
Sorry for the poor translation of the problem, the original text is in french. Does anyone have any idea of how to do that? So far neither my book or internet haven't been really helpful...
  Thanks in advance
 A: It suffices to find an unbiased estimator that is a function of a complete, sufficient statistic. (This is the Lehmann-Scheffe theorem). The Rao-Blackwell theorem can often be used to guess such estimators. You take some known estimator and condition it on sufficient statistic to give you a "better" estimator that is also a function of the sufficient statistic. Many times, but not always, the new estimator is the UMVUE ("best estimator"). I believe this is the case here, though I have not checked the details. To complete the proof, it suffices to check that the new estimator is unbiased (so that Lehmann-Scheffe applies).
A: Using Rao-Blackwell:
$Z = 1/2 * (E_\theta((X_1 - X_2)^2 | S_n))$
$Z = 1/2 * (E(X_1^2 | S_n) + E(X_2^2 | S_n)  -  2 * E(X_1 * X_2 | S_n))$
Considering that $X_1 {\buildrel d \over =} X_i$ we can then write:
$Z = 1/2 * (E(X_i^2 | S_n) + E(X_j^2 | S_n)  -  2 * E(X_i * X_j | S_n))$
Then we calculate 
$E(X_i^2 | S_n) = (E(X_j^2 | S_n) = Sn/n$
And
$E(X_i*X_j |Sn) = \sum_{i=1}^n\sum_{j=1,i\neq j}^n X_i * X_j  = \frac{S_n}{n} * \frac{S_n - 1}{n - 1}$
