# $\sum\limits_{n=1}^\infty n(\frac{1}{2})^{n}$ [duplicate]

I am trying to find the expected value of the number of even numbers rolled before the first odd number when rolling a fair die until an odd number comes up. I arrived at $\sum\limits_{n=1}^\infty n(\frac{1}{2})^{n+1}$, then I factored out a $\frac{1}{2}$ to give me $\sum\limits_{n=1}^\infty n(\frac{1}{2})^{n}$. What I now lack is knowledge of infinite series. I know it converges to 2; what I want to know is why?

• Chech this technique. – Mhenni Benghorbal Apr 20 '14 at 0:34
• Look into geometric distributions. – Shahar Apr 20 '14 at 0:40

$$\sum_{n=1}^\infty nx^{n-1}=\left(\sum_{n=0}^\infty x^n\right)'=\left(\frac1{1-x}\right)'=\frac1{(1-x)^2}$$ if $|x|<1$, so $$\sum\limits_{n=1}^\infty n\left(\!\frac12\!\right)^{n+1}=\frac14\sum\limits_{n=1}^\infty n\left(\!\frac12\!\right)^{n-1}=\frac14\frac1{\left(1-\frac12\right)^2}=\frac14\cdot4=1$$

This also helps with $\sum n(n-1) p^n$, $\sum n^2p^n$ and similar, which often show up in such probability calculations.

• Isn't the question $\sum n2^{-n}$, not $\sum n2^{-(n+1)}$? – Thomas Andrews Apr 20 '14 at 2:01
• @ThomasAndrews He said he arrived at $\sum\limits_{n=1}^\infty n\left(\frac12\right)^{n+1}$ (which seems to be correct) when doing the expected value calculation, so why not start from there? At least this result has a direct interpretation. – user2345215 Apr 20 '14 at 8:50

Let $S=\sum\limits_{n\geqslant 1}n2^{-n}$. Then $$2S=\sum_{n\geqslant 1}n2^{-(n-1)}=\sum_{n\geqslant 1}(n-1+1)2^{-(n-1)}=\sum_{k\geqslant 0}(k+1)2^{-k}=S+\sum_{k\geqslant 0}2^{-k}=S+2$$

Consider the following matrix of infinite dimension: $$\left[\begin{matrix} \frac 12&\frac 1{2^2}&\dots&\frac 1{2^n}&\dots\\ 0 &\frac 1{2^2}&\dots&\frac 1{2^n}&\dots\\ 0& 0&\ddots&&\dots\\ 0&0&0&\frac 1{2^n}&\dots\\ \vdots&\vdots&\vdots&\vdots&\vdots\\ \end{matrix}\right].$$ Suppose that we are interested in the sum of all elements of the matrix. One way is to sum the columns first and then sum them up which gives us $\sum\limits_{i=1}^\infty n(\frac{1}{2})^{n}$. However another way is to sum elements of each row first and then sum them up which is the following: $$\sum\limits_{i=1}^\infty n(\frac{1}{2})^{n}=\\ \begin{matrix} \frac 12+&\frac 1{2^2}+&\dots+&\frac 1{2^n}+&\dots&\color{red}{=1}\\ +0 +&\frac 1{2^2}+&\dots+&\frac 1{2^n}+&\dots&\color{red}{=\frac 12}\\ +0+& 0+&\ddots+&&\dots&\color{red}{=\vdots}\\ +0+&0+&0+&\frac 1{2^n}+&\dots&\color{red}{=\frac 1{2^{n-1}}}\\ +\vdots+&\vdots+&\vdots+&\vdots+&\vdots&\color{red}{=\vdots}\\ \end{matrix}\\ \color{red}{=1+\frac 12+\dots=2.}$$

Let $f(x) = \displaystyle \sum_{n=1}^\infty x^n$, then $S = \dfrac{1}{2}\cdot f'(\frac{1}{2})$ = $\dfrac{x}{(1 - x)^2}|_{x = \frac{1}{2}} = 2$

Note that $\frac{n}{{{2}^{n}}}=\frac{n+1}{{{2}^{n-1}}}-\frac{n+2}{{{2}^{n}}}$. Hence, $\sum\limits_{n=1}^{\infty }{\frac{n}{{{2}^{n}}}}=\underset{n\to \infty }{\mathop{\lim }}\,\left( 2-\frac{n+2}{{{2}^{n}}} \right)=2$.