Suppose we toss a fair coin. Let $N$ denote the number of tosses until we get heads. What is $Var(N)$?
My approach to this question is to find compute $[^2]- E[N]^2$. I got $E[N] = 2$ since $N$ follows a geometric distribution but I am having trouble with finding $[^2]$. If we do the series expansion on the expected value of $N^2$ we will get $1\times0.5 + 4\times0.5^2 + 9\times0.5^3 + ... ,$ but I have no idea how to solve this series. Any tips would be appreciated.
EDIT: I attempted to subtract $E[N^2]$ from $2E[N^2]$ but got another infinite sum I am not sure how to solve
$2E[N^2] = 1 + 4\times0.5 + 9\times0.5^2 +...$
$2E[N^2] - E[N^2] = 1 + 3(0.5) + 5(0.5^2) + 7(0.5^3)...$
Did I subtract the wrong terms?
Hint
Let $S = \sum_{n = 1}^\infty n^2 \, / \, 2^n$. What is $2S - S$?
See also this other answer for a generalization of the above series.
Full answer
Let's start by computing the first moment: $$\mathbb{E}N=\sum_{n=1}^{\infty}n2^{-n}.$$ A trick involving shifting the index of summation yields \begin{align*} \mathbb{E}N & =2\mathbb{E}N-\mathbb{E}N\\ & =\sum_{n=1}^{\infty}n2^{-n+1}-\sum_{n=1}^{\infty}n2^{-n}\\ & =\sum_{n=0}^{\infty}\left(n+1\right)2^{-n}-\sum_{n=1}^{\infty}n2^{-n}\\ & =1+\sum_{n=1}^{\infty}2^{-n}\\ & =2. \end{align*}
Now, let's tackle the second moment: $$\mathbb{E}N^{2}=\sum_{n=1}^{\infty}n^{2}2^{-n}.$$ The same trick yields \begin{align*} \mathbb{E}N^{2} & =2\mathbb{E}N^{2}-\mathbb{E}N^{2}\\ & =\sum_{n=1}^{\infty}n^{2}2^{-n+1}-\sum_{n=1}^{\infty}n^{2}2^{-n}\\ & =\sum_{n=0}^{\infty}\left(n+1\right)^{2}2^{-n}-\sum_{n=1}^{\infty}n^{2}2^{-n}\\ & =1+\sum_{n=1}^{\infty}\left(2n+1\right)2^{-n}\\ & =1+2\sum_{n=1}^{\infty}n2^{-n}+\sum_{n=1}^{\infty}2^{-n}\\ & =1+2\mathbb{E}N+\sum_{n=1}^{\infty}2^{-n}\\ & =1+4+1\\ & =6. \end{align*}
In conclusion, $$\operatorname{Var}(N)=\mathbb{E}N^{2}-\left(\mathbb{E}N\right)^{2}=6-4=2.$$