Expected value given distribution What would be the variance of a random var. $Z$ with distribution $\mathbb{P}(Z=n)=2^{-n}$ over all positive integers? I am clueless. 
I know $\mathbb{E}(Z)$ would be $\sum_{n=1}^\infty n 2^{-n}$. At least I believe that is true. I don't know how I would calculate that value or arrive at the variance.
 A: Start with the definition
$$
  \mathbb{Var}(Z) = \mathbb{E}(Z^2) - \mathbb{E}(Z)^2
$$
Applying the law of the unconscious statistician:
$$
   \mathbb{E}(Z) = \sum_{n=1}^\infty n \mathbb{P}(Z=n) = \sum_{n=1}^\infty n 2^{-n} \qquad
   \mathbb{E}(Z^2) = \sum_{n=1}^\infty n^2 \mathbb{P}(Z=n) = \sum_{n=1}^\infty n^2 2^{-n}
$$
To evaluate those sums notice that
$$
   \mathbb{E}(Z) = \sum_{n=1}^\infty n 2^{-n} = \frac{1}{2} +  \sum_{n=2}^\infty n 2^{-n} \stackrel{n=m+1}{=} \frac{1}{2} + \frac{1}{2} \sum_{m=1}^\infty (m+1) 2^{-m}\\ = \frac{1}{2} + \frac{1}{2} \mathbb{E}(Z +1) = 1 + \frac{1}{2} \mathbb{E}(Z)
$$
Hence $\mathbb{E}(Z) = 2$. Likewise:
$$
   \mathbb{E}(Z^2) = \frac{1}{2} + \frac{1}{2} \mathbb{E}\left(Z^2+2 Z + 1\right)
$$
Now solve for $\mathbb{E}(Z^2)$ and find the variance.
A: Another way to carry out the computations in Sasha's answer is to use the identity derived here:
$$
\begin{align}
\sum_{k=0}^\infty\binom{k}{n}x^k
&=\sum_{k=0}^\infty\binom{k}{k-n}x^k\\
&=\sum_{k=0}^\infty(-1)^{k-n}\binom{-n-1}{k-n}x^k\\
&=\frac{x^n}{(1-x)^{n+1}}\tag{1}
\end{align}
$$
Then, using $\displaystyle k=\binom{k}{1}$ and $\displaystyle k^2=2\binom{k}{2}+\binom{k}{1}$ and
$$
\sum_{k=0}^\infty\binom{k}{1}x^k=\frac{x}{(1-x)^2}\tag{2}
$$
and
$$
\sum_{k=0}^\infty\binom{k}{2}x^k=\frac{x^2}{(1-x)^3}\tag{3}
$$
$(2)$ says that
$$
\begin{align}
\sum_{k=0}^\infty k\,\mathbb{P}(Z=k)
&=\frac{\frac12}{\left(1-\frac12\right)^2}\\
&=2\tag{4}
\end{align}
$$
and $(2)$ and $(3)$ says that
$$
\begin{align}
\sum_{k=0}^\infty k^2\,\mathbb{P}(Z=k)
&=2\frac{\left(\frac12\right)^2}{\left(1-\frac12\right)^3}
+\frac{\frac12}{\left(1-\frac12\right)^2}\\
&=6\tag{5}
\end{align}
$$
and the mean and variance are easily computed from $(4)$ and $(5)$.
