Definition:Probability Generating Function

Definition
Let $$X$$ be a discrete random variable whose codomain is a subset of $$\N = \left\{{0, 1, 2, \ldots}\right\}$$.

The probability generating function (p.g.f.) for (or of) $$X$$ is denoted $$\Pi_X \left({s}\right)$$ and defined as:
 * $$\Pi_X \left({s}\right) = E \left({s^X}\right)$$

where:
 * $$s$$ is a dummy variable;
 * $$E \left({s^X}\right)$$ is the expectation of $$s^x$$ for $$x \in X$$.

Hence we see that $$\Pi_X \left({s}\right)$$ is a generating function which can be defined as:
 * $$\Pi_X \left({s}\right) = \sum_{x \in \Omega_X} s^x p_X \left({x}\right)$$

where $$p_X$$ is the probability mass function of $$X$$.

Since $$p_X \left({x}\right)= 0$$ when $$x \notin \Omega_X$$, it can also be conveniently written:
 * $$\Pi_X \left({s}\right) = \sum_{x \ge 0} p_X \left({x}\right) s^x$$

So $$\Pi_X \left({s}\right)$$ is either a polynomial function or a power series in $$s$$ (or whatever dummy variable) whose coefficients are the probabilities $$p_X \left({x}\right)$$.

So, given any probability mass function, we can write down its p.g.f. by determining what the probabilities are of $$0, 1, 2, \ldots$$ and then writing down:
 * $$\Pi_X \left({s}\right) = p_X \left({0}\right) + p_X \left({1}\right) s + p_X \left({2}\right) s^2 + \cdots$$

Note that when it is understood what $$X$$ is, it is common to omit it from the notation:
 * $$\Pi \left({s}\right) = \sum_{x \ge 0} p \left({x}\right) s^x = p \left({0}\right) + p \left({1}\right) s + p \left({2}\right) s^2 + \cdots$$