Search for probability and statistics terms on Statlect
StatLect

Geometric distribution

by , PhD

The geometric distribution is the probability distribution of the number of failures we get by repeating a Bernoulli experiment until we obtain the first success.

Table of Contents

Intuition

Consider a Bernoulli experiment, that is, a random experiment having two possible outcomes: either success or failure.

We repeat the experiment until we get the first success, and then we count the number X of failures that we faced prior to recording the success.

Since the experiments are random, X is a random variable.

If the repetitions of the experiment are independent of each other, then the distribution of $X,$ is called geometric distribution.

Example If we toss a coin until we obtain head, the number of tails before the first head has a geometric distribution.

At the end of this lecture we will also study a slight variant of the geometric distribution, called shifted geometric distribution. The latter is the distribution of the total number of trials (all the failures + the first success).

In other words, if X has a geometric distribution, then $X+1$ has a shifted geometric distribution.

Difference between the geometric distribution and its shifted version.

Definition

The geometric distribution is characterized as follows.

Definition Let X be a discrete random variable. Let [eq1]. Let the support of X be the set of non-negative integers[eq2]We say that X has a geometric distribution with parameter p if its probability mass function is[eq3]

The following is a proof that [eq4] is a legitimate probability mass function.

Proof

The probabilities [eq5] are well-defined and non-negative for any x because [eq6]. We just need to prove that the sum of [eq7] over its support equals 1: [eq8]where in step $frame{A}$ we have used the formula for geometric series.

Relation to the Bernoulli distribution

Remember that a Bernoulli random variable is equal to:

The following proposition shows how the geometric distribution is related to the Bernoulli distribution.

Proposition Let [eq9] be a sequence of independent Bernoulli random variables with parameter p. Then, for any integer $xgeq 0$, the probability that $B_{n}=0$ for $nleq x$ and $B_{x+1}=1$ is[eq10]where [eq11] is the probability mass function of a geometric distribution with parameter p.

Proof

Since the Bernoulli random variables are independent, we have that[eq12]

Expected value

The expected value of a geometric random variable X is[eq13]

Proof

It can be derived as follows:[eq14]

Variance

The variance of a geometric random variable X is[eq15]

Proof

Let us first derive the second moment of X:[eq16]Now, we can use the variance formula:[eq17]

Moment generating function

The moment generating function of a geometric random variable X is defined for any [eq18]:[eq19]

Proof

This is proved as follows:[eq20]where the series in step $frame{A}$ converges only if [eq21]that is, only if[eq22]By taking the natural log of both sides, the condition becomes[eq23]

Characteristic function

The characteristic function of a geometric random variable X is[eq24]

Proof

The proof is similar to the proof for the mgf:[eq25]

Distribution function

The distribution function of a geometric random variable X is[eq26]

Proof

For $x<0$, [eq27], because X cannot be smaller than 0. For $xgeq 0$, we have[eq28]

The shifted geometric distribution

As we have said in the introduction, the geometric distribution is the distribution of the number of failed trials before the first success.

The shifted geometric distribution is the distribution of the total number of trials (all the failures + the first success).

In other words, if X has a geometric distribution, then [eq29]has a shifted geometric distribution.

It is then simple to derive the properties of the shifted geometric distribution.

It expected value is[eq30]

Its variance is[eq31]

Its moment generating function is, for any [eq32]:[eq33]

Its characteristic function is[eq34]

Its distribution function is[eq35]

Relation to the exponential distribution

The geometric distribution is considered a discrete version of the exponential distribution.

Suppose that the Bernoulli experiments are performed at equal time intervals.

Then, the geometric random variable X is the time (measured in discrete units) that passes before we obtain the first success.

Contrast this with the fact that the exponential distribution is used to model the time elapsed before a given event occurs when time is continuous.

From a mathematical viewpoint, the geometric distribution enjoys the same memoryless property possessed by the exponential distribution:

Solved exercises

Below you can find some exercises with explained solutions.

Exercise 1

On each day we play a lottery in which the probability of winning is $1%$.

What is the expected value of the number of days that will elapse before we win for the first time?

Solution

Each time we play the lottery, the outcome is a Bernoulli random variable (equal to 1 if we win), with parameter $p=0.01$. Therefore, the number of days before winning is a geometric random variable with parameter $p=0.01$. Its expected value is[eq36]

How to cite

Please cite as:

Taboga, Marco (2021). "Geometric distribution", Lectures on probability theory and mathematical statistics. Kindle Direct Publishing. Online appendix. https://www.statlect.com/probability-distributions/geometric-distribution.

The books

Most of the learning materials found on this website are now available in a traditional textbook format.