How would I find the variance of a random variable with this distribution? Random variable $X$ has the following distribution:
$P(X=0) = 1/2$
For all non-zero integers, $P(X=n) = (1/2)^{|n|+2}$
How would I find the variance of this random variable?
I know that the variance can be found by calculating $\operatorname{E}(X^2) - \operatorname{E}(X)^2$ but I am unsure of how to do this since the PMF has two parts. Thanks!
 A: Since the distribution is symmetric about $0$, $\mathbb{E}[X] = 0$. 
$$\mathbb{E}[X^2] = \sum_{k=-\infty}^\infty k^2 2^{-|k|-2} = 2 \sum_{k=1}^\infty k^2 2^{-k-2} = \frac{1}{2}\sum_{k=1}^\infty k^2 \left(\frac{1}{2}\right)^k$$
Now consider 
\begin{align} 
f(x) = \sum_{k=1}^\infty x^k = \frac{1}{1-x} -1 \textrm{ if } |x|<1\\
\Rightarrow x\frac{\mathrm{d}}{\mathrm{d}x}\left(x\frac{\mathrm{d}}{\mathrm{d}x}\right)f(x) = \sum_{k=1}^\infty k^2x^k = \frac{x(1+x)}{(1-x)^3}
\end{align}
Thus,
$$ \operatorname{E}[X^2] = \frac{1}{2} \left[ \frac{x(1+x)}{(1-x)^3} \right]_{x=\frac{1}{2}} = 3 = \operatorname{Var}[X]$$
A: Here's what I get...
$$f=\sum_{n=-\infty}^{-1} \left(\frac{1}{2}\right)^{|n| +2}+\frac{1}{2}+\sum _{n=1}^\infty \left(\frac{1}{2}\right)^{|n| +2}$$
$$E[X]^2= \sum_{n=-\infty}^{-1} n \left(\frac{1}{2}\right)^{ |n| +2} + 0\cdot\frac{1}{2}+ \sum_{n=1}^\infty n \left(\frac{1}{2}\right)^{|n|+2}=0$$
and 
$$E[X^2]=\sum_{n=-\infty}^{-1} n ^2 \left(\frac{1}{2}\right)^{|n| +2}+ 0^2 \cdot\frac{1}{2} + \sum_{n=1}^\infty \ n ^2 \left(\frac{1}{2}\right)^{|n|+2} = 3 $$
So, 
$$V[X]=E[X^2]-E[X]^2=3-0=3.$$
