# Variance of Geometric Distribution

## Theorem

Let $X$ be a discrete random variable with the geometric distribution with parameter $p$.

Then the variance of $X$ is given by:

$\operatorname{var} \left({X}\right) = \dfrac p {\left({1 - p}\right)^2}$

## Proof 1

From the definition of Variance as Expectation of Square minus Square of Expectation:

$\var X = \expect {X^2} - \paren {\expect X}^2$
$\displaystyle \expect {X^2} = \sum_{x \mathop \in \Omega_X} x^2 \map \Pr {X = x}$

To simplify the algebra a bit, let $q = 1 - p$, so $p + q = 1$.

Thus:

 $\displaystyle \expect {X^2}$ $=$ $\displaystyle \sum_{k \mathop \ge 1} k^2 q p^k$ $\quad$ Definition of Geometric Distribution, with $p + q = 1$ $\quad$ $\displaystyle$ $=$ $\displaystyle p \sum_{k \mathop \ge 1} k^2 q p^{k-1}$ $\quad$ $\quad$ $\displaystyle$ $=$ $\displaystyle p \paren {\frac 2 {q^2} - \frac 1 q}$ $\quad$ Variance of Shifted Geometric Distribution: Proof 1 $\quad$

Then:

 $\displaystyle \var X$ $=$ $\displaystyle \expect {X^2} - \paren {\expect X}^2$ $\quad$ $\quad$ $\displaystyle$ $=$ $\displaystyle p \paren {\frac 2 {\paren {1 - p}^2} - \frac 1 {1 - p} } - \frac {p^2} {\paren {1 - p}^2}$ $\quad$ Expectation of Geometric Distribution: $\expect X = \dfrac p {1 - p}$ $\quad$ $\displaystyle$ $=$ $\displaystyle \frac p {\paren {1 - p}^2}$ $\quad$ after some algebra $\quad$

$\blacksquare$

## Proof 2

From Variance of Discrete Random Variable from PGF, we have:

$\operatorname{var} \left({X}\right) = \Pi''_X \left({1}\right) + \mu - \mu^2$

where $\mu = E \left({x}\right)$ is the expectation of $X$.

From the Probability Generating Function of Geometric Distribution, we have:

$\Pi_X \left({s}\right) = \dfrac q {1 - ps}$

where $q = 1 - p$.

From Expectation of Geometric Distribution, we have:

$\mu = \dfrac p q$

From Derivatives of PGF of Geometric Distribution, we have:

$\Pi''_X \left({s}\right) = \dfrac {2 q p^2} {\left({1 - ps}\right)^3}$

Putting $s = 1$ using the formula $\Pi''_X \left({1}\right) + \mu - \mu^2$:

$\operatorname{var} \left({X}\right) = \dfrac {2 q p^2} {\left({1-p}\right)^3} + \dfrac p q - \left({\dfrac p q}\right)^2$

and hence the result, after some algebra.

$\blacksquare$