Skip to content

9231 · 4.5

Probability generating functions — practice questions

Practice and worked examples for 9231 Probability generating functions. Short previews only — attempt the full question in MarkScheme against the official scheme.

Worked example 1

A discrete random variable XX has the probability distribution given by P(X=1)=0.2P(X=1)=0.2, P(X=2)=0.5P(X=2)=0.5, and P(X=3)=0.3P(X=3)=0.3. Find the probability generating function of XX.

Show solution outline

By definition, GX(t)=P(X=x)txG_X(t) = \sum P(X=x)t^x. We sum over the possible values of XX: 1, 2, and 3. GX(t)=P(X=1)t1+P(X=2)t2+P(X=3)t3G_X(t) = P(X=1)t^1 + P(X=2)t^2 + P(X=3)t^3 Substituting the given probabilities: GX(t)=0.2t+0.5t2+0.3t3G_X(t) = 0.2t + 0.5t^2 + 0.3t^3 This is the PGF for the random variable XX. As a check, note that GX(1)=0.2(1)+0.5(1)2+0.3(1)3=0.2+0.5+0.3=1G_X(1) = 0.2(1) + 0.5(1)^2 + 0.3(1)^3 = 0.2+0.5+0.3 = 1.

Worked example 2

The number of defects in a length of cloth is a random variable XX with PGF given by GX(t)=(0.8+0.2t)5G_X(t) = (0.8 + 0.2t)^5. Find: (i) The probability of there being exactly 2 defects. (ii) The mean number of defects. (iii) The variance of the number of defects.

Show solution outline

(i) To find P(X=2)P(X=2), we need the coefficient of t2t^2 in the expansion of GX(t)=(0.8+0.2t)5G_X(t) = (0.8 + 0.2t)^5. This is a binomial expansion. The term in t2t^2 is given by (52)(0.8)52(0.2t)2\binom{5}{2}(0.8)^{5-2}(0.2t)^2. Coefficient = (52)(0.8)3(0.2)2=10×0.512×0.04=0.2048\binom{5}{2}(0.8)^3(0.2)^2 = 10 \times 0.512 \times 0.04 = 0.2048. So, P(X=2)=0.2048P(X=2) = 0.2048.

(ii) To find the mean, we need E(X)=GX(1)E(X) = G_X'(1). First, find the derivative: GX(t)=5(0.8+0.2t)4×0.2=(0.8+0.2t)4G_X'(t) = 5(0.8 + 0.2t)^4 \times 0.2 = (0.8 + 0.2t)^4. Now, substitute t=1t=1: GX(1)=(0.8+0.2(1))4=(1)4=1G_X'(1) = (0.8 + 0.2(1))^4 = (1)^4 = 1. So, the mean E(X)=1E(X) = 1.

(iii) To find the variance, we use Var(X)=GX(1)+GX(1)[GX(1)]2Var(X) = G_X''(1) + G_X'(1) - [G_X'(1)]^2. We already have GX(1)=1G_X'(1)=1. First, find the second derivative: GX(t)=ddt((0.8+0.2t)4)=4(0.8+0.2t)3×0.2=0.8(0.8+0.2t)3G_X''(t) = \frac{d}{dt}((0.8 + 0.2t)^4) = 4(0.8 + 0.2t)^3 \times 0.2 = 0.8(0.8 + 0.2t)^3. Now, substitute t=1t=1: GX(1)=0.8(0.8+0.2(1))3=0.8(1)3=0.8G_X''(1) = 0.8(0.8 + 0.2(1))^3 = 0.8(1)^3 = 0.8. Now, use the variance formula: Var(X)=GX(1)+GX(1)[GX(1)]2=0.8+1(1)2=0.8Var(X) = G_X''(1) + G_X'(1) - [G_X'(1)]^2 = 0.8 + 1 - (1)^2 = 0.8. So, the variance is 0.8. (Note: We could have recognised GX(t)G_X(t) as the PGF of XB(5,0.2)X \sim B(5, 0.2). Then E(X)=np=5(0.2)=1E(X)=np=5(0.2)=1 and $Var(X)=npq=5(0.2)(0.8)=0.8$, which confirms our results.)

Worked example 3

Let XPo(2)X \sim Po(2) and YPo(3)Y \sim Po(3) be two independent random variables. Let Z=X+YZ = X+Y. Use probability generating functions to find the distribution of ZZ.

Show solution outline

First, we recall the PGF for a Poisson distribution. If WPo(λ)W \sim Po(\lambda), its PGF is GW(t)=eλ(t1)G_W(t) = e^{\lambda(t-1)}.

For XPo(2)X \sim Po(2), the PGF is GX(t)=e2(t1)G_X(t) = e^{2(t-1)}. For YPo(3)Y \sim Po(3), the PGF is GY(t)=e3(t1)G_Y(t) = e^{3(t-1)}.

Since XX and YY are independent, the PGF of their sum Z=X+YZ=X+Y is the product of their individual PGFs: GZ(t)=GX(t)×GY(t)G_Z(t) = G_X(t) \times G_Y(t) GZ(t)=e2(t1)×e3(t1)G_Z(t) = e^{2(t-1)} \times e^{3(t-1)} Using the laws of indices: GZ(t)=e2(t1)+3(t1)G_Z(t) = e^{2(t-1) + 3(t-1)} GZ(t)=e(2+3)(t1)G_Z(t) = e^{(2+3)(t-1)} GZ(t)=e5(t1)G_Z(t) = e^{5(t-1)}

We recognise this resulting PGF, e5(t1)e^{5(t-1)}, as the PGF of a Poisson distribution with parameter λ=5\lambda = 5. Therefore, the distribution of ZZ is Poisson with a mean of 5. ZPo(5)Z \sim Po(5).