Probability-generating function
From Wikipedia, the free encyclopedia
In probability theory, the probability-generating function of a discrete random variable is a power series representation (the generating function) of the probability mass function of the random variable. Probability-generating functions are often employed for their succinct description of the sequence of probabilities Pr(X = i), and to make available the well-developed theory of power series with non-negative coefficients.
Contents |
[edit] Definition
If N is a discrete random variable taking values on some subset of the non-negative integers, {0,1, ...}, then the probability-generating function of N is defined as:
where f is the probability mass function of N. Note that the equivalent notation GN is sometimes used to distinguish between the probability-generating functions of several random variables.
[edit] Properties
[edit] Power series
Probability-generating functions obey all the rules of power series with non-negative coefficients. In particular, G(1) = 1, since the probabilities must sum to one, and where G(1) = limz→1G(z), then the radius of convergence of any probability-generating function must be at least 1, by Abel's theorem for power series with non-negative coefficients.
[edit] Probabilities and expectations
The following properties allow the derivation of various basic quantities related to X:
1. The probability mass function of X is recovered by taking derivatives of G
2. It follows from Property 1 that if we have two random variables X and Y, and GX = GY, then fX = fY. That is, if X and Y have identical probability-generating functions, then they are identically distributed.
3. The normalization of the probability density function can be expressed in terms of the generating function by
The expectation of X is given by
More generally, the kth factorial moment, E(X(X − 1) ... (X − k + 1)), of X is given by
So the variance of X is given by
4.GX(et) = MX(t) where X is a random variable, G(t) is the probability generating function and M(t) is the moment generating function.
[edit] Functions of independent random variables
Probability-generating functions are particularly useful for dealing with functions of independent random variables. For example:
- If X1, X2, ..., Xn is a sequence of independent (and not necessarily identically distributed) random variables, and
- where the ai are constants, then the probability-generating function is given by
- For example, if
- then the probability-generating function, GSn(z), is given by
- It also follows that the probability-generating function of the difference of two random variables S = X1 − X2 is
- Suppose that N is also an independent, discrete random variable taking values on the non-negative integers, with probability-generating function GN. If the X1, X2, ..., XN are independent and identically distributed with common probability-generating function GX, then
- This can be seen as follows:
- This last fact is useful in the study of Galton-Watson processes.
- Suppose again that N is also an independent, discrete random variable taking values on the non-negative integers, with probability-generating function GN. If the X1, X2, ..., XN are independent, but not identically distributed random variables, where denotes the probability generating function of Xi, then it holds
- For identically distributed X_i this simplifies to the identity stated before. The general case is sometimes useful to obtain a decomposition of S_N by means of generating functions.
[edit] Examples
- The probability-generating function of a constant random variable, i.e. one with Pr(X = c) = 1, is
- The probability-generating function of a binomial random variable, the number of successes in n trials, with probability p of success in each trial, is
- Note that this is the n-fold product of the probability-generating function of a Bernoulli random variable with parameter p.
- The probability-generating function of a negative binomial random variable, the number of trials required to obtain the rth success with probability of success in each trial p, is
- Note that this is the r-fold product of the probability generating function of a geometric random variable.
- The probability-generating function of a Poisson random variable with rate parameter λ is
[edit] Example calculation: use of bivariate generating functions
The following example illustrates a very common technique the manipulation of PGFs: the use of bivariate super generating functions to compute the OGF of the PGFs of a sequence of random variables.
Suppose you sample a system that can assume two states, X and Y, X with probability p and Y with probability 1-p, e.g. a coin being flipped, obtaining the sequence of samples
where the system was sampled n times and has no memory.
Define the random variable Mn to be the number of changes from one sample to the next in a sequence of n samples, i.e. how often Sm was different from Sm − 1. For example, the sequence
has two changes, as does
We want to calculate the PGF of Mn, which we will do by using bivariate generating functions.
We introduce the bivariate GF G(z,u) given by
i.e. G(z,u) is the ordinary generating function of the PGFs of the Mn. This step is completely general and indeed the core of the method.
Now let xn,k be the probability of having k changes in a sequence of n samples, where the last sample was an X. Similarly, let yn,k be the probability of having k changes in a sequence of n samples, where the last sample was a Y, and put
so that
Now we clearly have
because having zero changes means getting a sequence of all Xs or Ys.
For we find
because e.g. to have k changes in a sequence of length n that ends in X, we either append an X to a sequence having k-1 changes and ending in Y, or append an X to a sequence having k changes and ending in X.
Summing these equations over n and k and writing X for X(z, u) and Y for Y(z, u), we obtain
and
The solution of this system is
and
We may now use the general identity
to calculate the factorial moments of Mn. E.g. the OGF of the expectations is given by
from which we find (extracting coefficients) that
An extensive discussion of this problem, as well as solutions by other methods, may be found on Les-Mathematiques.net (external links).
[edit] Example calculation: bivariate generating functions and differential equations
Consider the following balls and urns problem: suppose we have an urn containing n distinguishable balls, i.e. bearing labels from 1 to n. We pick one of the balls at random and remove it from the urn. We also remove all balls whose labels are larger than the one we picked from the urn. E.g. if we picked ball number one, the urn is emptied after one operation. We repeat until the urn is empty. E.g. for an urn containing ten balls, the sequence of picks 6-3-1 would empty the urn in three operations. We introduce the random variable Xn, which gives the number of picks needed to empty the urn. Our goal is to compute all of its moments, and we will do so using exactly the same bivariate generating function as in the previous example, namely the OGF of the PGFs:
We let pn,k be the probability of emptying an urn containing n balls with k operations, so that
We find that
because to empty the urn with one operation, we must pick the ball labelled 1. The remaining probabilities are computed recursively, e.g. we pick the ball with the largest label with probability 1 / n, leaving n − 1 balls (this is r = 1). We pick the ball with the next-to-largest label with probability 1 / n, leaving n − 2 balls (this is r = 2), etc. The upper bound for r is n − (k − 1), because we must have (we cannot e.g. empty an urn containing six balls using seven operations).
Next we set pn,k = 0 for n < k, so that we may replace the recursion by
Using the coefficient-extraction operator for formal power series, we thus have
We note furthermore that
and that
where the first equation results from our "boundary condition" that the probability of emptying an urn with one operation is 1 / n.
Summing over (there are two contributions to both sides of the equation, one for and another one for k = 1), we obtain
e.g. through
The solution to the differential equation is
- ,
with C(u) a formal power series in u. We note
which follows from the formal series
Hence C(u) is constant and equal to one, and we finally have
which is, incidentally, the generating function of the Stirling numbers of the first kind.
The moments now follow trivially from the formula given in the first example. E.g. for the expectation, we find
which gives
the nth harmonic number, and we need about operations to empty the urn.
An extensive discussion of this problem, as well as solutions by other methods, may be found on Les-Mathematiques.net (external links).
[edit] Related concepts
The probability-generating function is occasionally called the z-transform of the probability mass function. It is an example of a generating function of a sequence (see formal power series).
Other generating functions of random variables include the moment-generating function and the characteristic function.