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.

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]}

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

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

where p is the probability mass function of X. The power series converges absolutely at least for all complex vectors with

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.

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,* - It follows from Property 1 that if random variables
*X*and*Y*have probability-generating functions that are equal, , then . That is, if*X*and*Y*have identical probability-generating functions, then they have identical distributions. - The normalization of the probability mass function can be expressed in terms of the generating function by
- The expectation of is given by
- More generally, the
*k*^{th}factorial moment, of*X*is given by - So the variance of
*X*is given by - Finally, the
*k*^{th}raw moment of X is given by

- where
*X*is a random variable, is the probability generating function (of*X*) and is the moment-generating function (of*X*) .

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

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

- For example, if

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

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

- 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

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

- 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 . If the*X*_{1},*X*_{2}, ...,*X*_{N}are independent, but*not*identically distributed random variables, where denotes the probability generating function of , then

- 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}

- The probability generating function of an almost surely 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*. - So the probability generating function of a fair coin, is

- 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

- (Convergence for ).

- 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

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 can also be considered for continuous and other random variables.

This article needs additional citations for verification. Please help improve this article by adding citations to reliable sources. Unsourced material may be challenged and removed.Find sources: "Probability-generating function" – news · newspapers · books · scholar · JSTOR (April 2012) (Learn how and when to remove this message)