# The variance of the geometric distribution

Last updated: Jan. 3, 2019
Let $X$ be a discrete random variable with the geometric distribution with parameter p ($0 \lt p \lt 1$).
, where $k=1,2,\cdots.$ The variance of $X$ is
.

### Proof

Let $X$ be a discrete random variable with the geometric distribution with parameter p ($0 \lt p \lt 1$).
. The expectation value of $X$ is
. In general, the variance is the difference between the expectation value of the square and the square of the expectation value, i.e.,
. Therefore, we have
. To obtain the variance, we thus need to find the expectation of $X^2$.
The expectation of $X^2$ with the geometric distribution $(1)$ is
.
In order to obtain the sum in the right-hand side, we focus on the Taylor expansion of $1/(1-x)$,
, and differentiate the both sides,
. We multiply the both sides by x,
, and differentiate the both sides again,
. By variable transformation, $x=1−p$, this equation becomes
. We substitute this equation into $(3)$
.
From this expression and (2), the variance is obtained.
Example :
Example 1:
The graph below shows the geometric distribution for $p=1/2$.
The variance is
.
Example 2:
The graph below shows the geometric distribution for $p=1/4$.
The variance is
.
Example 3:
The graph below shows the geometric distribution for $p=1/8$.
The variance is
.
The larger $p$ is, the more flat the graph is, and the more the variance is.