# Geometric Probabilities Distributions Examples



The geometric probability distribution is used in situations where we need to find the probability $P(X = x)$ that the $x$th trial is the first success to occur in a repeated set of trials.
The random variable $X$ associated with a geometric probability distribution is discrete and therefore the geometric distribution is discrete.

## Geometric Probability Formula

If the trials are
1) independent
2) each trial have only two possible mutually exclusive outcomes: success or failure
3) the probability of a success at each trial is $p$ and is constant
4) the probability of a failure at each trial is $1 - p$ (probability of complement) and is constant
We have a geometric probability distribution and the probability $P(X = x)$ that the the $x$th trial is a success is given by
$P(X = x) = (1 -p)^{x-1} p \quad \text{, for} \quad x = 1, 2, 3, ...$
Explanation of the formula
In order to have a first success at the $x$th trial, the first $x - 1$ trials must be failures each occurring with a probability $1 - p$.
The probability of having $x - 1$ successive failures is given by product rule $(1 - p) \times (1-p) \times (1-p) ... = (1-p)^{x-1}$ The $x$th trial must be a success occurring with a probability $p$
We then use the product rule to write the formula: $P(X = x) = (1 -p)^{x-1} p$ given above.

The mean of the geometric distribution is
$\mu = \dfrac{1}{p}$
The variance of the geometric distribution is
$\sigma^2 = \dfrac{1-p}{p^2}$
The standard deviation of the geometric distribution is
$\sigma = \sqrt{\dfrac{1-p}{p^2}}$

## Geometric Distribution Examples with Detailed Solutions

Example 1
A fair coin is tossed.
a) What is the probability of getting a tail at the 5th toss?
b) Find the mean $\mu$ and standard deviation $\sigma$ of the distribution?
c) Use excel or google sheets to plot the probabilities from $x = 1$ to $x = 10$.

Solution to Example 1
a)
Let "getting a tail" be a "success". For a fair coin, the probability of getting a tail is $p = 1/2$ and "not getting a tail" (failure) is $1 - p = 1 - 1/2 = 1/2$
For a fair coin, it is reasonable to assume that we have a geometric probability distribution.
Getting a tail at the 5th toss implies getting "no tail" (failure) for the first 4 tosses and a success at the 5th toss. Hence
$P(X = 5) = (1-1/2)^4 (1/2) = (1/2)^5 = 1/32 = 0.03125$.
b)
$\mu = 1 / 0.5 = 2$
$\sigma = \sqrt{\dfrac{1-p}{p^2}} = \sqrt{\dfrac{0.5}{0.5^2}} = 1.41$
c)
The distribution of the geometric probability distribution for $p = 0.5$
$P(X = x) = (0.5)^{x-1}0.5 \quad \text{, for} \quad x = 1, 2, 3, ...10$
is shown below below.

The distribution given above may be written as
$P(X = x) = (0.5)^{x-1}0.5 = 0.5^x$
It is an exponential distribution with base 0.5 and because the base is less than 1, it decreases exponentially.
The sum of the first 10 terms of the probability distribution was also computed using the same google sheet and it is equal to
$\sum\limits_{x=1}^{10} P(X = x) = 0.9990234375$
As the number of terms in the above sum increases, the sum approaches 1.

Example 2
In a large population of adults, 45% have a post secondary degree.
If people are selected at random from this population,
a) what is the probability that the third person selected is the first one that has a post secondary degree?
b) what is the probability that the first person with a post secondary degree is randomly selected on or before the 4th selection?

Solution to Example 2
a)
Let "having post secondary degree" be a "success". If a person from this population is selected at random, the probability of "having post secondary degree" is $p = 45\% = 0.45$ and "not having post secondary degree" (failure) is $1 - p = 1 - 0.45 = 0.55$
Selecting a person from a large population is a trial and these trials may be assumed to be independent. This is a geometric probability problem. Hence
$P(X = 3) = (1-0.45)^2 (0.45) = 0.1361$.
b)
On or before the 4th is selected means either the first, second, third or fourth person. The probability may be written as
$P(X \le 4) = P(X = 1) + P(X = 2) + P(X = 3) + P(X = 4)$
Substitute by the formula $P(X = x) = (1 - 0.45)^{x-1} 0.45$ to write
$P(X \le 4) = (1 - 0.45)^{1-1} 0.45 + (1 - 0.45)^{2-1} 0.45 + (1 - 0.45)^{3-1} 0.45 + (1 - 0.45)^{4-1} 0.45 = 0.9085$

## Sums of the terms of a Geometric sequence

