A geometric distribution is a discrete probability distribution of a random variable. Suppose I am in a mood to dance in a party hall and i randomly ask people to dance. Now let X denote the number of people i ask in order to dance. Suppose now, if the first person accepts then X = 1. If the first person refuses and the second person accepts then the value of X will be 2 and it goes on. Now When X = n, where i failed for the first (n - 1) times and succeeded on the nth try. The probability of failure for the first try will be (1 - p), and for the first two tries it is (1 - p)(1 - p). So now the probability of failing for first n - 1 tries will be $(1-p)^{n-1}$ and the probability of succeeding at the nth try is p.
Therefore P(X = n) = $(1-p)^{n-1}$ p This is known as Geometric distribution.
A geometric distribution is a discrete probability distribution of a random variable X which satisfies the following conditions:
1. A trial is repeated until a success occurs.
2. The trials will be independent and the probability will be constant for each trial.
3. Many things will be repeated until a success occurs. For example you may take your driver's exam several times before you pass and acquire your driver's license.

In Probability theory and statistics, a discrete random variable X is said to have a geometric distribution if it has a probability density function of the form:
P(X = n) = $(1-p)^{n-1}$ p
If X has a geometric distribution with parameter p, we denote it as  X $\sim$ G(p)
The mean and variance of geometric distribution is E(X) = $\frac{q}{p}$ and Var(X) = $\frac{q}{p^{2}}$, q = 1 - p
Consider p(x) = $pq^{x}$ ; x = 0, 1, 2,........

Mean = E(x) =$\sum_{x=0}^{\infty }x p(x)$

$\sum_{x=0}^{\infty }x pq^{x}$

p$\sum_{x=0}^{\infty }xq^{x}$

p$[0+q+2q^{2}+3q^{3}+......]$

pq$[1+2q+3q^{2}+....]$

pq ${(1-q)}^{-2}$ , p = 1 - q

pq $p^{-2}$ = $\frac{q}{p}$

Therefore, Mean = E(X) = $\frac{q}{p}$
Consider p(x) = $pq^{x}$ ; x = 0, 1, 2,........

$Var(X)=E(X^{2})-[E(x)]^{2}$

Consider $E(X^{2})- $$\frac{q^{2}}{p^{2}}$ ..... equation 1

We know that, mean (E(X)) = $\frac{q}{p}$

$E(X^{2})$ = $\sum_{x=0}^{\infty }x^{2}p(x)$

$\sum_{x=0}^{\infty }[x(x-1)+x]p(x)$

$\sum_{x=0}^{\infty }x(x-1)p(x)+\sum_{x=0}^{\infty }xp(x)$

$\sum_{x=0}^{\infty }x(x-1)pq^{x}+$$\frac{q}{p}$

p$\sum_{x=0}^{\infty }x(x-1)q^{x}+$$\frac{q}{p}$

p$[1.2q^{2}+2.3q^{3}+3.4q^{4}+........]+$$\frac{q}{p}$

$p2q^{2}[1+3q+6q^{2}+10q^{3}+........]+$$\frac{q}{p}$

$2pq^{2}(1-q)^{-3}+$$\frac{q}{p}$ , q= 1 - p

$2pq^{2}(p)^{-3}+$$\frac{q}{p}$

$\frac{2pq^{2}}{(p)^{3}}$$+$$\frac{q}{p}$

$\frac{2q^{2}}{p^{2}}$+$\frac{q}{p}$

Substituting in equation 1 we get,

Now var(X) = $\frac{2q^{2}}{p^{2}}$ + $\frac{q}{p}$ - $\frac{q^{2}}{p^{2}}$

$\frac{q^{2}}{p^{2}}$ + $\frac{q}{p}$

$\frac{q}{p}$(1+ $\frac{q}{p}$) = $\frac{q}{p}$ ($\frac{p+q}{p}$) (p + q = 1)

$\frac{q}{p^{2}}$

Therefore, Variance of Geometric distrinution is Var (X) = $\frac{q}{p^{2}}$

Solved Examples

Question 1: If the probability that a target is destroyed on any one shot is 0.5, what is the probability that it would be destroyed on 6th attempt?
Solution:
 
X : Number of times the target is missed.

X $\sim$ G(p), X $\sim$ G(0.5) p = 0.5 = q, q = 1 - p

$f(x)=\left\{\begin{matrix}
q^{x} p ; x = 0, 1, 2, 3..\\
0 ; otherwise
\end{matrix}\right.$


Now consider $P(X = 5) = (0.5)^{0.5} (0.5)$
                                     
                                       = 0.0156

Therefore , the probability that the target can be destroyed on 6th attempt is 0.0156.
 

Question 2: In an experiment conducted we see that the products produced by a machine is 3% defective.
  • What is the probability that the first defective occurs in the fifth item inspected?
  • Also find the probability for the first defective which may appear in the first five inspections?

Solution:
 
  • P(X = 5) = P(1st four non defective) P(5th defective)
         =$(0.97)^{4} \times (0.03)$
         = 0.0266

  • P(X $\leq$ 5) = 1 − P(1st five non defective )
           = $1 − ( 0.97)^{5}$
           =0.1413