# Probability generating function

> Mediated Wiki article. Canonical URL: https://mediated.wiki/source/Probability_generating_function
> Markdown URL: https://mediated.wiki/source/Probability_generating_function.md
> Source: https://en.wikipedia.org/wiki/Probability_generating_function
> Source revision: 1350131165
> License: Creative Commons Attribution-ShareAlike 4.0 International (https://creativecommons.org/licenses/by-sa/4.0/)

{{Short description|Power series derived from a discrete probability distribution}}
In [probability theory](/source/probability_theory), the '''probability generating function''' of a [discrete random variable](/source/discrete_random_variable) is a [power series](/source/power_series) representation (the [generating function](/source/generating_function)) of the [probability mass function](/source/probability_mass_function) of the [random variable](/source/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](/source/probability_mass_function) for a [random variable](/source/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](/source/discrete_random_variable) taking values ''x'' in the non-negative [integer](/source/integer)s {0,1, ...}, then the ''probability generating function'' of ''X'' is defined as
<ref>{{ cite book | title = Probability and Distribution Theory | author = Gleb Gribakin | url = https://www.am.qub.ac.uk/users/g.gribakin/sor/Chap3.pdf }}</ref>

<math display="block">G(z) = \operatorname{E} (z^X) = \sum_{x=0}^{\infty} p(x) z^x,</math>
where <math>p</math> is the [probability mass function](/source/probability_mass_function) of <math>X</math>.  Note that the subscripted notations <math>G_X</math> and <math>p_X</math> are often used to emphasize that these pertain to a particular random variable <math>X</math>, and to its [distribution](/source/Probability_distribution). The power series [converges absolutely](/source/absolute_convergence) at least for all [complex number](/source/complex_number)s <math>z</math> with <math>|z|<1</math>; the radius of convergence being often larger.

=== Multivariate case ===
If {{math|1=''X'' = (''X''<sub>1</sub>,...,''X<sub>d</sub>'')}} is a discrete random variable taking values {{math|(''x''<sub>1</sub>, ..., ''x<sub>d</sub>'')}} in the {{mvar|d}}-dimensional non-negative [integer lattice](/source/integer_lattice) {{math|{0,1, ...}<sup>''d''</sup>}}, then the ''probability generating function'' of {{math|''X''}} is defined as
<math display="block">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 {{mvar|p}} is the probability mass function of {{mvar|X}}. The power series converges absolutely at least for all complex vectors <math>z = (z_1, ... z_d) \isin \mathbb{C}^d</math> with <math>\text{max}\{|z_1|, ..., |z_d|\} \le 1.</math>

==Properties==

===Power series===

Probability generating functions obey all the rules of power series with non-negative coefficients.  In particular, <math>G(1^-) = 1</math>, where <math>G(1^-) = \lim_{x\to 1, x<1} G(x)</math>, [x approaching 1 from below](/source/One-sided_limit), since the probabilities must sum to one. So the [radius of convergence](/source/radius_of_convergence) of any probability generating function must be at least 1, by [Abel's theorem](/source/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 <math>X</math>:
# The probability mass function of <math>X</math> is recovered by taking [derivative](/source/derivative)s of <math>G</math>, <math display="block">p(k) = \operatorname{Pr}(X = k) = \frac{G^{(k)}(0)}{k!}.</math>
# It follows from Property 1 that if random variables <math>X</math> and <math>Y</math> have probability generating functions that are equal, <math>G_X = G_Y</math>, then <math>p_X = p_Y</math>.  That is, if <math>X</math> and <math>Y</math> 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 <math display="block">\operatorname{E}[1] = G(1^-) = \sum_{i=0}^\infty p(i) = 1.</math> The [expectation](/source/expected_value) of <math>X</math> is given by <math display="block"> \operatorname{E}[X] = G'(1^-).</math> More generally, the <math>k^{th}</math>[factorial moment](/source/factorial_moment), <math>\operatorname{E}[X(X -  1) \cdots (X - k + 1)]</math> of <math>X</math> is given by <math display="block">\operatorname{E}\left[\frac{X!}{(X-k)!}\right] = G^{(k)}(1^-), \quad k \geq 0.</math> So the [variance](/source/variance) of <math>X</math> is given by <math display="block">\operatorname{Var}(X)=G''(1^-) + G'(1^-) - \left [G'(1^-)\right ]^2.</math> Finally, the {{mvar|k}}-th [raw moment](/source/raw_moment) of X is given by <math display="block">\operatorname{E}[X^k] = \left(z\frac{\partial}{\partial z}\right)^k G(z) \Big|_{z=1^-}</math>
# <math>G_X(e^t) = M_X(t)</math> where ''X'' is a random variable, <math>G_X(t)</math> is the probability generating function (of <math>X</math>) and <math>M_X(t)</math> is the [moment-generating function](/source/moment-generating_function) (of <math>X</math>).

===Functions of independent random variables===

Probability generating functions are particularly useful for dealing with functions of [independent](/source/statistical_independence) random variables. For example:

{{bullet list
| If <math>X_i, i=1,2,\cdots,N</math> is a sequence of independent (and not necessarily identically distributed) random variables that take on natural-number values, and
<math display="block">S_N = \sum_{i=1}^N a_i X_i,</math> where the <math>a_i</math> are constant natural numbers, then the probability generating function is given by
<math display="block">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>
| In particular, if <math>X</math> and <math>Y</math> are independent random variables:
<math display="block">G_{X+Y}(z) = G_X(z) \cdot G_Y(z)</math> and
<math display="block">G_{X-Y}(z) = G_X(z) \cdot G_Y(1/z).</math>
| In the above, the number <math>N</math> of independent random variables in the sequence is fixed. Assume <math>N</math> is discrete random variable taking values on the non-negative integers, which is independent of the <math>X_i</math>, and consider the probability generating function <math>G_N</math>.  If the <math>X_i</math> are not only independent but also identically distributed with common probability generating function <math>G_X = G_{X_i}</math>, then
<math display="block">G_{S_N}(z) = G_N(G_X(z)).</math> This can be seen, using the [law of total expectation](/source/law_of_total_expectation), as follows:
<math display="block">
\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&ndash;Watson process](/source/Galton%26ndash%3BWatson_process)es and [compound Poisson process](/source/compound_Poisson_process)es.
| When the <math>X_i</math> are not supposed identically distributed (but still independent and independent of <math>N</math>), we have
<math display="block">G_{S_N}(z) = \sum_{n \ge 1} f_n \prod_{i=1}^n G_{X_i}(z),</math> where <math>f_n = \Pr(N=n).</math> For identically distributed <math>X_i</math>s, this simplifies to the identity stated before, but the general case is sometimes useful to obtain a decomposition of <math>S_N</math> by means of generating functions.
}}

==Examples==

* The probability generating function of an almost surely [constant random variable](/source/degenerate_distribution), i.e. one with <math>\Pr(X=c) = 1</math> and <math>\Pr(X\neq c) = 0</math> is <math display="block">G(z) = z^c. </math>
* The probability generating function of a [binomial random variable](/source/binomial_distribution), the number of successes in <math>n</math> trials, with probability <math>p</math> of success in each trial, is <math display="block">G(z) = \left[(1-p) + pz\right]^n. </math> '''Note''': it is the <math>n</math>-fold product of the probability generating function of a [Bernoulli random variable](/source/Bernoulli_distribution) with parameter <math>p</math>. {{pb}}  So the probability generating function of a [fair coin](/source/fair_coin), is <math display="block">G(z) = \frac{1}{2} + \frac{z}{2}. </math>
* The probability generating function of a [negative binomial random variable](/source/negative_binomial_distribution) on <math>\{0,1,2 \cdots\}</math>, the number of failures until the <math>r^{th}</math> success with probability of success in each trial <math>p</math>, is <math display="block">G(z) = \left(\frac{p}{1 - (1-p)z}\right)^r,</math> which converges for <math>|z| < \frac{1}{1-p}</math>. {{pb}} '''Note''' that this is the <math>r</math>-fold product of the probability generating function of a [geometric random variable](/source/geometric_distribution) with parameter <math>1-p</math> on <math>\{0,1,2,\cdots\}</math>.
* The probability generating function of a [Poisson random variable](/source/Poisson_distribution) with rate parameter <math>\lambda</math> is <math display="block">G(z) = e^{\lambda(z - 1)}.</math>
<!--
TO BE COMPLETED:

==Joint probability generating functions==

The concept of the probability generating function for single random variables can be extended to the joint probability generating function of two or more random variables.

Suppose that ''X'' and ''Y'' are both discrete random variables (not necessarily independent or identically distributed), again taking values on some subset of the non-negative integers. -->

==Related concepts==

The probability generating function is an example of a [generating function](/source/generating_function) of a sequence: see also [formal power series](/source/formal_power_series). It is equivalent to, and sometimes called, the [z-transform](/source/z-transform) of the probability mass function.

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

{{more citations needed|date=April 2012}}

==Notes==
<references></references>

==References==
{{refbegin}}
* {{ cite book | last1 = Johnson | first1 = Norman Lloyd | last2 = Kotz | first2 = Samuel | last3 = Kemp | first3 = Adrienne W. |author3-link=Adrienne W. Kemp| title = Univariate Discrete Distributions | date = 1992 | publisher = J. Wiley & Sons | isbn = 978-0-471-54897-3 | edition = 2nd | series = Wiley series in probability and mathematical statistics | location = New York }}
{{refend}}

{{Theory of probability distributions}}

{{DEFAULTSORT:Probability Generating Function}}
Category:Functions related to probability distributions
Category:Generating functions

---
Adapted from the Wikipedia article [Probability generating function](https://en.wikipedia.org/wiki/Probability_generating_function) by Wikipedia contributors ([contributor history](https://en.wikipedia.org/wiki/Probability_generating_function?action=history)). Available under [Creative Commons Attribution-ShareAlike 4.0 International](https://creativecommons.org/licenses/by-sa/4.0/). Changes may have been made.