As seen above, the geometric probability distribution is given by $P(X = x) = (1 -p)^{x-1} p$
Express $P(X = x)$ for $x = 1, 2, ...., n ..$ to obtain
$P(X = 1) = p , \quad P(X = 2) = (1 -p) p , \quad P(X = 3) = (1 -p)^{2} p .... \quad P(X = n) = (1 -p)^{n-1} p$
We note that the above are the terms of a geometric sequence hence the name of geometric probability distribution.

We need to find a formula for the finite and infinite sums of a the terms of a geometric sequence which will be used to answer the questions in the examples below and write closed form formulas that are easy to use.
The finite sum $S$ of the terms of a geometric sequence with first term $a _1$ and $n$th term $a_n = a_1 r^{n-1}$ and common ratio $r$ is given by
$S = \sum\limits_{x=1}^{n} a_1 r^{x-1} = a_1 + a_1 r + a_1 r^2 + ... a_1 r^{n-1}$
Multiply the left and right hand terms to obtain
$S r = a_1 r + a_1 r^2 + a_1 r^3 + ... a_1 r^n$
Subtract $S r$ from $S$
$S - S r = (a_1 + a_1 r + a_1 r^2 + ... a_1 r^{n-1}) - (a_1 r + a_1 r^2 + a_1 r^3 + ... a_1 r^n)$
Simplify
$S - S r = a_1 - a_1 r^n$
Factor $S$ out on the left side
$S (1 - r) = a_1 - a_1 r^n$
Solve for the sum $S$ to find the formula
$S = \sum\limits_{x=1}^{n} a_1 r^{x-1} = \dfrac{a_1(1 - r^n)}{1-r} \; , \; r \ne 1$
For $r \lt 1$ and the sum is infinite, we have $S = \sum\limits_{x=1}^{\infty} a_1 r^{x-1} = \dfrac{a_1}{1-r}$

Example 3
The trials of a probability experiment satisfy the conditions for a geometric distribution with a probability of success $p$, find the probability that
a) a success occurs on or before the nth trial.
b) a success occurs before the nth trial.
c) a success occurs on or after the nth trial.
d) a success occurs after the nth trial.

Solution to Example 3
a)
$P(X \le n) = \sum\limits_{x=1}^{n} P(X = x) = \sum\limits_{x=1}^{n} (1-p)^{x-1} p$
The above is a finite sum of a geometric sequence with the first term $a_1 = p$ and the nth term $a_n = (1-p)^{n-1} p$ and the common ratio $1 - p$. Hence
$P(X \le n) = \dfrac{p(1 - (1-p)^n)}{1-(1-p)} = 1 - (1-p)^n$

b)
$P(X \lt n) = \sum\limits_{x=1}^{n-1} P(X = x) = \sum\limits_{x=1}^{n-1} (1-p)^{x-1} p$
The above is a finite sum of a geometric sequence with the first term $a_1 = p$ and the common ratio $1 - p$. Hence
$P(X \lt n) = \dfrac{p(1 - (1-p)^{n-1})}{1-(1-p)} = 1 - (1-p)^{n-1}$

c)
Using the probability of the complement
$P(X \ge n) = 1 - P(X \lt n) = 1 - (1 - (1-p)^{n-1}) = (1-p)^{n-1}$

d)
Using the probability of the complement
$P(X \gt n) = 1 - P(X \le n) = 1 - (1 - (1-p)^n) = (1-p)^n$

Example 4
A company makes tools such that 99% of these tools are not defective.
Tools are selected at random and tested,
a) what is the probability that the second selected tool is the first to be non defective?
b) what is the probability that the first non defective tool is randomly selected on or before the second selection?
c) what is the probability that the first non defective tool is randomly selected after the 10th selection?

Solution to Example 4
a)
Let "a non defective tool" be a "success" with $p = 99\% = 0.99$.
$P(X = 2) = (1-0.99)^{2-1} (0.99) = 0.0099$.
b)
On or before the second selection means: $P(X \le 2)$
Substitute $n$ by $2$ and $p$ by $0.99$ in the formula $P(X \le n) = 1 - (1-p)^n$ obtained in example 3 above.
$P(X \le 2) = 1 - (1-0.99)^2 = 0.9999$

c)
After the 10th selection means: $P(X \gt 10)$
Substitute $n$ by $10$ and $p$ by $0.99$ in the formula $P(X \gt n) = (1-p)^n$ obtained in example 3 above.
$P(X \gt 10) = (1-0.99)^{10} = 10^{-20} \approx 0$