I want the expectation of $T(T-1)$ where $T$ is the sample mean of i.i.d. Bernoulli random variables with parameter $p$.
Using the linearity property, we have $$\mathbb E\{T(T - 1)\} = \mathbb E(T^2) - \mathbb E(T).$$
Since $\mathbb E(T) = p$ and $\mathbb E(T^2) = \tfrac{p(1-p)}{n} + p^2$, I believe the answer should be $\tfrac{p^2(n-1)}{n} - \tfrac{p(n-1)}{n}$ but in my notes it says that the expectation is $n(n-1)p^2$.
Are my notes incorrect or did I make an error?
Thanks.
Your answer is correct if $T$ is the sample mean; i.e., $$T = \frac{1}{n} \sum_{i=1}^n X_i, \quad X_i \sim \operatorname{Bernoulli}(p).$$ The expression $n(n-1)p^2$ is correct if $T$ is the sample total; i.e., $$T = \sum_{i=1}^n X_i.$$