# Probability - expectation and variance from a coin toss

1. Jan 30, 2014

### MeMoses

1. The problem statement, all variables and given/known data

A coin is flipped repeatedly with probability $$p$$ of landing on heads each flip.

Calculate the average $$<n>$$ and the variance $$\sigma^2 = <n^2> - <n>^2$$ of the attempt n at which heads appears for the first time.

2. Relevant equations

$$\sigma^2 = <n^2> - <n>^2$$

3. The attempt at a solution
I have the probability that head will appear for the first time on the nth attempt to be $$p(1-p)^{n-1}$$. Aside from that I'm not sure where to go.

2. Jan 30, 2014

### jbunniii

Your expression for the probability that the head occurs for the first time on the $n$th attempt looks correct to me. To find $\langle n \rangle$, plug your expression into the definition of the expected value:
$$\sum_{n=1}^{\infty} n p(1-p)^{n-1}$$
To evaluate the sum, try to express it in terms of a power series.

3. Jan 31, 2014

### Ray Vickson

There are more-or-less standard formulas for sums like $\sum_{n=1}^{\infty} n x^n$ and
$\sum_{n=1}^{\infty} n^2 x^n$. These may be found in books, and in on-line sources. Basically, they are easy to get manually, by looking at $S(x) = \sum_{n=1}^{\infty} x^n$ and then looking at what you get from $dS/dx$, etc.