# Thread: Second moment for geometric distribution

1. ## Second moment for geometric distribution

Hello,

I am stuck trying to calculate the second moment of the geometric distribution.

E(x^2) = Sum (x^2 * f(x))
= Sum (x^2 * p * q^(x-1))

I am not sure how to progress further from here - do you have any pointers? Thanks

2. Originally Posted by sharpe
Hello,

I am stuck trying to calculate the second moment of the geometric distribution.

E(x^2) = Sum (x^2 * f(x))
= Sum (x^2 * p * q^(x-1))

I am not sure how to progress further from here - do you have any pointers? Thanks
$\displaystyle E(x^2)=\sum_{x=1}^\infty x^2 p q^{x-1}=\sum_{x=1}^\infty x p \frac{d}{dq} q^x=\frac{d}{dq}\sum_{x=1}^\infty x p q^x}=\frac{d}{dq} \Big(q E(x)\Big)=\ldots$
Since you know the value of the first moment, $E(x)$, you are essentially done.

3. Originally Posted by Failure
$\displaystyle E(x^2)=\sum_{x=1}^\infty x^2 p q^{x-1}=\sum_{x=1}^\infty x p \frac{d}{dq} q^x=\frac{d}{dq}\sum_{x=1}^\infty x p q^x}=\frac{d}{dq} \Big(q E(x)\Big)=\ldots$
Since you know the value of the first moment, $E(x)$, you are essentially done.

fantastic thanks

4. sorry, if I can just check - does that give the right answer?

E(x) is 1 / (1-q). Which gives E(x^2) = d/dq (q/(1-q)

= 1 / (1-q)^2 = 1/ p^2

I know the answer is (1+q)/p^2; so this looks wrong?

5. Originally Posted by sharpe
sorry, if I can just check - does that give the right answer?

E(x) is 1 / (1-q). Which gives E(x^2) = d/dq (q/(1-q)

= 1 / (1-q)^2 = 1/ p^2

I know the answer is (1+q)/p^2; so this looks wrong?

In case anyone is interested, I found this by finding E(X(X-1)) first which is markedly easier. You then take the approach suggested, except using a second derivative.