Skip to main content
Examonaut

Topic 7 · Lesson 2 of 3

Mean, variance, sums and linear functions

Mean and variance

Differentiate GX(t)=∑P(X=x)tx\text{G}_X(t) = \sum \text{P}(X = x)t^x:

GX′(t)=∑x P(X=x)tx−1GX′′(t)=∑x(x−1)P(X=x)tx−2\text{G}_X'(t) = \sum x\,\text{P}(X = x)t^{x-1} \qquad \text{G}_X''(t) = \sum x(x - 1)\text{P}(X = x)t^{x-2}

Putting t=1t = 1:

GX′(1)=E(X)GX′′(1)=E[X(X−1)]=E(X2)−E(X)\text{G}_X'(1) = \text{E}(X) \qquad \text{G}_X''(1) = \text{E}[X(X - 1)] = \text{E}(X^2) - \text{E}(X)

So

E(X)=GX′(1)Var(X)=GX′′(1)+GX′(1)−[GX′(1)]2\text{E}(X) = \text{G}_X'(1) \qquad \text{Var}(X) = \text{G}_X''(1) + \text{G}_X'(1) - [\text{G}_X'(1)]^2

Worked example

From a polynomial

For GX(t)=0.1+0.4t+0.3t2+0.2t3\text{G}_X(t) = 0.1 + 0.4t + 0.3t^2 + 0.2t^3:

Show solution
  1. GX′(t)=0.4+0.6t+0.6t2\text{G}_X'(t) = 0.4 + 0.6t + 0.6t^2, so E(X)=1.6\text{E}(X) = 1.6.
  2. GX′′(t)=0.6+1.2t\text{G}_X''(t) = 0.6 + 1.2t, so GX′′(1)=1.8\text{G}_X''(1) = 1.8.
  3. Var(X)=1.8+1.6−1.62=0.84\text{Var}(X) = 1.8 + 1.6 - 1.6^2 = 0.84.

Check: E(X2)=0.4+1.2+1.8=3.4\text{E}(X^2) = 0.4 + 1.2 + 1.8 = 3.4, and 3.4−2.56=0.843.4 - 2.56 = 0.84.

Worked example

The geometric variance

For G(t)=pt1−qt\text{G}(t) = \frac{pt}{1 - qt}, the quotient rule gives

Show solution
G′(t)=p(1−qt)+pqt(1−qt)2=p(1−qt)2G′′(t)=2pq(1−qt)3\text{G}'(t) = \frac{p(1 - qt) + pqt}{(1 - qt)^2} = \frac{p}{(1 - qt)^2} \qquad \text{G}''(t) = \frac{2pq}{(1 - qt)^3}

At t=1t = 1, using 1−q=p1 - q = p: G′(1)=1p\text{G}'(1) = \frac{1}{p} and G′′(1)=2qp2\text{G}''(1) = \frac{2q}{p^2}. So

Var(X)=2qp2+1p−1p2=2q+p−1p2=qp2\text{Var}(X) = \frac{2q}{p^2} + \frac{1}{p} - \frac{1}{p^2} = \frac{2q + p - 1}{p^2} = \frac{q}{p^2}

which is the familiar 1−pp2\frac{1 - p}{p^2}. The same method proves the means and variances of all the standard distributions.

Sums of independent variables

If XX and YY are independent, then

GX+Y(t)=E(tX+Y)=E(tX)E(tY)=GX(t)GY(t)\text{G}_{X+Y}(t) = \text{E}(t^{X+Y}) = \text{E}(t^X)\text{E}(t^Y) = \text{G}_X(t)\text{G}_Y(t)

(the expectation of a product of independent variables is the product of their expectations). This extends to any number of independent variables: the PGF of a sum is the product of the PGFs.

This gives quick proofs of results you have used:

  • If X∼Po(1.5)X \sim \text{Po}(1.5) and Y∼Po(2.5)Y \sim \text{Po}(2.5), then GX+Y(t)=e1.5(t−1)e2.5(t−1)=e4(t−1)\text{G}_{X+Y}(t) = e^{1.5(t-1)}e^{2.5(t-1)} = e^{4(t-1)}, so X+Y∼Po(4)X + Y \sim \text{Po}(4).
  • If XX is the number of heads on one coin, GX(t)=0.5+0.5t\text{G}_X(t) = 0.5 + 0.5t, and Y∼B(3,0.5)Y \sim \text{B}(3, 0.5) is independent, then GX+Y(t)=(0.5+0.5t)4\text{G}_{X+Y}(t) = (0.5 + 0.5t)^4, so X+Y∼B(4,0.5)X + Y \sim \text{B}(4, 0.5).
  • The total of rr independent Geo(p)\text{Geo}(p) variables has PGF (pt1−qt)r\left(\frac{pt}{1 - qt}\right)^r: it is NB(r,p)\text{NB}(r, p).

When the sum is not a standard distribution, you can still find its probabilities by multiplying out and reading off coefficients. For two independent scores each equally likely to be 1, 2 or 3, G(t)=13(t+t2+t3)\text{G}(t) = \frac{1}{3}(t + t^2 + t^3) and the total has PGF 19(t+t2+t3)2=19(t2+2t3+3t4+2t5+t6)\frac{1}{9}(t + t^2 + t^3)^2 = \frac{1}{9}(t^2 + 2t^3 + 3t^4 + 2t^5 + t^6), so a total of 4 has probability 39\frac{3}{9}.

To find the mean of a sum from its PGF, use the product rule when differentiating, or simply add the means: E(X+Y)=E(X)+E(Y)\text{E}(X + Y) = \text{E}(X) + \text{E}(Y).

Linear functions

For Y=aX+bY = aX + b,

GY(t)=E(taX+b)=tb E((ta)X)=tb GX(ta)\text{G}_Y(t) = \text{E}(t^{aX + b}) = t^b\,\text{E}\left((t^a)^X\right) = t^b\,\text{G}_X(t^a)

For example, if X∼Po(1)X \sim \text{Po}(1) and Y=2X+3Y = 2X + 3, then GY(t)=t3et2−1\text{G}_Y(t) = t^3e^{t^2 - 1}. Differentiating, GY′(t)=3t2et2−1+2t4et2−1\text{G}_Y'(t) = 3t^2e^{t^2 - 1} + 2t^4e^{t^2 - 1}, so E(Y)=3+2=5\text{E}(Y) = 3 + 2 = 5, which agrees with 2E(X)+32\text{E}(X) + 3.

Notice the difference: adding a constant multiplies the PGF by a power of tt, while multiplying XX by aa replaces tt by tat^a.

Practise this topic

Both are part of Premium.