50

If $\mathrm P(X=k)=\binom nkp^k(1-p)^{n-k}$ for a binomial distribution, then from the definition of the expected value $$\mathrm E(X) = \sum^n_{k=0}k\mathrm P(X=k)=\sum^n_{k=0}k\binom nkp^k(1-p)^{n-k}$$ but the expected value of a Binomal distribution is $np$, so how is

$$\sum^n_{k=0}k\binom nkp^k(1-p)^{n-k}=np$$

  • 6
    Differentiating the binomial expansion for $(p+q)^n$ with respect to $p$ gives you the result very quickly. – wj32 Nov 01 '12 at 00:54

6 Answers6

70

The main idea is to factor out $np$. I believe we can rewrite:

$$\sum^n_{k=0}k\binom nkp^k(1-p)^{n-k}= \sum^n_{k=1} k\binom nkp^k(1-p)^{n-k}$$

Factoring out an $np$, this gives (and cancelling the $k$'s):

$$\sum^n_{k=1} k\binom nkp^k(1-p)^{n-k} = np \sum^n_{k=1} \dfrac{(n-1)!}{(n-k)!(k-1)!}p^{k-1}(1-p)^{n-k}$$

Notice that the RHS is:

$$np \sum^n_{k=1} \dfrac{(n-1)!}{(n-k)!(k-1)!}p^{k-1}(1-p)^{n-k} = np \sum^n_{k=1} \binom {n-1}{k-1}p^{k-1}(1-p)^{n-k},$$

and since $\displaystyle \sum^n_{k=1} \binom {n-1}{k-1}p^{k-1}(1-p)^{n-k} = (p + (1-p))^{n-1} = 1$, we therefore indeed have

$$\sum^n_{k=0}k\binom nkp^k(1-p)^{n-k} = np$$.

notes
  • 1,903
  • 4
    How do you know that $\displaystyle \sum^n_{k=1} \binom {n-1}{k-1}p^{k-1}(1-p)^{n-k} = (p + (1-p))^{n-1}$? Is there a resource one can study in order to understand equations like that, related to the binomial coefficient? – user56834 Jul 09 '17 at 14:04
  • 8
    That is an application of the binomial theorem: that $(x+y)^n = \sum_{k = 0}^n \binom{n}{k} x^k y^{n - k}$, where I have modified the summation index to range over $1, ..., n$ rather than $0, ..., n - 1$. Correspondingly, I have to subtract one from the summation index. – notes Jul 09 '17 at 18:49
  • As far as resources go, I remember learning things like this variously from "Art and Craft of Problem Solving", Art of Problem Solving's "Introduction to" and "Intermediate Counting and Probability". Depending on your goals, there may better sources for this stuff. For instance, the Wikipedia page on binomial coefficients is moderately comprehensive. – notes Jul 09 '17 at 18:54
  • 1
    This answer can't be upvoted enough – hargun3045 Apr 05 '20 at 07:23
45

Let $B_i=1$ if we have a success on the $i$-th trial, and $0$ otherwise. Then the number $X$ of successes is $B_1+B_2+\cdots +B_n$. But then by the linearity of expectation, we have $$E(X)=E(B_1+B_2+\cdots+B_n)=E(B_1)+E(B_2)+\cdots +E(B_n).$$ It is easy to verify that $E(B_i)=p$, so $E(X)=np$.

You wrote down another expression for the mean. So the above argument shows that the combinatorial identity of your problem is correct. You can think of it as a mean proof of a combinatorial identity.

Remark: A very similar argument to the one above can be used to compute the variance of the binomial.

The linearity of expectation holds even when the random variables are not independent. Suppose we take a sample of size $n$, without replacement, from a box that has $N$ objects, of which $G$ are good. The same argument shows that the expected number of good objects in the sample is $n\dfrac{G}{N}$. This is somewhat unpleasant to prove using combinatorial manipulation.

André Nicolas
  • 514,336
18

Use the fact that $$k\binom{n}k=\frac{kn!}{k!(n-k)!}=\frac{n!}{(k-1)!(n-k)!}=\frac{n(n-1)!}{(k-1)!(n-k)!}=n\binom{n-1}{k-1}\;:$$

$$\begin{align*} \sum^n_{k=0}k\binom nkp^k(1-p)^{n-k}&=\sum_{k=0}^nn\binom{n-1}{k-1}p^k(1-p)^{n-k}\\ &=n\sum_{k=0}^n\binom{n-1}{k-1}p^k(1-p)^{n-k}\\ &=n\sum_{k=0}^{n-1}\binom{n-1}kp^{k+1}(1-p)^{n-k-1}\\ &=np\sum_{k=0}^{n-1}\binom{n-1}kp^k(1-p)^{n-k-1}\\ &=np\Big(p+(1-p)\Big)^{n-1}&&\text{binomial theorem}\\ &=np\;. \end{align*}$$

Brian M. Scott
  • 631,399
9

Note that $$k \dbinom{n}{k} = n \dbinom{n-1}{k-1}$$ Hence, $$\mathbb{E}(X) = \sum_{k=1}^{n}n \dbinom{n-1}{k-1} p^k (1-p)^{n-k} = np \left(\sum_{r=0}^{n-1} \dbinom{n-1}{r} p^r (1-p)^{n-1-r} \right) = np$$

4

Since there are already great direct answers there, let me show you an alternative approach via differential calculus: \begin{align} \sum_i^N i \binom{N}{i} a^{i} b^{N-i} &= a \sum_i^N i \binom{N}{i} a^{i-1} b^{N-i} \\ &= a \frac{d}{da}\sum_i^N \binom{N}{i} a^{i} b^{N-i} \\ &= a \frac{d}{da}(a+b)^N \\ &= a N(a+b)^{N-1} \\ \end{align}

Now substitute $a = p$ and $b = 1-p$ will give you the expectation. $\blacksquare$

P.Virie
  • 41
0

Another possible way to show the identity. Set $c_m:=\sum_{k=0}^m\binom{m}k kp^k(1-p)^{m-k}$, $a_k:=kp^k$ and $b_k:=(1-p)^k$ then $$ c_m=\sum_{k=0}^m\binom{m}k a_kb_{m-k} $$ Thus $\{c_n/n!\}$ are the coefficients in the expansion of a Cauchy product of power series, that is $$ \begin{align*} \sum_{k\geqslant 0}c_k\frac{x^k}{k!}&=\left(\sum_{k\geqslant 0}a_k\frac{x^k}{k!}\right)\left(\sum_{k\geqslant 0}b_k\frac{x^k}{k!}\right)\\ &=\left(\sum_{k\geqslant 1}\frac{(px)^k}{(k-1)!}\right)\left(\sum_{k\geqslant 0}\frac{((1-p)x)^k}{k!}\right)\\ &=pxe^{px}e^{(1-p)x}=pxe^x\\ &=px\sum_{k\geqslant 0}\frac{x^k}{k!}=\sum_{k\geqslant 1}kp\frac{x^k}{k!} \end{align*} $$ Therefore $c_k=kp$ for each $k\in \Bbb N_{\geqslant 0} $.