4.5 - Probability generating functions

4.5 - Probability generating functions

A probability distribution can be stored in a single algebraic expression: the powers record the possible values, and the coefficients record their probabilities. You will construct these probability generating functions, derive the standard forms and recover probabilities without confusing a coefficient with a function value.

Encoding probabilities

How can one polynomial store both the possible values of a random variable and their probabilities? Suppose a count XX takes the values 0,1,30,1,3 with probabilities 0.2,0.5,0.30.2,0.5,0.3. Attach each probability to a power whose exponent is the corresponding value:

0.2t0+0.5t1+0.3t3=0.2+0.5t+0.3t3.0.2t^0+0.5t^1+0.3t^3=0.2+0.5t+0.3t^3.

The missing term in t2t^2 records P(X=2)=0\mathrm P(X=2)=0. The symbol tt is a variable used to organise the information; it is not an observation of XX.

Probability generating function

For a nonnegative integer-valued random variable XX, with pr=P(X=r)p_r=\mathrm P(X=r), its probability generating function, or PGF, is

GX(t)=E(tX)=∑r=0∞prtr.G_X(t)=\mathrm E(t^X)=\sum_{r=0}^{\infty}p_rt^r.

For finite support, the sum is a polynomial. A distribution on 1,2,3,…1,2,3,\ldots is included: its coefficient p0p_0 is zero.

The definition GX(t)=E(tX)G_X(t)=\mathrm E(t^X) is in the formula booklet.

A PGF uses integer powers starting at zero. A variable that can take negative values or arbitrary real values does not have a PGF in this sense. At t=0t=0, the constant term gives GX(0)=p0G_X(0)=p_0; here the constant monomial t0t^0 is interpreted as 11.

Worked example 1: a gap in the possible values

Question. The distribution of XX is given by

rr001133
P(X=r)\mathrm P(X=r)0.20.20.50.50.30.3

Find GX(t)G_X(t).

Plan. Make each value of XX an exponent, and use its probability as the coefficient.

GX(t)=∑rP(X=r)tr=0.2t0+0.5t+0.3t3=0.2+0.5t+0.3t3\begin{aligned} G_X(t)&=\sum_r \mathrm P(X=r)t^r \\ &=0.2t^0+0.5t+0.3t^3 \\ &=0.2+0.5t+0.3t^3 \end{aligned}

Answer. GX(t)=0.2+0.5t+0.3t3G_X(t)=0.2+0.5t+0.3t^3.

Check. The coefficients are nonnegative and add to 11. Also, GX(−1)=0.2−0.5−0.3=−0.6G_X(-1)=0.2-0.5-0.3=-0.6: this agrees with the even-value probability minus the odd-value probability, 0.2−0.80.2-0.8.

Now add one to every possible value. The probabilities stay fixed, so only the exponents change.

Worked example 2: shifting the count

Question. A random variable YY takes values 1,2,41,2,4 with probabilities 0.2,0.5,0.30.2,0.5,0.3, respectively. Find GY(t)G_Y(t), and relate it to the PGF in Worked example 1.

Plan. Encode the new values, then factor out the common power of tt.

GY(t)=0.2t+0.5t2+0.3t4=t(0.2+0.5t+0.3t3)=tGX(t)\begin{aligned} G_Y(t)&=0.2t+0.5t^2+0.3t^4 \\ &=t(0.2+0.5t+0.3t^3) \\ &=tG_X(t) \end{aligned}

Multiplying by tt shifts every exponent up by one, just as adding one shifts every outcome up by one.

Answer. GY(t)=0.2t+0.5t2+0.3t4=tGX(t)G_Y(t)=0.2t+0.5t^2+0.3t^4=tG_X(t).

Check. GY(0)=0G_Y(0)=0, matching the absence of a zero outcome. Its odd-value probability is 0.20.2 and its even-value probability is 0.80.8, so GY(−1)=0.8−0.2=0.6G_Y(-1)=0.8-0.2=0.6, as the polynomial gives.

The location of a coefficient matters as much as its value. Write zero coefficients mentally when there are gaps.

Watch out

The power is the value of the random variable, not the position of that value in a table. Values 0,2,50,2,5 require powers t0,t2,t5t^0,t^2,t^5, not t0,t1,t2t^0,t^1,t^2.

