7. Appendix 83

with respect to y, and then set y = 1, we obtain the expression

∞

n=1

n

k=1

krn,kxn

,

which can be written as

∞

n=1

xn

n

k=1

krn,k .

Thus the mean of the distribution for sequences of length n is just

the coeﬃcient of xn in the above expression. The point is that we do

not need to use the formulas for rn,k to calculate the mean. Rather,

we use the closed-form expression for r(x, y, p), and apply the ideas

above to this expression.

If we perform these calculations, we obtain the expression

x

1 − x

+

2pqx3

(1 − x)2

+

2pqx2

1 − x

.

Using the facts that

1

1 − x

= 1 + x +

x2

+ . . .

and

1

(1 − x)2

= 1 + 2x +

3x2

+ . . . ,

in a suitable interval containing the origin, we can expand each of the

three summands above as series; they are, respectively,

x +

x2

+

x3

+ . . . ,

2pq(x3

+

2x4

+

3x5

+ . . .) ,

and

2pq(x2

+

x3

+

x4

+ . . .) .

Now we can easily write down the coeﬃcient of xn; it is

1 + 2pq(n − 2) + 2pq = 1 + 2pq(n − 1) ,

if n ≥ 2.

There is an easy way to check this. In fact, the calculation below

is an easier way to find the mean in this case, but the above method

can be used to find other moments (including the variance) and the