Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

We have n-fold p-coin toss

Y is the number of ordered pairs of tosses in which both result in 1.

I need the expected value of Y where Y is a sum of indicator variables, and a proof that $$ E[X(X-1)], \space X\space Bin-(n,p)-$$

$$ Y_i=\left\{ \begin{aligned} 1 && X_i = p\\ 0 && X_i = (1-p) \end{aligned} \right. $$ Any sum of Bernoulli random variables, $S_n=\sum\limits_{i=1}^nY_i$ is a binomial random variable with parameters $n$ and $p$. In other words, for every integer $k$ such that $0\le k\le n$, $$ \mathrm P(S_n=k)={n\choose k}p^k(1-p)^{n-k}. $$

But how can I show that the expectation value is $$E[X(X-1)]\space?$$

share|cite|improve this question
Can you find $g(t) = \sum_{k=0}^n \mathbb{P}(S_n = k) t^k$. Then $\mathbb{E}(X(X-1)) = g^{\prime\prime}(1)$ – Sasha Nov 23 '11 at 18:02
up vote 1 down vote accepted

As Sasha suggested, let $$\begin{align*} g(x)&=\sum_{k=0}^n \mathbb{P}(S_n=k)x^k\\ &=\sum_{k=0}^n\binom{n}k p^k(1-p)^{n-k}x^k\\ &=\sum_{k=0}^n\binom{n}k(px)^k(1-p)^{n-k}\\ &=(px+1-p)^n \end{align*}$$ by the binomial theorem. Then $$g\;'(x)=\sum_{k=0}^n k\mathbb{P}(S_n=k)x^{k-1}\;, $$

and $$g\;''(x)=\sum_{k=0}^n k(k-1)\mathbb{P}(S_n=k)x^{k-2}\;,$$

so $$g\;''(1)=\sum_{k=0}^n k(k-1)\mathbb{P}(S_n=k)=\mathbb{E}(X(X-1))$$ by definition. On the other hand, you know that $g(x)=p(px+1-p)^n$, so you can calculate $g\;''(1)$ explicitly with a little elementary calculus.

share|cite|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.