$\sum\limits_{n=1}^\infty n(\frac{1}{2})^{n}$ 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?  
 A: 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$$
A: 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.}
$$
A: 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$
A: $$\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.
A: 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$.
