# Expectation of Geometric Distribution/Formulation 1

## Theorem

Let $X$ be a discrete random variable with the geometric distribution with parameter $p$ for some $0 < p < 1$.

$\map X \Omega = \set {0, 1, 2, \ldots} = \N$
$\map \Pr {X = k} = \paren {1 - p} p^k$

Then the expectation of $X$ is given by:

$\map E X = \dfrac p {1-p}$

## Proof 1

From the definition of expectation:

$\ds \expect X = \sum_{x \mathop \in \Omega_X} x \map \Pr {X = x}$

By definition of geometric distribution:

$\ds \expect X = \sum_{k \mathop \in \Omega_X} k p^k \paren {1 - p}$

Let $q = 1 - p$:

 $\ds \expect X$ $=$ $\ds q \sum_{k \mathop \ge 0} k p^k$ as $\Omega_X = \N$ $\ds$ $=$ $\ds q \sum_{k \mathop \ge 1} k p^k$ as the $k = 0$ term is zero $\ds$ $=$ $\ds q p \sum_{k \mathop \ge 1} k p^{k - 1}$ $\ds$ $=$ $\ds q p \frac 1 {\paren {1 - p}^2}$ Derivative of Geometric Sequence $\ds$ $=$ $\ds \frac p {1 - p}$ as $q = 1 - p$

$\blacksquare$

## Proof 2

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

$\map {\Pi_X} s = \dfrac q {1 - ps}$

where $q = 1 - p$.

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

$\map E X = \map {\Pi'_X} 1$

We have:

 $\ds \map {\Pi'_X} s$ $=$ $\ds \frac {\mathrm d} {\mathrm d s} \left({\frac q {1 - p s} }\right)$ $\ds$ $=$ $\ds \frac {q p} {\paren {1 - p s}^2}$ Derivatives of PGF of Geometric Distribution

Plugging in $s = 1$:

 $\ds \map {\Pi'_X} 1$ $=$ $\ds \frac {q p} {\paren {1 - p}^2}$ $\ds$ $=$ $\ds \frac p {1 - p}$ as $q = 1 - p$

Hence the result.

$\blacksquare$