1

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?

shrizzy
  • 754

1 Answers1

3

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.$$

parsiad
  • 25,154
  • I'm revisiting this question and having some trouble. $2S = 1 + 0.5(4) + 0.5^2(9)...$ $2S-S = 1 + 3(0.5) + 5(0.5^2) + 7(0.5^3) +...$ this just seems to get me another infinite sequence with varying numerators – shrizzy Apr 14 '23 at 04:20
  • @Bob could you take a look at this? – shrizzy Jul 16 '23 at 20:17
  • 1
    @shrizzy: I updated it to include a full answer – parsiad Jul 16 '23 at 22:27