Construct a new PGF with two gaps in its support.

Standard distribution PGFs

Standard distributions lead to standard algebraic forms, because their probability formulae are already the coefficients of familiar series. Recall the probability mass functions for the binomial, geometric and Poisson distributions; these are supplied in the formula booklet.

Use a positive integer mm for a uniform distribution, a nonnegative integer nn and 0≤p≤10\le p\le1 for a binomial distribution, 0<p≤10<p\le1 for a geometric distribution, and λ>0\lambda>0 for a Poisson distribution.

For a discrete uniform variable on 1,2,…,m1,2,\ldots,m, each probability is 1/m1/m, so

GX(t)=t+t2+⋯+tmm=t(1−tm)m(1−t)(t≠1)\begin{aligned} G_X(t)&=\frac{t+t^2+\cdots+t^m}{m} \\ &=\frac{t(1-t^m)}{m(1-t)}\qquad (t\ne1) \end{aligned}

This is a finite geometric sum. At t=1t=1, use the polynomial to obtain GX(1)=1G_X(1)=1; the fraction has a removable gap there. If the uniform values are instead 0,1,…,m−10,1,\ldots,m-1, omit the leading factor tt.

For X∼B(n,p)X\sim\mathrm B(n,p), put q=1−pq=1-p. The binomial theorem gives

GX(t)=∑r=0n(nr)prqn−rtr=∑r=0n(nr)(pt)rqn−r=(q+pt)n\begin{aligned} G_X(t)&=\sum_{r=0}^{n}\binom nr p^rq^{n-r}t^r \\ &=\sum_{r=0}^{n}\binom nr (pt)^rq^{n-r} \\ &=(q+pt)^n \end{aligned}

For X∼Geo⁡(p)X\sim\operatorname{Geo}(p), XX counts the trial of the first success: its possible values are 1,2,…1,2,\ldots, and P(X=r)=pqr−1\mathrm P(X=r)=pq^{r-1}. Therefore

GX(t)=pt+pqt2+pq2t3+⋯=pt∑j=0∞(qt)j=pt1−qt(∣qt∣<1)\begin{aligned} G_X(t)&=pt+pq t^2+pq^2t^3+\cdots \\ &=pt\sum_{j=0}^{\infty}(qt)^j \\ &=\frac{pt}{1-qt}\qquad (|qt|<1) \end{aligned}

For 0<p<10<p<1, this convergence interval contains t=1t=1. If p=1p=1, X=1X=1 with certainty and GX(t)=tG_X(t)=t.

Finally, for X∼Po⁡(λ)X\sim\operatorname{Po}(\lambda), the exponential series gives

GX(t)=∑r=0∞e−λλrr!tr=e−λ∑r=0∞(λt)rr!=eλ(t−1)\begin{aligned} G_X(t)&=\sum_{r=0}^{\infty}\mathrm e^{-\lambda}\frac{\lambda^r}{r!}t^r \\ &=\mathrm e^{-\lambda}\sum_{r=0}^{\infty}\frac{(\lambda t)^r}{r!} \\ &=\mathrm e^{\lambda(t-1)} \end{aligned}

The exponential series converges for every real tt. For an infinite PGF in general, 0≤t≤10\le t\le1 is safe because the probability series converges there; a stated closed form may have a wider domain.

Standard PGFs

DistributionGX(t)Uniform on 1,…,m1m∑r=1mtrB(n,p)(1−p+pt)nGeo⁡(p) on 1,2,…pt1−(1−p)tPo⁡(λ)eλ(t−1)\begin{array}{c|c} \text{Distribution}&G_X(t)\\ \hline \text{Uniform on }1,\ldots,m&\displaystyle\frac1m\sum_{r=1}^{m}t^r\\[3pt] \mathrm B(n,p)&(1-p+pt)^n\\[3pt] \operatorname{Geo}(p)\text{ on }1,2,\ldots&\displaystyle\frac{pt}{1-(1-p)t}\\[6pt] \operatorname{Po}(\lambda)&\mathrm e^{\lambda(t-1)} \end{array}

The PGF forms are not listed in the formula booklet: derive them from the definition and the supplied probability formulae and series.

Continue this lesson.

You’re previewing NovaLearn without an account. Create a free account to read the rest.

Create free account