# Probability-generating function

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*) in the probability mass function for a random variable *X*, and to make available the well-developed theory of power series with non-negative coefficients.

## Definition

### Univariate case

If *X* is a discrete random variable taking values in the non-negative integers {0,1, ...}, then the *probability generating function* of *X* is defined as
^{[1]}

- [math]\displaystyle{ G(z) = \operatorname{E} (z^X) = \sum_{x=0}^{\infty}p(x)z^x, }[/math]

where *p* is the probability mass function of *X*. Note that the subscripted notations *G*_{X} and *p _{X}* are often used to emphasize that these pertain to a particular random variable

*X*, and to its distribution. The power series converges absolutely at least for all complex numbers

*z*with |

*z*| ≤ 1; in many examples the radius of convergence is larger.

### Multivariate case

If *X* = (*X*_{1},...,*X _{d}* ) is a discrete random variable taking values in the

*d*-dimensional non-negative integer lattice {0,1, ...}

^{d}, then the

*probability generating function*of

*X*is defined as

- [math]\displaystyle{ G(z) = G(z_1,\ldots,z_d)=\operatorname{E}\bigl (z_1^{X_1}\cdots z_d^{X_d}\bigr) = \sum_{x_1,\ldots,x_d=0}^{\infty}p(x_1,\ldots,x_d)z_1^{x_1}\cdots z_d^{x_d}, }[/math]

where *p* is the probability mass function of *X*. The power series converges absolutely at least for all complex vectors *z* = (*z*_{1},...,*z _{d}* ) ∈ ℂ

^{d}with max{|

*z*

_{1}|,...,|

*z*|} ≤ 1.

_{d}## Properties

### Power series

Probability generating functions obey all the rules of power series with non-negative coefficients. In particular, *G*(1^{−}) = 1, where *G*(1^{−}) = lim_{z→1}*G*(*z*) from below, since the probabilities must sum to one. So 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.

### Probabilities and expectations

The following properties allow the derivation of various basic quantities related to *X*:

- The probability mass function of
*X*is recovered by taking derivatives of*G,*- [math]\displaystyle{ p(k) = \operatorname{Pr}(X = k) = \frac{G^{(k)}(0)}{k!}. }[/math]

- It follows from Property 1 that if random variables
*X*and*Y*have probability-generating functions that are equal, [math]\displaystyle{ G_X = G_Y }[/math], then [math]\displaystyle{ p_X = p_Y }[/math]. That is, if*X*and*Y*have identical probability-generating functions, then they have identical distributions. - The normalization of the probability density function can be expressed in terms of the generating function by
- [math]\displaystyle{ \operatorname{E}[1]=G(1^-)=\sum_{i=0}^\infty p(i)=1. }[/math]
- The expectation of [math]\displaystyle{ X }[/math] is given by
- [math]\displaystyle{ \operatorname{E}[X] = G'(1^-). }[/math]

- More generally, the
*k*^{th}factorial moment, [math]\displaystyle{ \operatorname{E}(X(X - 1) \cdots (X - k + 1)) }[/math] of*X*is given by- [math]\displaystyle{ \operatorname{E}\left[\frac{X!}{(X-k)!}\right] = G^{(k)}(1^-), \quad k \geq 0. }[/math]

- So the variance of
*X*is given by- [math]\displaystyle{ \operatorname{Var}(X)=G''(1^-) + G'(1^-) - \left [G'(1^-)\right ]^2. }[/math]

- Finally, the
*k*^{th}raw moment of X is given by- [math]\displaystyle{ \operatorname{E}[X^k] = \left(z\frac{\partial}{\partial z}\right)^k G(z) \Big|_{z=1^-} }[/math]

- [math]\displaystyle{ G_X(e^t) = M_X(t) }[/math] where
*X*is a random variable, [math]\displaystyle{ G_X(t) }[/math] is the probability generating function (of*X*) and [math]\displaystyle{ M_X(t) }[/math] is the moment-generating function (of*X*) .

### Functions of independent random variables

Probability generating functions are particularly useful for dealing with functions of independent random variables. For example:

- If
*X*_{1},*X*_{2}, ...,*X*_{N}is a sequence of independent (and not necessarily identically distributed) random variables that take on natural-number values, and

- [math]\displaystyle{ S_N = \sum_{i=1}^N a_i X_i, }[/math]

- where the
*a*_{i}are constant natural numbers, then the probability generating function is given by

