|
Suppose that a random experiment has two possible outcomes, success with probability $p$ and failure with probability $q=1-p$ . The experiment is repeated until a success happens. The number of trials before the success is a random variable $X$ with density function $$f(x)=q^{(x-1)}p.$$
The distribution function determined by $f(x)$ is called a geometric distribution with parameter $p$ and it is given by $$F(x) = \sum_{k\leq x}q^{(k-1)}p.$$
The picture shows the graph for $f(x)$ with $p=1/4$ . Notice the quick decreasing. An interpretation is that a long run of failures is very unlikely.
We can use the moment generating function method in order to get the mean and variance. This function is $$G(t)=\sum_{k=1}^\infty e^{tk}q^{(k-1)}p=p\sum_{k=0}^\infty (e^tq)^k.$$ The last expression can be simplified as $$G(t)=\frac{p}{1-e^tq}.$$
The first and second derivatives are $$G'(t)=\frac{e^tpq}{(1-e^tq)^2}$$ so the mean is $$\mu=E[X]=G'(0)=\frac{q}{p}.$$
In order to find the variance, we get the second derivative and thus $$E[X^2]=G''(0)=\frac{2q^2}{p^2}+\frac{q}{p}$$ and therefore the variance is $$\sigma^2=E[X^2]-E[X]^2 = G''(0) - G'(0)^2 = \frac{q}{p^2}.$$
|