- [math]\displaystyle{ G_{S_N}(z) = \operatorname{E}(z^{S_N}) = \operatorname{E} \left( z^{\sum_{i=1}^N a_i X_i,} \right) = G_{X_1}( z^{a_1})G_{X_2}(z^{a_2})\cdots G_{X_N}(z^{a_N}). }[/math]

- For example, if

- [math]\displaystyle{ S_N = \sum_{i=1}^N X_i, }[/math]

- then the probability generating function,
*G*_{SN}(*z*), is given by

- [math]\displaystyle{ G_{S_N}(z) = G_{X_1}(z)G_{X_2}(z)\cdots G_{X_N}(z). }[/math]

- It also follows that the probability generating function of the difference of two independent random variables
*S*=*X*_{1}−*X*_{2}is

- [math]\displaystyle{ G_S(z) = G_{X_1}(z) G_{X_2}(1/z). }[/math]

- Suppose that
*N*, the number of independent random variables in the sum above, is not a fixed natural number but is also an independent, discrete random variable taking values on the non-negative integers, with probability generating function*G*_{N}. If the*X*_{1},*X*_{2}, ...,*X*_{N}are independent*and*identically distributed with common probability generating function*G*_{X}, then

- [math]\displaystyle{ G_{S_N}(z) = G_N(G_X(z)). }[/math]

- This can be seen, using the law of total expectation, as follows:

- [math]\displaystyle{ \begin{align} G_{S_N}(z) & = \operatorname{E}(z^{S_N}) = \operatorname{E}(z^{\sum_{i=1}^N X_i}) \\[4pt] & = \operatorname{E}\big(\operatorname{E}(z^{\sum_{i=1}^N X_i} \mid N) \big) = \operatorname{E}\big( (G_X(z))^N\big) =G_N(G_X(z)). \end{align} }[/math]

- This last fact is useful in the study of Galton–Watson processes and compound Poisson processes.

- Suppose again that
*N*is also an independent, discrete random variable taking values on the non-negative integers, with probability generating function*G*_{N}and probability mass function [math]\displaystyle{ f_i = \Pr\{N = i\} }[/math]. If the*X*_{1},*X*_{2}, ...,*X*_{N}are independent, but*not*identically distributed random variables, where [math]\displaystyle{ G_{X_i} }[/math] denotes the probability generating function of [math]\displaystyle{ X_i }[/math], then

- [math]\displaystyle{ G_{S_N}(z) = \sum_{i \ge 1} f_i \prod_{k=1}^i G_{X_i}(z). }[/math]

- For identically distributed
*X*this simplifies to the identity stated before. The general case is sometimes useful to obtain a decomposition of_{i}*S*by means of generating functions._{N}

## Examples

- The probability generating function of an almost surely constant random variable, i.e. one with Pr(
*X*=*c*) = 1, is

- [math]\displaystyle{ G(z) = z^c. }[/math]

- 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

- [math]\displaystyle{ G(z) = \left[(1-p) + pz\right]^n. }[/math]

- Note that this is the
*n*-fold product of the probability generating function of a Bernoulli random variable with parameter*p*. - So the probability generating function of a fair coin, is

- [math]\displaystyle{ G(z) = 1/2 + z/2. }[/math]

- The probability generating function of a negative binomial random variable on {0,1,2 ...}, the number of failures until the
*r*th success with probability of success in each trial*p*, is

- [math]\displaystyle{ G(z) = \left(\frac{p}{1 - (1-p)z}\right)^r. }[/math]

- (Convergence for [math]\displaystyle{ |z| \lt \frac{1}{1-p} }[/math]).

- Note that this is the
*r*-fold product of the probability generating function of a geometric random variable with parameter 1 −*p*on {0,1,2,...}.

- The probability generating function of a Poisson random variable with rate parameter
*λ*is

- [math]\displaystyle{ G(z) = e^{\lambda(z - 1)}. }[/math]

## Related concepts

The probability generating function is an example of a generating function of a sequence: see also formal power series. It is equivalent to, and sometimes called, the z-transform of the probability mass function.

Other generating functions of random variables include the moment-generating function, the characteristic function and the cumulant generating function. The probability generating function is also equivalent to the factorial moment generating function, which as [math]\displaystyle{ \operatorname{E}\left[z^X\right] }[/math] can also be considered for continuous and other random variables.

## Notes

## References

- Johnson, N.L.; Kotz, S.; Kemp, A.W. (1993)
*Univariate Discrete distributions*(2nd edition). Wiley. ISBN 0-471-54897-9 (Section 1.B9)

Original source: https://en.wikipedia.org/wiki/Probability-generating function.
Read more |