text
stringlengths
1
7.76k
source
stringlengths
17
81
354 CHAPTER 9. CENTRAL LIMIT THEOREM Exercises 1 A die is rolled 24 times. Use the Central Limit Theorem to estimate the probability that (a) the sum is greater than 84. (b) the sum is equal to 84. 2 A random walker starts at 0 on the x-axis and at each time unit moves 1 step to the right or 1 step to the left with probability 1/2. Estimate the probability that, after 100 steps, the walker is more than 10 steps from the starting position. 3 A piece of rope is made up of 100 strands. Assume that the breaking strength of the rope is the sum of the breaking strengths of the individual strands. Assume further that this sum may be considered to be the sum of an inde- pendent trials process with 100 experiments each having expected value of 10 pounds and standard deviation 1. Find the approximate probability that the rope will support a weight (a) of 1000 pounds. (b) of 970 pounds. 4 Write a program to find the average of 1000 random digits 0, 1, 2, 3, 4, 5, 6, 7, 8, or 9. Have the program test to see if the average lies within three standard deviations of the expected value of 4.5. Modify the program so that it repeats this simulation 1000 times and keeps track of the number of times the test is passed. Does your outcome agree with the Central Limit Theorem? 5 A die is thrown until the first time the total sum of the face values of the die is 700 or greater. Estimate the probability that, for this to happen, (a) more than 210 tosses are required. (b) less than 190 tosses are required. (c) between 180 and 210 tosses, inclusive, are required. 6 A bank accepts rolls of pennies and gives 50 cents credit to a customer without counting the contents. Assume that a roll contains 49 pennies 30 percent of the time, 50 pennies 60 percent of the time, and 51 pennies 10 percent of the time. (a) Find the expected value and the variance for the amount that the bank loses on a typical roll. (b) Estimate the probability that the bank will lose more than 25 cents in 100 rolls. (c) Estimate the probability that the bank will lose exactly 25 cents in 100 rolls.
prob_Page_362_Chunk5201
9.2. DISCRETE INDEPENDENT TRIALS 355 (d) Estimate the probability that the bank will lose any money in 100 rolls. (e) How many rolls does the bank need to collect to have a 99 percent chance of a net loss? 7 A surveying instrument makes an error of −2, −1, 0, 1, or 2 feet with equal probabilities when measuring the height of a 200-foot tower. (a) Find the expected value and the variance for the height obtained using this instrument once. (b) Estimate the probability that in 18 independent measurements of this tower, the average of the measurements is between 199 and 201, inclusive. 8 For Example 9.6 estimate P(S30 = 0). That is, estimate the probability that the errors cancel out and the student’s grade point average is correct. 9 Prove the Law of Large Numbers using the Central Limit Theorem. 10 Peter and Paul match pennies 10,000 times. Describe briefly what each of the following theorems tells you about Peter’s fortune. (a) The Law of Large Numbers. (b) The Central Limit Theorem. 11 A tourist in Las Vegas was attracted by a certain gambling game in which the customer stakes 1 dollar on each play; a win then pays the customer 2 dollars plus the return of her stake, although a loss costs her only her stake. Las Vegas insiders, and alert students of probability theory, know that the probability of winning at this game is 1/4. When driven from the tables by hunger, the tourist had played this game 240 times. Assuming that no near miracles happened, about how much poorer was the tourist upon leaving the casino? What is the probability that she lost no money? 12 We have seen that, in playing roulette at Monte Carlo (Example 6.13), betting 1 dollar on red or 1 dollar on 17 amounts to choosing between the distributions mX =  −1 −1/2 1 18/37 1/37 18/37  or mX =  −1 35 36/37 1/37  You plan to choose one of these methods and use it to make 100 1-dollar bets using the method chosen. Using the Central Limit Theorem, estimate the probability of winning any money for each of the two games. Compare your estimates with the actual probabilities, which can be shown, from exact calculations, to equal .437 and .509 to three decimal places. 13 In Example 9.6 find the largest value of p that gives probability .954 that the first decimal place is correct.
prob_Page_363_Chunk5202
356 CHAPTER 9. CENTRAL LIMIT THEOREM 14 It has been suggested that Example 9.6 is unrealistic, in the sense that the probabilities of errors are too low. Make up your own (reasonable) estimate for the distribution m(x), and determine the probability that a student’s grade point average is accurate to within .05. Also determine the probability that it is accurate to within .5. 15 Find a sequence of uniformly bounded discrete independent random variables {Xn} such that the variance of their sum does not tend to ∞as n →∞, and such that their sum is not asymptotically normally distributed. 9.3 Central Limit Theorem for Continuous Inde- pendent Trials We have seen in Section 9.2 that the distribution function for the sum of a large number n of independent discrete random variables with mean µ and variance σ2 tends to look like a normal density with mean nµ and variance nσ2. What is remarkable about this result is that it holds for any distribution with finite mean and variance. We shall see in this section that the same result also holds true for continuous random variables having a common density function. Let us begin by looking at some examples to see whether such a result is even plausible. Standardized Sums Example 9.7 Suppose we choose n random numbers from the interval [0, 1] with uniform density. Let X1, X2, . . . , Xn denote these choices, and Sn = X1 + X2 + · · · + Xn their sum. We saw in Example 7.9 that the density function for Sn tends to have a normal shape, but is centered at n/2 and is flattened out. In order to compare the shapes of these density functions for different values of n, we proceed as in the previous section: we standardize Sn by defining S∗ n = Sn −nµ √nσ . Then we see that for all n we have E(S∗ n) = 0 , V (S∗ n) = 1 . The density function for S∗ n is just a standardized version of the density function for Sn (see Figure 9.13). 2 Example 9.8 Let us do the same thing, but now choose numbers from the interval [0, +∞) with an exponential density with parameter λ. Then (see Example 6.26)
prob_Page_364_Chunk5203
9.3. CONTINUOUS INDEPENDENT TRIALS 357 -3 -2 -1 1 2 3 0.1 0.2 0.3 0.4 n = 2 n = 3 n = 4 n = 10 Figure 9.13: Density function for S∗ n (uniform case, n = 2, 3, 4, 10). µ = E(Xi) = 1 λ , σ2 = V (Xj) = 1 λ2 . Here we know the density function for Sn explicitly (see Section 7.2). We can use Corollary 5.1 to calculate the density function for S∗ n. We obtain fSn(x) = λe−λx(λx)n−1 (n −1)! , fS∗ n(x) = √n λ fSn √nx + n λ  . The graph of the density function for S∗ n is shown in Figure 9.14. 2 These examples make it seem plausible that the density function for the nor- malized random variable S∗ n for large n will look very much like the normal density with mean 0 and variance 1 in the continuous case as well as in the discrete case. The Central Limit Theorem makes this statement precise. Central Limit Theorem Theorem 9.6 (Central Limit Theorem) Let Sn = X1 + X2 + · · · + Xn be the sum of n independent continuous random variables with common density function p having expected value µ and variance σ2. Let S∗ n = (Sn −nµ)/√nσ. Then we have,
prob_Page_365_Chunk5204
358 CHAPTER 9. CENTRAL LIMIT THEOREM -4 -2 2 0.1 0.2 0.3 0.4 0.5 n = 2 n = 3 n = 10 n = 30 Figure 9.14: Density function for S∗ n (exponential case, n = 2, 3, 10, 30, λ = 1). for all a < b, lim n→∞P(a < S∗ n < b) = 1 √ 2π Z b a e−x2/2 dx . 2 We shall give a proof of this theorem in Section 10.3. We will now look at some examples. Example 9.9 Suppose a surveyor wants to measure a known distance, say of 1 mile, using a transit and some method of triangulation. He knows that because of possible motion of the transit, atmospheric distortions, and human error, any one measure- ment is apt to be slightly in error. He plans to make several measurements and take an average. He assumes that his measurements are independent random variables with a common distribution of mean µ = 1 and standard deviation σ = .0002 (so, if the errors are approximately normally distributed, then his measurements are within 1 foot of the correct distance about 65% of the time). What can he say about the average? He can say that if n is large, the average Sn/n has a density function that is approximately normal, with mean µ = 1 mile, and standard deviation σ = .0002/√n miles. How many measurements should he make to be reasonably sure that his average lies within .0001 of the true value? The Chebyshev inequality says P  Sn n −µ ≥.0001  ≤(.0002)2 n(10−8) = 4 n , so that we must have n ≥80 before the probability that his error is less than .0001 exceeds .95.
prob_Page_366_Chunk5205
9.3. CONTINUOUS INDEPENDENT TRIALS 359 We have already noticed that the estimate in the Chebyshev inequality is not always a good one, and here is a case in point. If we assume that n is large enough so that the density for Sn is approximately normal, then we have P  Sn n −µ < .0001  = P
prob_Page_367_Chunk5206
360 CHAPTER 9. CENTRAL LIMIT THEOREM Sample Mean If he knows the variance σ2 of the error distribution is .0002, then he can estimate the mean µ by taking the average, or sample mean of, say, 36 measurements: ¯µ = x1 + x2 + · · · + xn n , where n = 36. Then, as before, E(¯µ) = µ. Moreover, the preceding argument shows that P(|¯µ −µ| < .0002) ≈.997 . The interval (¯µ −.0002, ¯µ+ .0002) is called the 99.7% confidence interval for µ (see Example 9.4). Sample Variance If he does not know the variance σ2 of the error distribution, then he can estimate σ2 by the sample variance: ¯σ2 = (x1 −¯µ)2 + (x2 −¯µ)2 + · · · + (xn −¯µ)2 n , where n = 36. The Law of Large Numbers, applied to the random variables (Xi − ¯µ)2, says that for large n, the sample variance ¯σ2 lies close to the variance σ2, so that the surveyor can use ¯σ2 in place of σ2 in the argument above. Experience has shown that, in most practical problems of this type, the sample variance is a good estimate for the variance, and can be used in place of the variance to determine confidence levels for the sample mean. This means that we can rely on the Law of Large Numbers for estimating the variance, and the Central Limit Theorem for estimating the mean. We can check this in some special cases. Suppose we know that the error distri- bution is normal, with unknown mean and variance. Then we can take a sample of n measurements, find the sample mean ¯µ and sample variance ¯σ2, and form T ∗ n = Sn −n¯µ √n¯σ , where n = 36. We expect T ∗ n to be a good approximation for S∗ n for large n. t-Density The statistician W. S. Gosset13 has shown that in this case T ∗ n has a density function that is not normal but rather a t-density with n degrees of freedom. (The number n of degrees of freedom is simply a parameter which tells us which t-density to use.) In this case we can use the t-density in place of the normal density to determine confidence levels for µ. As n increases, the t-density approaches the normal density. Indeed, even for n = 8 the t-density and normal density are practically the same (see Figure 9.15). 13W. S. Gosset discovered the distribution we now call the t-distribution while working for the Guinness Brewery in Dublin. He wrote under the pseudonym “Student.” The results discussed here first appeared in Student, “The Probable Error of a Mean,” Biometrika, vol. 6 (1908), pp. 1-24.
prob_Page_368_Chunk5207
9.3. CONTINUOUS INDEPENDENT TRIALS 361 -6 -4 -2 2 4 6 0.1 0.2 0.3 0.4 Figure 9.15: Graph of t−density for n = 1, 3, 8 and the normal density with µ = 0, σ = 1. Exercises Notes on computer problems: (a) Simulation: Recall (see Corollary 5.2) that X = F −1(rnd) will simulate a random variable with density f(x) and distribution F(X) = Z x −∞ f(t) dt . In the case that f(x) is a normal density function with mean µ and standard deviation σ, where neither F nor F −1 can be expressed in closed form, use instead X = σ p −2 log(rnd) cos 2π(rnd) + µ . (b) Bar graphs: you should aim for about 20 to 30 bars (of equal width) in your graph. You can achieve this by a good choice of the range [xmin, xmin] and the number of bars (for instance, [µ −3σ, µ + 3σ] with 30 bars will work in many cases). Experiment! 1 Let X be a continuous random variable with mean µ(X) and variance σ2(X), and let X∗= (X −µ)/σ be its standardized version. Verify directly that µ(X∗) = 0 and σ2(X∗) = 1.
prob_Page_369_Chunk5208
362 CHAPTER 9. CENTRAL LIMIT THEOREM 2 Let {Xk}, 1 ≤k ≤n, be a sequence of independent random variables, all with mean 0 and variance 1, and let Sn, S∗ n, and An be their sum, standardized sum, and average, respectively. Verify directly that S∗ n = Sn/√n = √nAn. 3 Let {Xk}, 1 ≤k ≤n, be a sequence of random variables, all with mean µ and variance σ2, and Yk = X∗ k be their standardized versions. Let Sn and Tn be the sum of the Xk and Yk, and S∗ n and T ∗ n their standardized version. Show that S∗ n = T ∗ n = Tn/√n. 4 Suppose we choose independently 25 numbers at random (uniform density) from the interval [0, 20]. Write the normal densities that approximate the densities of their sum S25, their standardized sum S∗ 25, and their average A25. 5 Write a program to choose independently 25 numbers at random from [0, 20], compute their sum S25, and repeat this experiment 1000 times. Make a bar graph for the density of S25 and compare it with the normal approximation of Exercise 4. How good is the fit? Now do the same for the standardized sum S∗ 25 and the average A25. 6 In general, the Central Limit Theorem gives a better estimate than Cheby- shev’s inequality for the average of a sum. To see this, let A25 be the average calculated in Exercise 5, and let N be the normal approximation for A25. Modify your program in Exercise 5 to provide a table of the function F(x) = P(|A25 −10| ≥x) = fraction of the total of 1000 trials for which |A25 −10| ≥x. Do the same for the function f(x) = P(|N −10| ≥x). (You can use the normal table, Table 9.4, or the procedure NormalArea for this.) Now plot on the same axes the graphs of F(x), f(x), and the Chebyshev function g(x) = 4/(3x2). How do f(x) and g(x) compare as estimates for F(x)? 7 The Central Limit Theorem says the sums of independent random variables tend to look normal, no matter what crazy distribution the individual variables have. Let us test this by a computer simulation. Choose independently 25 numbers from the interval [0, 1] with the probability density f(x) given below, and compute their sum S25. Repeat this experiment 1000 times, and make up a bar graph of the results. Now plot on the same graph the density φ(x) = normal (x, µ(S25), σ(S25)). How well does the normal density fit your bar graph in each case? (a) f(x) = 1. (b) f(x) = 2x. (c) f(x) = 3x2. (d) f(x) = 4|x −1/2|. (e) f(x) = 2 −4|x −1/2|. 8 Repeat the experiment described in Exercise 7 but now choose the 25 numbers from [0, ∞), using f(x) = e−x.
prob_Page_370_Chunk5209
9.3. CONTINUOUS INDEPENDENT TRIALS 363 9 How large must n be before Sn = X1+X2+· · ·+Xn is approximately normal? This number is often surprisingly small. Let us explore this question with a computer simulation. Choose n numbers from [0, 1] with probability density f(x), where n = 3, 6, 12, 20, and f(x) is each of the densities in Exercise 7. Compute their sum Sn, repeat this experiment 1000 times, and make up a bar graph of 20 bars of the results. How large must n be before you get a good fit? 10 A surveyor is measuring the height of a cliffknown to be about 1000 feet. He assumes his instrument is properly calibrated and that his measurement errors are independent, with mean µ = 0 and variance σ2 = 10. He plans to take n measurements and form the average. Estimate, using (a) Chebyshev’s inequality and (b) the normal approximation, how large n should be if he wants to be 95 percent sure that his average falls within 1 foot of the true value. Now estimate, using (a) and (b), what value should σ2 have if he wants to make only 10 measurements with the same confidence? 11 The price of one share of stock in the PilsdorffBeer Company (see Exer- cise 8.2.12) is given by Yn on the nth day of the year. Finn observes that the differences Xn = Yn+1 −Yn appear to be independent random variables with a common distribution having mean µ = 0 and variance σ2 = 1/4. If Y1 = 100, estimate the probability that Y365 is (a) ≥100. (b) ≥110. (c) ≥120. 12 Test your conclusions in Exercise 11 by computer simulation. First choose 364 numbers Xi with density f(x) = normal(x, 0, 1/4). Now form the sum Y365 = 100 + X1 + X2 + · · · + X364, and repeat this experiment 200 times. Make up a bar graph on [50, 150] of the results, superimposing the graph of the approximating normal density. What does this graph say about your answers in Exercise 11? 13 Physicists say that particles in a long tube are constantly moving back and forth along the tube, each with a velocity Vk (in cm/sec) at any given moment that is normally distributed, with mean µ = 0 and variance σ2 = 1. Suppose there are 1020 particles in the tube. (a) Find the mean and variance of the average velocity of the particles. (b) What is the probability that the average velocity is ≥10−9 cm/sec? 14 An astronomer makes n measurements of the distance between Jupiter and a particular one of its moons. Experience with the instruments used leads her to believe that for the proper units the measurements will be normally
prob_Page_371_Chunk5210
364 CHAPTER 9. CENTRAL LIMIT THEOREM distributed with mean d, the true distance, and variance 16. She performs a series of n measurements. Let An = X1 + X2 + · · · + Xn n be the average of these measurements. (a) Show that P  An − 8 √n ≤d ≤An + 8 √n  ≈.95. (b) When nine measurements were taken, the average of the distances turned out to be 23.2 units. Putting the observed values in (a) gives the 95 per- cent confidence interval for the unknown distance d. Compute this in- terval. (c) Why not say in (b) more simply that the probability is .95 that the value of d lies in the computed confidence interval? (d) What changes would you make in the above procedure if you wanted to compute a 99 percent confidence interval? 15 Plot a bar graph similar to that in Figure 9.10 for the heights of the mid- parents in Galton’s data as given in Appendix B and compare this bar graph to the appropriate normal curve.
prob_Page_372_Chunk5211
Chapter 10 Generating Functions 10.1 Generating Functions for Discrete Distribu- tions So far we have considered in detail only the two most important attributes of a random variable, namely, the mean and the variance. We have seen how these attributes enter into the fundamental limit theorems of probability, as well as into all sorts of practical calculations. We have seen that the mean and variance of a random variable contain important information about the random variable, or, more precisely, about the distribution function of that variable. Now we shall see that the mean and variance do not contain all the available information about the density function of a random variable. To begin with, it is easy to give examples of different distribution functions which have the same mean and the same variance. For instance, suppose X and Y are random variables, with distributions pX =  1 2 3 4 5 6 0 1/4 1/2 0 0 1/4  , pY =  1 2 3 4 5 6 1/4 0 0 1/2 1/4 0  . Then with these choices, we have E(X) = E(Y ) = 7/2 and V (X) = V (Y ) = 9/4, and yet certainly pX and pY are quite different density functions. This raises a question: If X is a random variable with range {x1, x2, . . .} of at most countable size, and distribution function p = pX, and if we know its mean µ = E(X) and its variance σ2 = V (X), then what else do we need to know to determine p completely? Moments A nice answer to this question, at least in the case that X has finite range, can be given in terms of the moments of X, which are numbers defined as follows: 365
prob_Page_373_Chunk5212
366 CHAPTER 10. GENERATING FUNCTIONS µk = kth moment of X = E(Xk) = ∞ X j=1 (xj)kp(xj) , provided the sum converges. Here p(xj) = P(X = xj). In terms of these moments, the mean µ and variance σ2 of X are given simply by µ = µ1, σ2 = µ2 −µ2 1 , so that a knowledge of the first two moments of X gives us its mean and variance. But a knowledge of all the moments of X determines its distribution function p completely. Moment Generating Functions To see how this comes about, we introduce a new variable t, and define a function g(t) as follows: g(t) = E(etX) = ∞ X k=0 µktk k! = E ∞ X k=0 Xktk k! ! = ∞ X j=1 etxjp(xj) . We call g(t) the moment generating function for X, and think of it as a convenient bookkeeping device for describing the moments of X. Indeed, if we differentiate g(t) n times and then set t = 0, we get µn: dn dtn g(t) t=0 = g(n)(0) = ∞ X k=n k! µktk−n (k −n)! k! t=0 = µn . It is easy to calculate the moment generating function for simple examples.
prob_Page_374_Chunk5213
10.1. DISCRETE DISTRIBUTIONS 367 Examples Example 10.1 Suppose X has range {1, 2, 3, . . ., n} and pX(j) = 1/n for 1 ≤j ≤n (uniform distribution). Then g(t) = n X j=1 1 netj = 1 n(et + e2t + · · · + ent) = et(ent −1) n(et −1) . If we use the expression on the right-hand side of the second line above, then it is easy to see that µ1 = g′(0) = 1 n(1 + 2 + 3 + · · · + n) = n + 1 2 , µ2 = g′′(0) = 1 n(1 + 4 + 9 + · · · + n2) = (n + 1)(2n + 1) 6 , and that µ = µ1 = (n + 1)/2 and σ2 = µ2 −µ2 1 = (n2 −1)/12. 2 Example 10.2 Suppose now that X has range {0, 1, 2, 3, . . ., n} and pX(j) =
prob_Page_375_Chunk5214
368 CHAPTER 10. GENERATING FUNCTIONS Here µ1 = g′(0) = pet (1 −qet)2 t=0 = 1 p , µ2 = g′′(0) = pet + pqe2t (1 −qet)3 t=0 = 1 + q p2 , µ = µ1 = 1/p, and σ2 = µ2 −µ2 1 = q/p2, as computed in Example 6.26. 2 Example 10.4 Let X have range {0, 1, 2, 3, . . .} and let pX(j) = e−λλj/j! for all j (Poisson distribution with mean λ). Then g(t) = ∞ X j=0 etj e−λλj j! = e−λ ∞ X j=0 (λet)j j! = e−λeλet = eλ(et−1) . Then µ1 = g′(0) = eλ(et−1)λet t=0 = λ , µ2 = g′′(0) = eλ(et−1)(λ2e2t + λet) t=0 = λ2 + λ , µ = µ1 = λ, and σ2 = µ2 −µ2 1 = λ. The variance of the Poisson distribution is easier to obtain in this way than directly from the definition (as was done in Exercise 6.2.29). 2 Moment Problem Using the moment generating function, we can now show, at least in the case of a discrete random variable with finite range, that its distribution function is com- pletely determined by its moments. Theorem 10.1 Let X be a discrete random variable with finite range {x1, x2, . . . , xn}, distribution function p, and moment generating function g. Then g is uniquely determined by p, and conversely. Proof. We know that p determines g, since g(t) = n X j=1 etxjp(xj) . Conversely, assume that g(t) is known. We wish to determine the values of xj and p(xj), for 1 ≤j ≤n. We assume, without loss of generality, that p(xj) > 0 for 1 ≤j ≤n, and that x1 < x2 < . . . < xn .
prob_Page_376_Chunk5215
10.1. DISCRETE DISTRIBUTIONS 369 We note that g(t) is differentiable for all t, since it is a finite linear combination of exponential functions. If we compute g′(t)/g(t), we obtain x1p(x1)etx1 + . . . + xnp(xn)etxn p(x1)etx1 + . . . + p(xn)etxn . Dividing both top and bottom by etxn, we obtain the expression x1p(x1)et(x1−xn) + . . . + xnp(xn) p(x1)et(x1−xn) + . . . + p(xn) . Since xn is the largest of the xj’s, this expression approaches xn as t goes to ∞. So we have shown that xn = lim t→∞ g′(t) g(t) . To find p(xn), we simply divide g(t) by etxn and let t go to ∞. Once xn and p(xn) have been determined, we can subtract p(xn)etxn from g(t), and repeat the above procedure with the resulting function, obtaining, in turn, xn−1, . . . , x1 and p(xn−1), . . . , p(x1). 2 If we delete the hypothesis that X have finite range in the above theorem, then the conclusion is no longer necessarily true. Ordinary Generating Functions In the special but important case where the xj are all nonnegative integers, xj = j, we can prove this theorem in a simpler way. In this case, we have g(t) = n X j=0 etjp(j) , and we see that g(t) is a polynomial in et. If we write z = et, and define the function h by h(z) = n X j=0 zjp(j) , then h(z) is a polynomial in z containing the same information as g(t), and in fact h(z) = g(log z) , g(t) = h(et) . The function h(z) is often called the ordinary generating function for X. Note that h(1) = g(0) = 1, h′(1) = g′(0) = µ1, and h′′(1) = g′′(0)−g′(0) = µ2 −µ1. It follows from all this that if we know g(t), then we know h(z), and if we know h(z), then we can find the p(j) by Taylor’s formula: p(j) = coefficient of zj in h(z) = h(j)(0) j! .
prob_Page_377_Chunk5216
370 CHAPTER 10. GENERATING FUNCTIONS For example, suppose we know that the moments of a certain discrete random variable X are given by µ0 = 1 , µk = 1 2 + 2k 4 , for k ≥1 . Then the moment generating function g of X is g(t) = ∞ X k=0 µktk k! = 1 + 1 2 ∞ X k=1 tk k! + 1 4 ∞ X k=1 (2t)k k! = 1 4 + 1 2et + 1 4e2t . This is a polynomial in z = et, and h(z) = 1 4 + 1 2z + 1 4z2 . Hence, X must have range {0, 1, 2}, and p must have values {1/4, 1/2, 1/4}. Properties Both the moment generating function g and the ordinary generating function h have many properties useful in the study of random variables, of which we can consider only a few here. In particular, if X is any discrete random variable and Y = X + a, then gY (t) = E(etY ) = E(et(X+a)) = etaE(etX) = etagX(t) , while if Y = bX, then gY (t) = E(etY ) = E(etbX) = gX(bt) . In particular, if X∗= X −µ σ , then (see Exercise 11) gx∗(t) = e−µt/σgX  t σ  .
prob_Page_378_Chunk5217
10.1. DISCRETE DISTRIBUTIONS 371 If X and Y are independent random variables and Z = X + Y is their sum, with pX, pY , and pZ the associated distribution functions, then we have seen in Chapter 7 that pZ is the convolution of pX and pY , and we know that convolution involves a rather complicated calculation. But for the generating functions we have instead the simple relations gZ(t) = gX(t)gY (t) , hZ(z) = hX(z)hY (z) , that is, gZ is simply the product of gX and gY , and similarly for hZ. To see this, first note that if X and Y are independent, then etX and etY are independent (see Exercise 5.2.38), and hence E(etXetY ) = E(etX)E(etY ) . It follows that gZ(t) = E(etZ) = E(et(X+Y )) = E(etX)E(etY ) = gX(t)gY (t) , and, replacing t by log z, we also get hZ(z) = hX(z)hY (z) . Example 10.5 If X and Y are independent discrete random variables with range {0, 1, 2, . . ., n} and binomial distribution pX(j) = pY (j) = n j  pjqn−j , and if Z = X + Y , then we know (cf. Section 7.1) that the range of X is {0, 1, 2, . . ., 2n} and X has binomial distribution pZ(j) = (pX ∗pY )(j) = 2n j  pjq2n−j . Here we can easily verify this result by using generating functions. We know that gX(t) = gY (t) = n X j=0 etj n j  pjqn−j = (pet + q)n , and hX(z) = hY (z) = (pz + q)n .
prob_Page_379_Chunk5218
372 CHAPTER 10. GENERATING FUNCTIONS Hence, we have gZ(t) = gX(t)gY (t) = (pet + q)2n , or, what is the same, hZ(z) = hX(z)hY (z) = (pz + q)2n = 2n X j=0 2n j  (pz)jq2n−j , from which we can see that the coefficient of zj is just pZ(j) =
prob_Page_380_Chunk5219
10.1. DISCRETE DISTRIBUTIONS 373 Then the Xk are independent random variables describing a Bernoulli process. Let S0 = 0, and, for n ≥1, let Sn = X1 + X2 + · · · + Xn . Then Sn describes Peter’s fortune after n trials, and Peter is first in the lead after n trials if Sk ≤0 for 1 ≤k < n and Sn = 1. Now this can happen when n = 1, in which case S1 = X1 = 1, or when n > 1, in which case S1 = X1 = −1. In the latter case, Sk = 0 for k = n −1, and perhaps for other k between 1 and n. Let m be the least such value of k; then Sm = 0 and Sk < 0 for 1 ≤k < m. In this case Peter loses on the first trial, regains his initial position in the next m −1 trials, and gains the lead in the next n −m trials. Let p be the probability that the coin comes up heads, and let q = 1 −p. Let rn be the probability that Peter is first in the lead after n trials. Then from the discussion above, we see that rn = 0 , if n even, r1 = p (= probability of heads in a single toss), rn = q(r1rn−2 + r3rn−4 + · · · + rn−2r1) , if n > 1, n odd. Now let T describe the time (that is, the number of trials) required for Peter to take the lead. Then T is a random variable, and since P(T = n) = rn, r is the distribution function for T. We introduce the generating function hT (z) for T: hT (z) = ∞ X n=0 rnzn . Then, by using the relations above, we can verify the relation hT (z) = pz + qz(hT(z))2 . If we solve this quadratic equation for hT (z), we get hT (z) = 1 ± p 1 −4pqz2 2qz = 2pz 1 ∓ p 1 −4pqz2 . Of these two solutions, we want the one that has a convergent power series in z (i.e., that is finite for z = 0). Hence we choose hT (z) = 1 − p 1 −4pqz2 2qz = 2pz 1 + p 1 −4pqz2 . Now we can ask: What is the probability that Peter is ever in the lead? This probability is given by (see Exercise 10) ∞ X n=0 rn = hT (1) = 1 − p 1 −4pq 2q = 1 −|p −q| 2q =  p/q, if p < q, 1, if p ≥q,
prob_Page_381_Chunk5220
374 CHAPTER 10. GENERATING FUNCTIONS so that Peter is sure to be in the lead eventually if p ≥q. How long will it take? That is, what is the expected value of T? This value is given by E(T) = h′ T (1) =  1/(p −q), if p > q, ∞, if p = q. This says that if p > q, then Peter can expect to be in the lead by about 1/(p −q) trials, but if p = q, he can expect to wait a long time. A related problem, known as the Gambler’s Ruin problem, is studied in Exer- cise 23 and in Section 12.2. 2 Exercises 1 Find the generating functions, both ordinary h(z) and moment g(t), for the following discrete probability distributions. (a) The distribution describing a fair coin. (b) The distribution describing a fair die. (c) The distribution describing a die that always comes up 3. (d) The uniform distribution on the set {n, n + 1, n + 2, . . . , n + k}. (e) The binomial distribution on {n, n + 1, n + 2, . . . , n + k}. (f) The geometric distribution on {0, 1, 2, . . ., } with p(j) = 2/3j+1. 2 For each of the distributions (a) through (d) of Exercise 1 calculate the first and second moments, µ1 and µ2, directly from their definition, and verify that h(1) = 1, h′(1) = µ1, and h′′(1) = µ2 −µ1. 3 Let p be a probability distribution on {0, 1, 2} with moments µ1 = 1, µ2 = 3/2. (a) Find its ordinary generating function h(z). (b) Using (a), find its moment generating function. (c) Using (b), find its first six moments. (d) Using (a), find p0, p1, and p2. 4 In Exercise 3, the probability distribution is completely determined by its first two moments. Show that this is always true for any probability distribution on {0, 1, 2}. Hint: Given µ1 and µ2, find h(z) as in Exercise 3 and use h(z) to determine p. 5 Let p and p′ be the two distributions p =  1 2 3 4 5 1/3 0 0 2/3 0  , p′ =  1 2 3 4 5 0 2/3 0 0 1/3  .
prob_Page_382_Chunk5221
10.1. DISCRETE DISTRIBUTIONS 375 (a) Show that p and p′ have the same first and second moments, but not the same third and fourth moments. (b) Find the ordinary and moment generating functions for p and p′. 6 Let p be the probability distribution p =  0 1 2 0 1/3 2/3  , and let pn = p ∗p ∗· · · ∗p be the n-fold convolution of p with itself. (a) Find p2 by direct calculation (see Definition 7.1). (b) Find the ordinary generating functions h(z) and h2(z) for p and p2, and verify that h2(z) = (h(z))2. (c) Find hn(z) from h(z). (d) Find the first two moments, and hence the mean and variance, of pn from hn(z). Verify that the mean of pn is n times the mean of p. (e) Find those integers j for which pn(j) > 0 from hn(z). 7 Let X be a discrete random variable with values in {0, 1, 2, . . ., n} and moment generating function g(t). Find, in terms of g(t), the generating functions for (a) −X. (b) X + 1. (c) 3X. (d) aX + b. 8 Let X1, X2, . . . , Xn be an independent trials process, with values in {0, 1} and mean µ = 1/3. Find the ordinary and moment generating functions for the distribution of (a) S1 = X1. Hint: First find X1 explicitly. (b) S2 = X1 + X2. (c) Sn = X1 + X2 + · · · + Xn. 9 Let X and Y be random variables with values in {1, 2, 3, 4, 5, 6} with distri- bution functions pX and pY given by pX(j) = aj , pY (j) = bj . (a) Find the ordinary generating functions hX(z) and hY (z) for these distri- butions. (b) Find the ordinary generating function hZ(z) for the distribution Z = X + Y .
prob_Page_383_Chunk5222
376 CHAPTER 10. GENERATING FUNCTIONS (c) Show that hZ(z) cannot ever have the form hZ(z) = z2 + z3 + · · · + z12 11 . Hint: hX and hY must have at least one nonzero root, but hZ(z) in the form given has no nonzero real roots. It follows from this observation that there is no way to load two dice so that the probability that a given sum will turn up when they are tossed is the same for all sums (i.e., that all outcomes are equally likely). 10 Show that if h(z) = 1 − p 1 −4pqz2 2qz , then h(1) =  p/q, if p ≤q, 1, if p ≥q, and h′(1) =  1/(p −q), if p > q, ∞, if p = q. 11 Show that if X is a random variable with mean µ and variance σ2, and if X∗= (X −µ)/σ is the standardized version of X, then gX∗(t) = e−µt/σgX  t σ  . 10.2 Branching Processes Historical Background In this section we apply the theory of generating functions to the study of an important chance process called a branching process. Until recently it was thought that the theory of branching processes originated with the following problem posed by Francis Galton in the Educational Times in 1873.1 Problem 4001: A large nation, of whom we will only concern ourselves with the adult males, N in number, and who each bear separate sur- names, colonise a district. Their law of population is such that, in each generation, a0 per cent of the adult males have no male children who reach adult life; a1 have one such male child; a2 have two; and so on up to a5 who have five. Find (1) what proportion of the surnames will have become extinct after r generations; and (2) how many instances there will be of the same surname being held by m persons. 1D. G. Kendall, “Branching Processes Since 1873,” Journal of London Mathematics Society, vol. 41 (1966), p. 386.
prob_Page_384_Chunk5223
10.2. BRANCHING PROCESSES 377 The first attempt at a solution was given by Reverend H. W. Watson. Because of a mistake in algebra, he incorrectly concluded that a family name would always die out with probability 1. However, the methods that he employed to solve the problems were, and still are, the basis for obtaining the correct solution. Heyde and Seneta discovered an earlier communication by Bienaym´e (1845) that anticipated Galton and Watson by 28 years. Bienaym´e showed, in fact, that he was aware of the correct solution to Galton’s problem. Heyde and Seneta in their book I. J. Bienaym´e: Statistical Theory Anticipated,2 give the following translation from Bienaym´e’s paper: If . . . the mean of the number of male children who replace the number of males of the preceding generation were less than unity, it would be easily realized that families are dying out due to the disappearance of the members of which they are composed. However, the analysis shows further that when this mean is equal to unity families tend to disappear, although less rapidly . . . . The analysis also shows clearly that if the mean ratio is greater than unity, the probability of the extinction of families with the passing of time no longer reduces to certainty. It only approaches a finite limit, which is fairly simple to calculate and which has the singular charac- teristic of being given by one of the roots of the equation (in which the number of generations is made infinite) which is not relevant to the question when the mean ratio is less than unity.3 Although Bienaym´e does not give his reasoning for these results, he did indicate that he intended to publish a special paper on the problem. The paper was never written, or at least has never been found. In his communication Bienaym´e indicated that he was motivated by the same problem that occurred to Galton. The opening paragraph of his paper as translated by Heyde and Seneta says, A great deal of consideration has been given to the possible multipli- cation of the numbers of mankind; and recently various very curious observations have been published on the fate which allegedly hangs over the aristocrary and middle classes; the families of famous men, etc. This fate, it is alleged, will inevitably bring about the disappearance of the so-called families ferm´ees.4 A much more extensive discussion of the history of branching processes may be found in two papers by David G. Kendall.5 2C. C. Heyde and E. Seneta, I. J. Bienaym´e: Statistical Theory Anticipated (New York: Springer Verlag, 1977). 3ibid., pp. 117–118. 4ibid., p. 118. 5D. G. Kendall, “Branching Processes Since 1873,” pp. 385–406; and “The Genealogy of Ge- nealogy: Branching Processes Before (and After) 1873,” Bulletin London Mathematics Society, vol. 7 (1975), pp. 225–253.
prob_Page_385_Chunk5224
378 CHAPTER 10. GENERATING FUNCTIONS 2 1 0 1/4 1/4 1/4 1/4 1/4 1/4 1/2 1/16 1/8 5/16 1/2 4 3 2 1 0 0 1 2 1/64 1/32 5/64 1/8 1/16 1/16 1/16 1/16 1/2 Figure 10.1: Tree diagram for Example 10.8. Branching processes have served not only as crude models for population growth but also as models for certain physical processes such as chemical and nuclear chain reactions. Problem of Extinction We turn now to the first problem posed by Galton (i.e., the problem of finding the probability of extinction for a branching process). We start in the 0th generation with 1 male parent. In the first generation we shall have 0, 1, 2, 3, . . . male offspring with probabilities p0, p1, p2, p3, . . . . If in the first generation there are k offspring, then in the second generation there will be X1 + X2 + · · · + Xk offspring, where X1, X2, . . . , Xk are independent random variables, each with the common distribution p0, p1, p2, . . . . This description enables us to construct a tree, and a tree measure, for any number of generations. Examples Example 10.8 Assume that p0 = 1/2, p1 = 1/4, and p2 = 1/4. Then the tree measure for the first two generations is shown in Figure 10.1. Note that we use the theory of sums of independent random variables to assign branch probabilities. For example, if there are two offspring in the first generation, the probability that there will be two in the second generation is P(X1 + X2 = 2) = p0p2 + p1p1 + p2p0 = 1 2 · 1 4 + 1 4 · 1 4 + 1 4 · 1 2 = 5 16 . We now study the probability that our process dies out (i.e., that at some generation there are no offspring).
prob_Page_386_Chunk5225
10.2. BRANCHING PROCESSES 379 Let dm be the probability that the process dies out by the mth generation. Of course, d0 = 0. In our example, d1 = 1/2 and d2 = 1/2 + 1/8 + 1/16 = 11/16 (see Figure 10.1). Note that we must add the probabilities for all paths that lead to 0 by the mth generation. It is clear from the definition that 0 = d0 ≤d1 ≤d2 ≤· · · ≤1 . Hence, dm converges to a limit d, 0 ≤d ≤1, and d is the probability that the process will ultimately die out. It is this value that we wish to determine. We begin by expressing the value dm in terms of all possible outcomes on the first generation. If there are j offspring in the first generation, then to die out by the mth generation, each of these lines must die out in m −1 generations. Since they proceed independently, this probability is (dm−1)j. Therefore dm = p0 + p1dm−1 + p2(dm−1)2 + p3(dm−1)3 + · · · . (10.1) Let h(z) be the ordinary generating function for the pi: h(z) = p0 + p1z + p2z2 + · · · . Using this generating function, we can rewrite Equation 10.1 in the form dm = h(dm−1) . (10.2) Since dm →d, by Equation 10.2 we see that the value d that we are looking for satisfies the equation d = h(d) . (10.3) One solution of this equation is always d = 1, since 1 = p0 + p1 + p2 + · · · . This is where Watson made his mistake. He assumed that 1 was the only solution to Equation 10.3. To examine this question more carefully, we first note that solutions to Equation 10.3 represent intersections of the graphs of y = z and y = h(z) = p0 + p1z + p2z2 + · · · . Thus we need to study the graph of y = h(z). We note that h(0) = p0. Also, h′(z) = p1 + 2p2z + 3p3z2 + · · · , (10.4) and h′′(z) = 2p2 + 3 · 2p3z + 4 · 3p4z2 + · · · . From this we see that for z ≥0, h′(z) ≥0 and h′′(z) ≥0. Thus for nonnegative z, h(z) is an increasing function and is concave upward. Therefore the graph of
prob_Page_387_Chunk5226
380 CHAPTER 10. GENERATING FUNCTIONS 1 1 1 1 1 1 0 0 0 0 0 y z d > 1 d < 1 d = 1 0 y = z y y z z y = h (z) 1 1 (a) (c) (b) Figure 10.2: Graphs of y = z and y = h(z). y = h(z) can intersect the line y = z in at most two points. Since we know it must intersect the line y = z at (1, 1), we know that there are just three possibilities, as shown in Figure 10.2. In case (a) the equation d = h(d) has roots {d, 1} with 0 ≤d < 1. In the second case (b) it has only the one root d = 1. In case (c) it has two roots {1, d} where 1 < d. Since we are looking for a solution 0 ≤d ≤1, we see in cases (b) and (c) that our only solution is 1. In these cases we can conclude that the process will die out with probability 1. However in case (a) we are in doubt. We must study this case more carefully. From Equation 10.4 we see that h′(1) = p1 + 2p2 + 3p3 + · · · = m , where m is the expected number of offspring produced by a single parent. In case (a) we have h′(1) > 1, in (b) h′(1) = 1, and in (c) h′(1) < 1. Thus our three cases correspond to m > 1, m = 1, and m < 1. We assume now that m > 1. Recall that d0 = 0, d1 = h(d0) = p0, d2 = h(d1), . . . , and dn = h(dn−1). We can construct these values geometrically, as shown in Figure 10.3. We can see geometrically, as indicated for d0, d1, d2, and d3 in Figure 10.3, that the points (di, h(di)) will always lie above the line y = z. Hence, they must converge to the first intersection of the curves y = z and y = h(z) (i.e., to the root d < 1). This leads us to the following theorem. 2 Theorem 10.2 Consider a branching process with generating function h(z) for the number of offspring of a given parent. Let d be the smallest root of the equation z = h(z). If the mean number m of offspring produced by a single parent is ≤1, then d = 1 and the process dies out with probability 1. If m > 1 then d < 1 and the process dies out with probability d. 2 We shall often want to know the probability that a branching process dies out by a particular generation, as well as the limit of these probabilities. Let dn be
prob_Page_388_Chunk5227
10.2. BRANCHING PROCESSES 381 y = z y = h(z) y z 1 p0 0 d = 0 1 d d d d 1 2 3 Figure 10.3: Geometric determination of d. the probability of dying out by the nth generation. Then we know that d1 = p0. We know further that dn = h(dn−1) where h(z) is the generating function for the number of offspring produced by a single parent. This makes it easy to compute these probabilities. The program Branch calculates the values of dn. We have run this program for 12 generations for the case that a parent can produce at most two offspring and the probabilities for the number produced are p0 = .2, p1 = .5, and p2 = .3. The results are given in Table 10.1. We see that the probability of dying out by 12 generations is about .6. We shall see in the next example that the probability of eventually dying out is 2/3, so that even 12 generations is not enough to give an accurate estimate for this probability. We now assume that at most two offspring can be produced. Then h(z) = p0 + p1z + p2z2 . In this simple case the condition z = h(z) yields the equation d = p0 + p1d + p2d2 , which is satisfied by d = 1 and d = p0/p2. Thus, in addition to the root d = 1 we have the second root d = p0/p2. The mean number m of offspring produced by a single parent is m = p1 + 2p2 = 1 −p0 −p2 + 2p2 = 1 −p0 + p2 . Thus, if p0 > p2, m < 1 and the second root is > 1. If p0 = p2, we have a double root d = 1. If p0 < p2, m > 1 and the second root d is less than 1 and represents the probability that the process will die out.
prob_Page_389_Chunk5228
382 CHAPTER 10. GENERATING FUNCTIONS Generation Probability of dying out 1 .2 2 .312 3 .385203 4 .437116 5 .475879 6 .505878 7 .529713 8 .549035 9 .564949 10 .578225 11 .589416 12 .598931 Table 10.1: Probability of dying out. p0 = .2092 p1 = .2584 p2 = .2360 p3 = .1593 p4 = .0828 p5 = .0357 p6 = .0133 p7 = .0042 p8 = .0011 p9 = .0002 p10 = .0000 Table 10.2: Distribution of number of female children. Example 10.9 Keyfitz6 compiled and analyzed data on the continuation of the female family line among Japanese women. His estimates at the basic probability distribution for the number of female children born to Japanese women of ages 45–49 in 1960 are given in Table 10.2. The expected number of girls in a family is then 1.837 so the probability d of extinction is less than 1. If we run the program Branch, we can estimate that d is in fact only about .324. 2 Distribution of Offspring So far we have considered only the first of the two problems raised by Galton, namely the probability of extinction. We now consider the second problem, that is, the distribution of the number Zn of offspring in the nth generation. The exact form of the distribution is not known except in very special cases. We shall see, 6N. Keyfitz, Introduction to the Mathematics of Population, rev. ed. (Reading, PA: Addison Wesley, 1977).
prob_Page_390_Chunk5229
10.2. BRANCHING PROCESSES 383 however, that we can describe the limiting behavior of Zn as n →∞. We first show that the generating function hn(z) of the distribution of Zn can be obtained from h(z) for any branching process. We recall that the value of the generating function at the value z for any random variable X can be written as h(z) = E(zX) = p0 + p1z + p2z2 + · · · . That is, h(z) is the expected value of an experiment which has outcome zj with probability pj. Let Sn = X1 + X2 + · · · + Xn where each Xj has the same integer-valued distribution (pj) with generating function k(z) = p0 + p1z + p2z2 + · · · . Let kn(z) be the generating function of Sn. Then using one of the properties of ordinary generating functions discussed in Section 10.1, we have kn(z) = (k(z))n , since the Xj’s are independent and all have the same distribution. Consider now the branching process Zn. Let hn(z) be the generating function of Zn. Then hn+1(z) = E(zZn+1) = X k E(zZn+1|Zn = k)P(Zn = k) . If Zn = k, then Zn+1 = X1 + X2 + · · ·+ Xk where X1, X2, . . . , Xk are independent random variables with common generating function h(z). Thus E(zZn+1|Zn = k) = E(zX1+X2+···+Xk) = (h(z))k , and hn+1(z) = X k (h(z))kP(Zn = k) . But hn(z) = X k P(Zn = k)zk . Thus, hn+1(z) = hn(h(z)) . (10.5) If we differentiate Equation 10.5 and use the chain rule we have h′ n+1(z) = h′ n(h(z))h′(z). Putting z = 1 and using the fact that h(1) = 1, h′(1) = m, and h′ n(1) = mn = the mean number of offspring in the n’th generation, we have mn+1 = mn · m . Thus, m2 = m · m = m2, m3 = m2 · m = m3, and in general mn = mn . Thus, for a branching process with m > 1, the mean number of offspring grows exponentially at a rate m.
prob_Page_391_Chunk5230
384 CHAPTER 10. GENERATING FUNCTIONS Examples Example 10.10 For the branching process of Example 10.8 we have h(z) = 1/2 + (1/4)z + (1/4)z2 , h2(z) = h(h(z)) = 1/2 + (1/4)[1/2 + (1/4)z + (1/4)z2] = +(1/4)[1/2 + (1/4)z + (1/4)z2]2 = 11/16 + (1/8)z + (9/64)z2 + (1/32)z3 + (1/64)z4 . The probabilities for the number of offspring in the second generation agree with those obtained directly from the tree measure (see Figure 1). 2 It is clear that even in the simple case of at most two offspring, we cannot easily carry out the calculation of hn(z) by this method. However, there is one special case in which this can be done. Example 10.11 Assume that the probabilities p1, p2, . . . form a geometric series: pk = bck−1, k = 1, 2, . . . , with 0 < b ≤1 −c and 0 < c < 1. Then we have p0 = 1 −p1 −p2 −· · · = 1 −b −bc −bc2 −· · · = 1 − b 1 −c . The generating function h(z) for this distribution is h(z) = p0 + p1z + p2z2 + · · · = 1 − b 1 −c + bz + bcz2 + bc2z3 + · · · = 1 − b 1 −c + bz 1 −cz . From this we find h′(z) = bcz (1 −cz)2 + b 1 −cz = b (1 −cz)2 and m = h′(1) = b (1 −c)2 . We know that if m ≤1 the process will surely die out and d = 1. To find the probability d when m > 1 we must find a root d < 1 of the equation z = h(z) , or z = 1 − b 1 −c + bz 1 −cz .
prob_Page_392_Chunk5231
10.2. BRANCHING PROCESSES 385 This leads us to a quadratic equation. We know that z = 1 is one solution. The other is found to be d = 1 −b −c c(1 −c) . It is easy to verify that d < 1 just when m > 1. It is possible in this case to find the distribution of Zn. This is done by first finding the generating function hn(z).7 The result for m ̸= 1 is: hn(z) = 1 −mn  1 −d mn −d  + mn h 1−d mn−d i2 z 1 − h mn−1 mn−d i z . The coefficients of the powers of z give the distribution for Zn: P(Zn = 0) = 1 −mn 1 −d mn −d = d(mn −1) mn −d and P(Zn = j) = mn 1 −d mn −d 2 · mn −1 mn −d j−1 , for j ≥1. 2 Example 10.12 Let us re-examine the Keyfitz data to see if a distribution of the type considered in Example 10.11 could reasonably be used as a model for this population. We would have to estimate from the data the parameters b and c for the formula pk = bck−1. Recall that m = b (1 −c)2 (10.6) and the probability d that the process dies out is d = 1 −b −c c(1 −c) . (10.7) Solving Equation 10.6 and 10.7 for b and c gives c = m −1 m −d and b = m  1 −d m −d 2 . We shall use the value 1.837 for m and .324 for d that we found in the Keyfitz example. Using these values, we obtain b = .3666 and c = .5533. Note that (1 −c)2 < b < 1 −c, as required. In Table 10.3 we give for comparison the probabilities p0 through p8 as calculated by the geometric distribution versus the empirical values. 7T. E. Harris, The Theory of Branching Processes (Berlin: Springer, 1963), p. 9.
prob_Page_393_Chunk5232
386 CHAPTER 10. GENERATING FUNCTIONS Geometric pj Data Model 0 .2092 .1816 1 .2584 .3666 2 .2360 .2028 3 .1593 .1122 4 .0828 .0621 5 .0357 .0344 6 .0133 .0190 7 .0042 .0105 8 .0011 .0058 9 .0002 .0032 10 .0000 .0018 Table 10.3: Comparison of observed and expected frequencies. The geometric model tends to favor the larger numbers of offspring but is similar enough to show that this modified geometric distribution might be appropriate to use for studies of this kind. Recall that if Sn = X1 + X2 + · · · + Xn is the sum of independent random variables with the same distribution then the Law of Large Numbers states that Sn/n converges to a constant, namely E(X1). It is natural to ask if there is a similar limiting theorem for branching processes. Consider a branching process with Zn representing the number of offspring after n generations. Then we have seen that the expected value of Zn is mn. Thus we can scale the random variable Zn to have expected value 1 by considering the random variable Wn = Zn mn . In the theory of branching processes it is proved that this random variable Wn will tend to a limit as n tends to infinity. However, unlike the case of the Law of Large Numbers where this limit is a constant, for a branching process the limiting value of the random variables Wn is itself a random variable. Although we cannot prove this theorem here we can illustrate it by simulation. This requires a little care. When a branching process survives, the number of offspring is apt to get very large. If in a given generation there are 1000 offspring, the offspring of the next generation are the result of 1000 chance events, and it will take a while to simulate these 1000 experiments. However, since the final result is the sum of 1000 independent experiments we can use the Central Limit Theorem to replace these 1000 experiments by a single experiment with normal density having the appropriate mean and variance. The program BranchingSimulation carries out this process. We have run this program for the Keyfitz example, carrying out 10 simulations and graphing the results in Figure 10.4. The expected number of female offspring per female is 1.837, so that we are graphing the outcome for the random variables Wn = Zn/(1.837)n. For three of
prob_Page_394_Chunk5233
10.2. BRANCHING PROCESSES 387 5 10 15 20 25 0.5 1 1.5 2 2.5 3 Figure 10.4: Simulation of Zn/mn for the Keyfitz example. the simulations the process died out, which is consistent with the value d = .3 that we found for this example. For the other seven simulations the value of Wn tends to a limiting value which is different for each simulation. 2 Example 10.13 We now examine the random variable Zn more closely for the case m < 1 (see Example 10.11). Fix a value t > 0; let [tmn] be the integer part of tmn. Then P(Zn = [tmn]) = mn( 1 −d mn −d)2(mn −1 mn −d)[tmn]−1 = 1 mn ( 1 −d 1 −d/mn )2(1 −1/mn 1 −d/mn )tmn+a , where |a| ≤2. Thus, as n →∞, mnP(Zn = [tmn]) →(1 −d)2 e−t e−td = (1 −d)2e−t(1−d) . For t = 0, P(Zn = 0) →d . We can compare this result with the Central Limit Theorem for sums Sn of integer- valued independent random variables (see Theorem 9.3), which states that if t is an integer and u = (t −nµ)/ √ σ2n, then as n →∞, √ σ2n P(Sn = u √ σ2n + µn) → 1 √ 2π e−u2/2 . We see that the form of these statements are quite similar. It is possible to prove a limit theorem for a general class of branching processes that states that under
prob_Page_395_Chunk5234
388 CHAPTER 10. GENERATING FUNCTIONS suitable hypotheses, as n →∞, mnP(Zn = [tmn]) →k(t) , for t > 0, and P(Zn = 0) →d . However, unlike the Central Limit Theorem for sums of independent random vari- ables, the function k(t) will depend upon the basic distribution that determines the process. Its form is known for only a very few examples similar to the one we have considered here. 2 Chain Letter Problem Example 10.14 An interesting example of a branching process was suggested by Free Huizinga.8 In 1978, a chain letter called the “Circle of Gold,” believed to have started in California, found its way across the country to the theater district of New York. The chain required a participant to buy a letter containing a list of 12 names for 100 dollars. The buyer gives 50 dollars to the person from whom the letter was purchased and then sends 50 dollars to the person whose name is at the top of the list. The buyer then crosses offthe name at the top of the list and adds her own name at the bottom in each letter before it is sold again. Let us first assume that the buyer may sell the letter only to a single person. If you buy the letter you will want to compute your expected winnings. (We are ignoring here the fact that the passing on of chain letters through the mail is a federal offense with certain obvious resulting penalties.) Assume that each person involved has a probability p of selling the letter. Then you will receive 50 dollars with probability p and another 50 dollars if the letter is sold to 12 people, since then your name would have risen to the top of the list. This occurs with probability p12, and so your expected winnings are −100 + 50p + 50p12. Thus the chain in this situation is a highly unfavorable game. It would be more reasonable to allow each person involved to make a copy of the list and try to sell the letter to at least 2 other people. Then you would have a chance of recovering your 100 dollars on these sales, and if any of the letters is sold 12 times you will receive a bonus of 50 dollars for each of these cases. We can consider this as a branching process with 12 generations. The members of the first generation are the letters you sell. The second generation consists of the letters sold by members of the first generation, and so forth. Let us assume that the probabilities that each individual sells letters to 0, 1, or 2 others are p0, p1, and p2, respectively. Let Z1, Z2, . . . , Z12 be the number of letters in the first 12 generations of this branching process. Then your expected winnings are 50(E(Z1) + E(Z12)) = 50m + 50m12 , 8Private communication.
prob_Page_396_Chunk5235
10.2. BRANCHING PROCESSES 389 where m = p1+2p2 is the expected number of letters you sold. Thus to be favorable we just have 50m + 50m12 > 100 , or m + m12 > 2 . But this will be true if and only if m > 1. We have seen that this will occur in the quadratic case if and only if p2 > p0. Let us assume for example that p0 = .2, p1 = .5, and p2 = .3. Then m = 1.1 and the chain would be a favorable game. Your expected profit would be 50(1.1 + 1.112) −100 ≈112 . The probability that you receive at least one payment from the 12th generation is 1−d12. We find from our program Branch that d12 = .599. Thus, 1−d12 = .401 is the probability that you receive some bonus. The maximum that you could receive from the chain would be 50(2 + 212) = 204,900 if everyone were to successfully sell two letters. Of course you can not always expect to be so lucky. (What is the probability of this happening?) To simulate this game, we need only simulate a branching process for 12 gen- erations. Using a slightly modified version of our program BranchingSimulation we carried out twenty such simulations, giving the results shown in Table 10.4. Note that we were quite lucky on a few runs, but we came out ahead only a little less than half the time. The process died out by the twelfth generation in 12 out of the 20 experiments, in good agreement with the probability d12 = .599 that we calculated using the program Branch. Let us modify the assumptions about our chain letter to let the buyer sell the letter to as many people as she can instead of to a maximum of two. We shall assume, in fact, that a person has a large number N of acquaintances and a small probability p of persuading any one of them to buy the letter. Then the distribution for the number of letters that she sells will be a binomial distribution with mean m = Np. Since N is large and p is small, we can assume that the probability pj that an individual sells the letter to j people is given by the Poisson distribution pj = e−mmj j! .
prob_Page_397_Chunk5236
390 CHAPTER 10. GENERATING FUNCTIONS Z1 Z2 Z3 Z4 Z5 Z6 Z7 Z8 Z9 Z10 Z11 Z12 Profit 1 0 0 0 0 0 0 0 0 0 0 0 -50 1 1 2 3 2 3 2 1 2 3 3 6 250 0 0 0 0 0 0 0 0 0 0 0 0 -100 2 4 4 2 3 4 4 3 2 2 1 1 50 1 2 3 5 4 3 3 3 5 8 6 6 250 0 0 0 0 0 0 0 0 0 0 0 0 -100 2 3 2 2 2 1 2 3 3 3 4 6 300 1 2 1 1 1 1 2 1 0 0 0 0 -50 0 0 0 0 0 0 0 0 0 0 0 0 -100 1 0 0 0 0 0 0 0 0 0 0 0 -50 2 3 2 3 3 3 5 9 12 12 13 15 750 1 1 1 0 0 0 0 0 0 0 0 0 -50 1 2 2 3 3 0 0 0 0 0 0 0 -50 1 1 1 1 2 2 3 4 4 6 4 5 200 1 1 0 0 0 0 0 0 0 0 0 0 -50 1 0 0 0 0 0 0 0 0 0 0 0 -50 1 0 0 0 0 0 0 0 0 0 0 0 -50 1 1 2 3 3 4 2 3 3 3 3 2 50 1 2 4 6 6 9 10 13 16 17 15 18 850 1 0 0 0 0 0 0 0 0 0 0 0 -50 Table 10.4: Simulation of chain letter (finite distribution case).
prob_Page_398_Chunk5237
10.2. BRANCHING PROCESSES 391 Z1 Z2 Z3 Z4 Z5 Z6 Z7 Z8 Z9 Z10 Z11 Z12 Profit 1 2 6 7 7 8 11 9 7 6 6 5 200 1 0 0 0 0 0 0 0 0 0 0 0 -50 1 0 0 0 0 0 0 0 0 0 0 0 -50 1 1 1 0 0 0 0 0 0 0 0 0 -50 0 0 0 0 0 0 0 0 0 0 0 0 -100 1 1 1 1 1 1 2 4 9 7 9 7 300 2 3 3 4 2 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 -50 2 1 0 0 0 0 0 0 0 0 0 0 0 3 3 4 7 11 17 14 11 11 10 16 25 1300 0 0 0 0 0 0 0 0 0 0 0 0 -100 1 2 2 1 1 3 1 0 0 0 0 0 -50 0 0 0 0 0 0 0 0 0 0 0 0 -100 2 3 1 0 0 0 0 0 0 0 0 0 0 3 1 0 0 0 0 0 0 0 0 0 0 50 1 0 0 0 0 0 0 0 0 0 0 0 -50 3 4 4 7 10 11 9 11 12 14 13 10 550 1 3 3 4 9 5 7 9 8 8 6 3 100 1 0 4 6 6 9 10 13 0 0 0 0 -50 1 0 0 0 0 0 0 0 0 0 0 0 -50 Table 10.5: Simulation of chain letter (Poisson case). The generating function for the Poisson distribution is h(z) = ∞ X j=0 e−mmjzj j! = e−m ∞ X j=0 mjzj j! = e−memz = em(z−1) . The expected number of letters that an individual passes on is m, and again to be favorable we must have m > 1. Let us assume again that m = 1.1. Then we can find again the probability 1 −d12 of a bonus from Branch. The result is .232. Although the expected winnings are the same, the variance is larger in this case, and the buyer has a better chance for a reasonably large profit. We again carried out 20 simulations using the Poisson distribution with mean 1.1. The results are shown in Table 10.5. We note that, as before, we came out ahead less than half the time, but we also had one large profit. In only 6 of the 20 cases did we receive any profit. This is again in reasonable agreement with our calculation of a probability .232 for this happening. 2
prob_Page_399_Chunk5238
392 CHAPTER 10. GENERATING FUNCTIONS Exercises 1 Let Z1, Z2, . . . , ZN describe a branching process in which each parent has j offspring with probability pj. Find the probability d that the process even- tually dies out if (a) p0 = 1/2, p1 = 1/4, and p2 = 1/4. (b) p0 = 1/3, p1 = 1/3, and p2 = 1/3. (c) p0 = 1/3, p1 = 0, and p2 = 2/3. (d) pj = 1/2j+1, for j = 0, 1, 2, . . . . (e) pj = (1/3)(2/3)j, for j = 0, 1, 2, . . . . (f) pj = e−22j/j!, for j = 0, 1, 2, . . . (estimate d numerically). 2 Let Z1, Z2, . . . , ZN describe a branching process in which each parent has j offspring with probability pj. Find the probability d that the process dies out if (a) p0 = 1/2, p1 = p2 = 0, and p3 = 1/2. (b) p0 = p1 = p2 = p3 = 1/4. (c) p0 = t, p1 = 1 −2t, p2 = 0, and p3 = t, where t ≤1/2. 3 In the chain letter problem (see Example 10.14) find your expected profit if (a) p0 = 1/2, p1 = 0, and p2 = 1/2. (b) p0 = 1/6, p1 = 1/2, and p2 = 1/3. Show that if p0 > 1/2, you cannot expect to make a profit. 4 Let SN = X1 + X2 + · · · + XN, where the Xi’s are independent random variables with common distribution having generating function f(z). Assume that N is an integer valued random variable independent of all of the Xj and having generating function g(z). Show that the generating function for SN is h(z) = g(f(z)). Hint: Use the fact that h(z) = E(zSN) = X k E(zSN|N = k)P(N = k) . 5 We have seen that if the generating function for the offspring of a single parent is f(z), then the generating function for the number of offspring after two generations is given by h(z) = f(f(z)). Explain how this follows from the result of Exercise 4. 6 Consider a queueing process such that in each minute either 1 or 0 customers arrive with probabilities p or q = 1 −p, respectively. (The number p is called the arrival rate.) When a customer starts service she finishes in the next minute with probability r. The number r is called the service rate.) Thus when a customer begins being served she will finish being served in j minutes with probability (1 −r)j−1r, for j = 1, 2, 3, . . . .
prob_Page_400_Chunk5239
10.3. CONTINUOUS DENSITIES 393 (a) Find the generating function f(z) for the number of customers who arrive in one minute and the generating function g(z) for the length of time that a person spends in service once she begins service. (b) Consider a customer branching process by considering the offspring of a customer to be the customers who arrive while she is being served. Using Exercise 4, show that the generating function for our customer branching process is h(z) = g(f(z)). (c) If we start the branching process with the arrival of the first customer, then the length of time until the branching process dies out will be the busy period for the server. Find a condition in terms of the arrival rate and service rate that will assure that the server will ultimately have a time when he is not busy. 7 Let N be the expected total number of offspring in a branching process. Let m be the mean number of offspring of a single parent. Show that N = 1 + X pk · k  N = 1 + mN and hence that N is finite if and only if m < 1 and in that case N = 1/(1−m). 8 Consider a branching process such that the number of offspring of a parent is j with probability 1/2j+1 for j = 0, 1, 2, . . . . (a) Using the results of Example 10.11 show that the probability that there are j offspring in the nth generation is p(n) j =  1 n(n+1)( n n+1)j, if j ≥1, n n+1, if j = 0. (b) Show that the probability that the process dies out exactly at the nth generation is 1/n(n + 1). (c) Show that the expected lifetime is infinite even though d = 1. 10.3 Generating Functions for Continuous Densi- ties In the previous section, we introduced the concepts of moments and moment gen- erating functions for discrete random variables. These concepts have natural ana- logues for continuous random variables, provided some care is taken in arguments involving convergence. Moments If X is a continuous random variable defined on the probability space Ω, with density function fX, then we define the nth moment of X by the formula µn = E(Xn) = Z +∞ −∞ xnfX(x) dx ,
prob_Page_401_Chunk5240
394 CHAPTER 10. GENERATING FUNCTIONS provided the integral µn = E(Xn) = Z +∞ −∞ |x|nfX(x) dx , is finite. Then, just as in the discrete case, we see that µ0 = 1, µ1 = µ, and µ2 −µ2 1 = σ2. Moment Generating Functions Now we define the moment generating function g(t) for X by the formula g(t) = ∞ X k=0 µktk k! = ∞ X k=0 E(Xk)tk k! = E(etX) = Z +∞ −∞ etxfX(x) dx , provided this series converges. Then, as before, we have µn = g(n)(0) . Examples Example 10.15 Let X be a continuous random variable with range [0, 1] and density function fX(x) = 1 for 0 ≤x ≤1 (uniform density). Then µn = Z 1 0 xn dx = 1 n + 1 , and g(t) = ∞ X k=0 tk (k + 1)! = et −1 t . Here the series converges for all t. Alternatively, we have g(t) = Z +∞ −∞ etxfX(x) dx = Z 1 0 etx dx = et −1 t . Then (by L’Hˆopital’s rule) µ0 = g(0) = lim t→0 et −1 t = 1 , µ1 = g′(0) = lim t→0 tet −et + 1 t2 = 1 2 , µ2 = g′′(0) = lim t→0 t3et −2t2et + 2tet −2t t4 = 1 3 .
prob_Page_402_Chunk5241
10.3. CONTINUOUS DENSITIES 395 In particular, we verify that µ = g′(0) = 1/2 and σ2 = g′′(0) −(g′(0))2 = 1 3 −1 4 = 1 12 as before (see Example 6.25). 2 Example 10.16 Let X have range [ 0, ∞) and density function fX(x) = λe−λx (exponential density with parameter λ). In this case µn = Z ∞ 0 xnλe−λx dx = λ(−1)n dn dλn Z ∞ 0 e−λx dx = λ(−1)n dn dλn [ 1 λ] = n! λn , and g(t) = ∞ X k=0 µktk k! = ∞ X k=0 [ t λ]k = λ λ −t . Here the series converges only for |t| < λ. Alternatively, we have g(t) = Z ∞ 0 etxλe−λx dx = λe(t−λ)x t −λ ∞ 0 = λ λ −t . Now we can verify directly that µn = g(n)(0) = λn! (λ −t)n+1 t=0 = n! λn . 2 Example 10.17 Let X have range (−∞, +∞) and density function fX(x) = 1 √ 2π e−x2/2 (normal density). In this case we have µn = 1 √ 2π Z +∞ −∞ xne−x2/2 dx =  (2m)! 2mm!, if n = 2m, 0, if n = 2m + 1.
prob_Page_403_Chunk5242
396 CHAPTER 10. GENERATING FUNCTIONS (These moments are calculated by integrating once by parts to show that µn = (n −1)µn−2, and observing that µ0 = 1 and µ1 = 0.) Hence, g(t) = ∞ X n=0 µntn n! = ∞ X m=0 t2m 2mm! = et2/2 . This series converges for all values of t. Again we can verify that g(n)(0) = µn. Let X be a normal random variable with parameters µ and σ. It is easy to show that the moment generating function of X is given by etµ+(σ2/2)t2 . Now suppose that X and Y are two independent normal random variables with parameters µ1, σ1, and µ2, σ2, respectively. Then, the product of the moment generating functions of X and Y is et(µ1+µ2)+((σ2 1+σ2 2)/2)t2 . This is the moment generating function for a normal random variable with mean µ1 + µ2 and variance σ2 1 + σ2 2. Thus, the sum of two independent normal random variables is again normal. (This was proved for the special case that both summands are standard normal in Example 7.5.) 2 In general, the series defining g(t) will not converge for all t. But in the important special case where X is bounded (i.e., where the range of X is contained in a finite interval), we can show that the series does converge for all t. Theorem 10.3 Suppose X is a continuous random variable with range contained in the interval [−M, M]. Then the series g(t) = ∞ X k=0 µktk k! converges for all t to an infinitely differentiable function g(t), and g(n)(0) = µn. Proof. We have µk = Z +M −M xkfX(x) dx , so |µk| ≤ Z +M −M |x|kfX(x) dx ≤ M k Z +M −M fX(x) dx = M k .
prob_Page_404_Chunk5243
10.3. CONTINUOUS DENSITIES 397 Hence, for all N we have N X k=0 µktk k! ≤ N X k=0 (M|t|)k k! ≤eM|t| , which shows that the power series converges for all t. We know that the sum of a convergent power series is always differentiable. 2 Moment Problem Theorem 10.4 If X is a bounded random variable, then the moment generating function gX(t) of x determines the density function fX(x) uniquely. Sketch of the Proof. We know that gX(t) = ∞ X k=0 µktk k! = Z +∞ −∞ etxf(x) dx . If we replace t by iτ, where τ is real and i = √−1, then the series converges for all τ, and we can define the function kX(τ) = gX(iτ) = Z +∞ −∞ eiτxfX(x) dx . The function kX(τ) is called the characteristic function of X, and is defined by the above equation even when the series for gX does not converge. This equation says that kX is the Fourier transform of fX. It is known that the Fourier transform has an inverse, given by the formula fX(x) = 1 2π Z +∞ −∞ e−iτxkX(τ) dτ , suitably interpreted.9 Here we see that the characteristic function kX, and hence the moment generating function gX, determines the density function fX uniquely under our hypotheses. 2 Sketch of the Proof of the Central Limit Theorem With the above result in mind, we can now sketch a proof of the Central Limit Theorem for bounded continuous random variables (see Theorem 9.6). To this end, let X be a continuous random variable with density function fX, mean µ = 0 and variance σ2 = 1, and moment generating function g(t) defined by its series for all t. 9H. Dym and H. P. McKean, Fourier Series and Integrals (New York: Academic Press, 1972).
prob_Page_405_Chunk5244
398 CHAPTER 10. GENERATING FUNCTIONS Let X1, X2, . . . , Xn be an independent trials process with each Xi having density fX, and let Sn = X1 + X2 + · · · + Xn, and S∗ n = (Sn −nµ)/ √ nσ2 = Sn/√n. Then each Xi has moment generating function g(t), and since the Xi are independent, the sum Sn, just as in the discrete case (see Section 10.1), has moment generating function gn(t) = (g(t))n , and the standardized sum S∗ n has moment generating function g∗ n(t) =  g  t √n n . We now show that, as n →∞, g∗ n(t) →et2/2, where et2/2 is the moment gener- ating function of the normal density n(x) = (1/ √ 2π)e−x2/2 (see Example 10.17). To show this, we set u(t) = log g(t), and u∗ n(t) = log g∗ n(t) = n log g  t √n  = nu  t √n  , and show that u∗ n(t) →t2/2 as n →∞. First we note that u(0) = log gn(0) = 0 , u′(0) = g′(0) g(0) = µ1 1 = 0 , u′′(0) = g′′(0)g(0) −(g′(0))2 (g(0))2 = µ2 −µ2 1 1 = σ2 = 1 . Now by using L’Hˆopital’s rule twice, we get lim n→∞u∗ n(t) = lim s→∞ u(t/√s) s−1 = lim s→∞ u′(t/√s)t 2s−1/2 = lim s→∞u′′  t √s  t2 2 = σ2 t2 2 = t2 2 . Hence, g∗ n(t) →et2/2 as n →∞. Now to complete the proof of the Central Limit Theorem, we must show that if g∗ n(t) →et2/2, then under our hypotheses the distribution functions F ∗ n(x) of the S∗ n must converge to the distribution function F ∗ N(x) of the normal variable N; that is, that F ∗ n(a) = P(S∗ n ≤a) → 1 √ 2π Z a −∞ e−x2/2 dx , and furthermore, that the density functions f ∗ n(x) of the S∗ n must converge to the density function for N; that is, that f ∗ n(x) → 1 √ 2π e−x2/2 ,
prob_Page_406_Chunk5245
10.3. CONTINUOUS DENSITIES 399 as n →∞. Since the densities, and hence the distributions, of the S∗ n are uniquely deter- mined by their moment generating functions under our hypotheses, these conclu- sions are certainly plausible, but their proofs involve a detailed examination of characteristic functions and Fourier transforms, and we shall not attempt them here. In the same way, we can prove the Central Limit Theorem for bounded discrete random variables with integer values (see Theorem 9.4). Let X be a discrete random variable with density function p(j), mean µ = 0, variance σ2 = 1, and moment generating function g(t), and let X1, X2, . . . , Xn form an independent trials process with common density p. Let Sn = X1 + X2 + · · · + Xn and S∗ n = Sn/√n, with densities pn and p∗ n, and moment generating functions gn(t) and g∗ n(t) =  g( t √n) n . Then we have g∗ n(t) →et2/2 , just as in the continuous case, and this implies in the same way that the distribution functions F ∗ n(x) converge to the normal distribution; that is, that F ∗ n(a) = P(S∗ n ≤a) → 1 √ 2π Z a −∞ e−x2/2 dx , as n →∞. The corresponding statement about the distribution functions p∗ n, however, re- quires a little extra care (see Theorem 9.3). The trouble arises because the dis- tribution p(x) is not defined for all x, but only for integer x. It follows that the distribution p∗ n(x) is defined only for x of the form j/√n, and these values change as n changes. We can fix this, however, by introducing the function ¯p(x), defined by the for- mula ¯p(x) =  p(j), if j −1/2 ≤x < j + 1/2, 0 , otherwise. Then ¯p(x) is defined for all x, ¯p(j) = p(j), and the graph of ¯p(x) is the step function for the distribution p(j) (see Figure 3 of Section 9.1). In the same way we introduce the step function ¯pn(x) and ¯p∗ n(x) associated with the distributions pn and p∗ n, and their moment generating functions ¯gn(t) and ¯g∗ n(t). If we can show that ¯g∗ n(t) →et2/2, then we can conclude that ¯p∗ n(x) → 1 √ 2πet2/2 , as n →∞, for all x, a conclusion strongly suggested by Figure 9.3. Now ¯g(t) is given by ¯g(t) = Z +∞ −∞ etx¯p(x) dx = +N X j=−N Z j+1/2 j−1/2 etxp(j) dx
prob_Page_407_Chunk5246
400 CHAPTER 10. GENERATING FUNCTIONS = +N X j=−N p(j)etj et/2 −e−t/2 2t/2 = g(t)sinh(t/2) t/2 , where we have put sinh(t/2) = et/2 −e−t/2 2 . In the same way, we find that ¯gn(t) = gn(t)sinh(t/2) t/2 , ¯g∗ n(t) = g∗ n(t)sinh(t/2√n) t/2√n . Now, as n →∞, we know that g∗ n(t) →et2/2, and, by L’Hˆopital’s rule, lim n→∞ sinh(t/2√n) t/2√n = 1 . It follows that ¯g∗ n(t) →et2/2 , and hence that ¯p∗ n(x) → 1 √ 2π e−x2/2 , as n →∞. The astute reader will note that in this sketch of the proof of Theo- rem 9.3, we never made use of the hypothesis that the greatest common divisor of the differences of all the values that the Xi can take on is 1. This is a technical point that we choose to ignore. A complete proof may be found in Gnedenko and Kolmogorov.10 Cauchy Density The characteristic function of a continuous density is a useful tool even in cases when the moment series does not converge, or even in cases when the moments themselves are not finite. As an example, consider the Cauchy density with parameter a = 1 (see Example 5.10) f(x) = 1 π(1 + x2) . If X and Y are independent random variables with Cauchy density f(x), then the average Z = (X + Y )/2 also has Cauchy density f(x), that is, fZ(x) = f(x) . 10B. V. Gnedenko and A. N. Kolomogorov, Limit Distributions for Sums of Independent Random Variables (Reading: Addison-Wesley, 1968), p. 233.
prob_Page_408_Chunk5247
10.3. CONTINUOUS DENSITIES 401 This is hard to check directly, but easy to check by using characteristic functions. Note first that µ2 = E(X2) = Z +∞ −∞ x2 π(1 + x2) dx = ∞ so that µ2 is infinite. Nevertheless, we can define the characteristic function kX(τ) of x by the formula kX(τ) = Z +∞ −∞ eiτx 1 π(1 + x2) dx . This integral is easy to do by contour methods, and gives us kX(τ) = kY (τ) = e−|τ| . Hence, kX+Y (τ) = (e−|τ|)2 = e−2|τ| , and since kZ(τ) = kX+Y (τ/2) , we have kZ(τ) = e−2|τ/2| = e−|τ| . This shows that kZ = kX = kY , and leads to the conclusions that fZ = fX = fY . It follows from this that if X1, X2, . . . , Xn is an independent trials process with common Cauchy density, and if An = X1 + X2 + · · · + Xn n is the average of the Xi, then An has the same density as do the Xi. This means that the Law of Large Numbers fails for this process; the distribution of the average An is exactly the same as for the individual terms. Our proof of the Law of Large Numbers fails in this case because the variance of Xi is not finite. Exercises 1 Let X be a continuous random variable with values in [ 0, 2] and density fX. Find the moment generating function g(t) for X if (a) fX(x) = 1/2. (b) fX(x) = (1/2)x. (c) fX(x) = 1 −(1/2)x. (d) fX(x) = |1 −x|. (e) fX(x) = (3/8)x2. Hint: Use the integral definition, as in Examples 10.15 and 10.16. 2 For each of the densities in Exercise 1 calculate the first and second moments, µ1 and µ2, directly from their definition and verify that g(0) = 1, g′(0) = µ1, and g′′(0) = µ2.
prob_Page_409_Chunk5248
402 CHAPTER 10. GENERATING FUNCTIONS 3 Let X be a continuous random variable with values in [ 0, ∞) and density fX. Find the moment generating functions for X if (a) fX(x) = 2e−2x. (b) fX(x) = e−2x + (1/2)e−x. (c) fX(x) = 4xe−2x. (d) fX(x) = λ(λx)n−1e−λx/(n −1)!. 4 For each of the densities in Exercise 3, calculate the first and second moments, µ1 and µ2, directly from their definition and verify that g(0) = 1, g′(0) = µ1, and g′′(0) = µ2. 5 Find the characteristic function kX(τ) for each of the random variables X of Exercise 1. 6 Let X be a continuous random variable whose characteristic function kX(τ) is kX(τ) = e−|τ|, −∞< τ < +∞. Show directly that the density fX of X is fX(x) = 1 π(1 + x2) . 7 Let X be a continuous random variable with values in [ 0, 1], uniform density function fX(x) ≡1 and moment generating function g(t) = (et −1)/t. Find in terms of g(t) the moment generating function for (a) −X. (b) 1 + X. (c) 3X. (d) aX + b. 8 Let X1, X2, . . . , Xn be an independent trials process with uniform density. Find the moment generating function for (a) X1. (b) S2 = X1 + X2. (c) Sn = X1 + X2 + · · · + Xn. (d) An = Sn/n. (e) S∗ n = (Sn −nµ)/ √ nσ2. 9 Let X1, X2, . . . , Xn be an independent trials process with normal density of mean 1 and variance 2. Find the moment generating function for (a) X1. (b) S2 = X1 + X2.
prob_Page_410_Chunk5249
10.3. CONTINUOUS DENSITIES 403 (c) Sn = X1 + X2 + · · · + Xn. (d) An = Sn/n. (e) S∗ n = (Sn −nµ)/ √ nσ2. 10 Let X1, X2, . . . , Xn be an independent trials process with density f(x) = 1 2e−|x|, −∞< x < +∞. (a) Find the mean and variance of f(x). (b) Find the moment generating function for X1, Sn, An, and S∗ n. (c) What can you say about the moment generating function of S∗ n as n → ∞? (d) What can you say about the moment generating function of An as n → ∞?
prob_Page_411_Chunk5250
404 CHAPTER 10. GENERATING FUNCTIONS
prob_Page_412_Chunk5251
Chapter 11 Markov Chains 11.1 Introduction Most of our study of probability has dealt with independent trials processes. These processes are the basis of classical probability theory and much of statistics. We have discussed two of the principal theorems for these processes: the Law of Large Numbers and the Central Limit Theorem. We have seen that when a sequence of chance experiments forms an indepen- dent trials process, the possible outcomes for each experiment are the same and occur with the same probability. Further, knowledge of the outcomes of the pre- vious experiments does not influence our predictions for the outcomes of the next experiment. The distribution for the outcomes of a single experiment is sufficient to construct a tree and a tree measure for a sequence of n experiments, and we can answer any probability question about these experiments by using this tree measure. Modern probability theory studies chance processes for which the knowledge of previous outcomes influences predictions for future experiments. In principle, when we observe a sequence of chance experiments, all of the past outcomes could influence our predictions for the next experiment. For example, this should be the case in predicting a student’s grades on a sequence of exams in a course. But to allow this much generality would make it very difficult to prove general results. In 1907, A. A. Markov began the study of an important new type of chance process. In this process, the outcome of a given experiment can affect the outcome of the next experiment. This type of process is called a Markov chain. Specifying a Markov Chain We describe a Markov chain as follows: We have a set of states, S = {s1, s2, . . . , sr}. The process starts in one of these states and moves successively from one state to another. Each move is called a step. If the chain is currently in state si, then it moves to state sj at the next step with a probability denoted by pij, and this probability does not depend upon which states the chain was in before the current 405
prob_Page_413_Chunk5252
406 CHAPTER 11. MARKOV CHAINS state. The probabilities pij are called transition probabilities. The process can remain in the state it is in, and this occurs with probability pii. An initial probability distribution, defined on S, specifies the starting state. Usually this is done by specifying a particular state as the starting state. R. A. Howard1 provides us with a picturesque description of a Markov chain as a frog jumping on a set of lily pads. The frog starts on one of the pads and then jumps from lily pad to lily pad with the appropriate transition probabilities. Example 11.1 According to Kemeny, Snell, and Thompson,2 the Land of Oz is blessed by many things, but not by good weather. They never have two nice days in a row. If they have a nice day, they are just as likely to have snow as rain the next day. If they have snow or rain, they have an even chance of having the same the next day. If there is change from snow or rain, only half of the time is this a change to a nice day. With this information we form a Markov chain as follows. We take as states the kinds of weather R, N, and S. From the above information we determine the transition probabilities. These are most conveniently represented in a square array as P =   R N S R 1/2 1/4 1/4 N 1/2 0 1/2 S 1/4 1/4 1/2  . 2 Transition Matrix The entries in the first row of the matrix P in Example 11.1 represent the proba- bilities for the various kinds of weather following a rainy day. Similarly, the entries in the second and third rows represent the probabilities for the various kinds of weather following nice and snowy days, respectively. Such a square array is called the matrix of transition probabilities, or the transition matrix. We consider the question of determining the probability that, given the chain is in state i today, it will be in state j two days from now. We denote this probability by p(2) ij . In Example 11.1, we see that if it is rainy today then the event that it is snowy two days from now is the disjoint union of the following three events: 1) it is rainy tomorrow and snowy two days from now, 2) it is nice tomorrow and snowy two days from now, and 3) it is snowy tomorrow and snowy two days from now. The probability of the first of these events is the product of the conditional probability that it is rainy tomorrow, given that it is rainy today, and the conditional probability that it is snowy two days from now, given that it is rainy tomorrow. Using the transition matrix P, we can write this product as p11p13. The other two 1R. A. Howard, Dynamic Probabilistic Systems, vol. 1 (New York: John Wiley and Sons, 1971). 2J. G. Kemeny, J. L. Snell, G. L. Thompson, Introduction to Finite Mathematics, 3rd ed. (Englewood Cliffs, NJ: Prentice-Hall, 1974).
prob_Page_414_Chunk5253
11.1. INTRODUCTION 407 events also have probabilities that can be written as products of entries of P. Thus, we have p(2) 13 = p11p13 + p12p23 + p13p33 . This equation should remind the reader of a dot product of two vectors; we are dotting the first row of P with the third column of P. This is just what is done in obtaining the 1, 3-entry of the product of P with itself. In general, if a Markov chain has r states, then p(2) ij = r X k=1 pikpkj . The following general theorem is easy to prove by using the above observation and induction. Theorem 11.1 Let P be the transition matrix of a Markov chain. The ijth en- try p(n) ij of the matrix Pn gives the probability that the Markov chain, starting in state si, will be in state sj after n steps. Proof. The proof of this theorem is left as an exercise (Exercise 17). 2 Example 11.2 (Example 11.1 continued) Consider again the weather in the Land of Oz. We know that the powers of the transition matrix give us interesting in- formation about the process as it evolves. We shall be particularly interested in the state of the chain after a large number of steps. The program MatrixPowers computes the powers of P. We have run the program MatrixPowers for the Land of Oz example to com- pute the successive powers of P from 1 to 6. The results are shown in Table 11.1. We note that after six days our weather predictions are, to three-decimal-place ac- curacy, independent of today’s weather. The probabilities for the three types of weather, R, N, and S, are .4, .2, and .4 no matter where the chain started. This is an example of a type of Markov chain called a regular Markov chain. For this type of chain, it is true that long-range predictions are independent of the starting state. Not all chains are regular, but this is an important class of chains that we shall study in detail later. 2 We now consider the long-term behavior of a Markov chain when it starts in a state chosen by a probability distribution on the set of states, which we will call a probability vector. A probability vector with r components is a row vector whose entries are non-negative and sum to 1. If u is a probability vector which represents the initial state of a Markov chain, then we think of the ith component of u as representing the probability that the chain starts in state si. With this interpretation of random starting states, it is easy to prove the fol- lowing theorem.
prob_Page_415_Chunk5254
408 CHAPTER 11. MARKOV CHAINS P1 =   Rain Nice Snow Rain .500 .250 .250 Nice .500 .000 .500 Snow .250 .250 .500   P2 =   Rain Nice Snow Rain .438 .188 .375 Nice .375 .250 .375 Snow .375 .188 .438   P3 =   Rain Nice Snow Rain .406 .203 .391 Nice .406 .188 .406 Snow .391 .203 .406   P4 =   Rain Nice Snow Rain .402 .199 .398 Nice .398 .203 .398 Snow .398 .199 .402   P5 =   Rain Nice Snow Rain .400 .200 .399 Nice .400 .199 .400 Snow .399 .200 .400   P6 =   Rain Nice Snow Rain .400 .200 .400 Nice .400 .200 .400 Snow .400 .200 .400   Table 11.1: Powers of the Land of Oz transition matrix.
prob_Page_416_Chunk5255
11.1. INTRODUCTION 409 Theorem 11.2 Let P be the transition matrix of a Markov chain, and let u be the probability vector which represents the starting distribution. Then the probability that the chain is in state si after n steps is the ith entry in the vector u(n) = uPn . Proof. The proof of this theorem is left as an exercise (Exercise 18). 2 We note that if we want to examine the behavior of the chain under the assump- tion that it starts in a certain state si, we simply choose u to be the probability vector with ith entry equal to 1 and all other entries equal to 0. Example 11.3 In the Land of Oz example (Example 11.1) let the initial probability vector u equal (1/3, 1/3, 1/3). Then we can calculate the distribution of the states after three days using Theorem 11.2 and our previous calculation of P3. We obtain u(3) = uP3 = ( 1/3, 1/3, 1/3)   .406 .203 .391 .406 .188 .406 .391 .203 .406   = ( .401, .198, .401 ) . 2 Examples The following examples of Markov chains will be used throughout the chapter for exercises. Example 11.4 The President of the United States tells person A his or her in- tention to run or not to run in the next election. Then A relays the news to B, who in turn relays the message to C, and so forth, always to some new person. We assume that there is a probability a that a person will change the answer from yes to no when transmitting it to the next person and a probability b that he or she will change it from no to yes. We choose as states the message, either yes or no. The transition matrix is then P =  yes no yes 1 −a a no b 1 −b  . The initial state represents the President’s choice. 2 Example 11.5 Each time a certain horse runs in a three-horse race, he has proba- bility 1/2 of winning, 1/4 of coming in second, and 1/4 of coming in third, indepen- dent of the outcome of any previous race. We have an independent trials process,
prob_Page_417_Chunk5256
410 CHAPTER 11. MARKOV CHAINS but it can also be considered from the point of view of Markov chain theory. The transition matrix is P =   W P S W .5 .25 .25 P .5 .25 .25 S .5 .25 .25  . 2 Example 11.6 In the Dark Ages, Harvard, Dartmouth, and Yale admitted only male students. Assume that, at that time, 80 percent of the sons of Harvard men went to Harvard and the rest went to Yale, 40 percent of the sons of Yale men went to Yale, and the rest split evenly between Harvard and Dartmouth; and of the sons of Dartmouth men, 70 percent went to Dartmouth, 20 percent to Harvard, and 10 percent to Yale. We form a Markov chain with transition matrix P =   H Y D H .8 .2 0 Y .3 .4 .3 D .2 .1 .7  . 2 Example 11.7 Modify Example 11.6 by assuming that the son of a Harvard man always went to Harvard. The transition matrix is now P =   H Y D H 1 0 0 Y .3 .4 .3 D .2 .1 .7  . 2 Example 11.8 (Ehrenfest Model) The following is a special case of a model, called the Ehrenfest model,3 that has been used to explain diffusion of gases. The general model will be discussed in detail in Section 11.5. We have two urns that, between them, contain four balls. At each step, one of the four balls is chosen at random and moved from the urn that it is in into the other urn. We choose, as states, the number of balls in the first urn. The transition matrix is then P =       0 1 2 3 4 0 0 1 0 0 0 1 1/4 0 3/4 0 0 2 0 1/2 0 1/2 0 3 0 0 3/4 0 1/4 4 0 0 0 1 0       . 2 3P. and T. Ehrenfest, “¨Uber zwei bekannte Einw¨ande gegen das Boltzmannsche H-Theorem,” Physikalishce Zeitschrift, vol. 8 (1907), pp. 311-314.
prob_Page_418_Chunk5257
11.1. INTRODUCTION 411 Example 11.9 (Gene Model) The simplest type of inheritance of traits in animals occurs when a trait is governed by a pair of genes, each of which may be of two types, say G and g. An individual may have a GG combination or Gg (which is genetically the same as gG) or gg. Very often the GG and Gg types are indistinguishable in appearance, and then we say that the G gene dominates the g gene. An individual is called dominant if he or she has GG genes, recessive if he or she has gg, and hybrid with a Gg mixture. In the mating of two animals, the offspring inherits one gene of the pair from each parent, and the basic assumption of genetics is that these genes are selected at random, independently of each other. This assumption determines the probability of occurrence of each type of offspring. The offspring of two purely dominant parents must be dominant, of two recessive parents must be recessive, and of one dominant and one recessive parent must be hybrid. In the mating of a dominant and a hybrid animal, each offspring must get a G gene from the former and has an equal chance of getting G or g from the latter. Hence there is an equal probability for getting a dominant or a hybrid offspring. Again, in the mating of a recessive and a hybrid, there is an even chance for getting either a recessive or a hybrid. In the mating of two hybrids, the offspring has an equal chance of getting G or g from each parent. Hence the probabilities are 1/4 for GG, 1/2 for Gg, and 1/4 for gg. Consider a process of continued matings. We start with an individual of known genetic character and mate it with a hybrid. We assume that there is at least one offspring. An offspring is chosen at random and is mated with a hybrid and this process repeated through a number of generations. The genetic type of the chosen offspring in successive generations can be represented by a Markov chain. The states are dominant, hybrid, and recessive, and indicated by GG, Gg, and gg respectively. The transition probabilities are P =   GG Gg gg GG .5 .5 0 Gg .25 .5 .25 gg 0 .5 .5  . 2 Example 11.10 Modify Example 11.9 as follows: Instead of mating the oldest offspring with a hybrid, we mate it with a dominant individual. The transition matrix is P =   GG Gg gg GG 1 0 0 Gg .5 .5 0 gg 0 1 0  . 2
prob_Page_419_Chunk5258
412 CHAPTER 11. MARKOV CHAINS Example 11.11 We start with two animals of opposite sex, mate them, select two of their offspring of opposite sex, and mate those, and so forth. To simplify the example, we will assume that the trait under consideration is independent of sex. Here a state is determined by a pair of animals. Hence, the states of our process will be: s1 = (GG, GG), s2 = (GG, Gg), s3 = (GG, gg), s4 = (Gg, Gg), s5 = (Gg, gg), and s6 = (gg, gg). We illustrate the calculation of transition probabilities in terms of the state s2. When the process is in this state, one parent has GG genes, the other Gg. Hence, the probability of a dominant offspring is 1/2. Then the probability of transition to s1 (selection of two dominants) is 1/4, transition to s2 is 1/2, and to s4 is 1/4. The other states are treated the same way. The transition matrix of this chain is: P1 =          GG,GG GG,Gg GG,gg Gg,Gg Gg,gg gg,gg GG,GG 1.000 .000 .000 .000 .000 .000 GG,Gg .250 .500 .000 .250 .000 .000 GG,gg .000 .000 .000 1.000 .000 .000 Gg,Gg .062 .250 .125 .250 .250 .062 Gg,gg .000 .000 .000 .250 .500 .250 gg,gg .000 .000 .000 .000 .000 1.000          . 2 Example 11.12 (Stepping Stone Model) Our final example is another example that has been used in the study of genetics. It is called the stepping stone model.4 In this model we have an n-by-n array of squares, and each square is initially any one of k different colors. For each step, a square is chosen at random. This square then chooses one of its eight neighbors at random and assumes the color of that neighbor. To avoid boundary problems, we assume that if a square S is on the left-hand boundary, say, but not at a corner, it is adjacent to the square T on the right-hand boundary in the same row as S, and S is also adjacent to the squares just above and below T. A similar assumption is made about squares on the upper and lower boundaries. The top left-hand corner square is adjacent to three obvious neighbors, namely the squares below it, to its right, and diagonally below and to the right. It has five other neighbors, which are as follows: the other three corner squares, the square below the upper right-hand corner, and the square to the right of the bottom left-hand corner. The other three corners also have, in a similar way, eight neighbors. (These adjacencies are much easier to understand if one imagines making the array into a cylinder by gluing the top and bottom edge together, and then making the cylinder into a doughnut by gluing the two circular boundaries together.) With these adjacencies, each square in the array is adjacent to exactly eight other squares. A state in this Markov chain is a description of the color of each square. For this Markov chain the number of states is kn2, which for even a small array of squares 4S. Sawyer, “Results for The Stepping Stone Model for Migration in Population Genetics,” Annals of Probability, vol. 4 (1979), pp. 699–728.
prob_Page_420_Chunk5259
11.1. INTRODUCTION 413 Figure 11.1: Initial state of the stepping stone model. Figure 11.2: State of the stepping stone model after 10,000 steps. is enormous. This is an example of a Markov chain that is easy to simulate but difficult to analyze in terms of its transition matrix. The program SteppingStone simulates this chain. We have started with a random initial configuration of two colors with n = 20 and show the result after the process has run for some time in Figure 11.2. This is an example of an absorbing Markov chain. This type of chain will be studied in Section 11.2. One of the theorems proved in that section, applied to the present example, implies that with probability 1, the stones will eventually all be the same color. By watching the program run, you can see that territories are established and a battle develops to see which color survives. At any time the probability that a particular color will win out is equal to the proportion of the array of this color. You are asked to prove this in Exercise 11.2.32. 2 Exercises 1 It is raining in the Land of Oz. Determine a tree and a tree measure for the next three days’ weather. Find w(1), w(2), and w(3) and compare with the results obtained from P, P2, and P3.
prob_Page_421_Chunk5260
414 CHAPTER 11. MARKOV CHAINS 2 In Example 11.4, let a = 0 and b = 1/2. Find P, P2, and P3. What would Pn be? What happens to Pn as n tends to infinity? Interpret this result. 3 In Example 11.5, find P, P2, and P3. What is Pn? 4 For Example 11.6, find the probability that the grandson of a man from Har- vard went to Harvard. 5 In Example 11.7, find the probability that the grandson of a man from Harvard went to Harvard. 6 In Example 11.9, assume that we start with a hybrid bred to a hybrid. Find u(1), u(2), and u(3). What would u(n) be? 7 Find the matrices P2, P3, P4, and Pn for the Markov chain determined by the transition matrix P =  1 0 0 1  . Do the same for the transition matrix P =  0 1 1 0  . Interpret what happens in each of these processes. 8 A certain calculating machine uses only the digits 0 and 1. It is supposed to transmit one of these digits through several stages. However, at every stage, there is a probability p that the digit that enters this stage will be changed when it leaves and a probability q = 1−p that it won’t. Form a Markov chain to represent the process of transmission by taking as states the digits 0 and 1. What is the matrix of transition probabilities? 9 For the Markov chain in Exercise 8, draw a tree and assign a tree measure assuming that the process begins in state 0 and moves through two stages of transmission. What is the probability that the machine, after two stages, produces the digit 0 (i.e., the correct digit)? What is the probability that the machine never changed the digit from 0? Now let p = .1. Using the program MatrixPowers, compute the 100th power of the transition matrix. Interpret the entries of this matrix. Repeat this with p = .2. Why do the 100th powers appear to be the same? 10 Modify the program MatrixPowers so that it prints out the average An of the powers Pn, for n = 1 to N. Try your program on the Land of Oz example and compare An and Pn. 11 Assume that a man’s profession can be classified as professional, skilled la- borer, or unskilled laborer. Assume that, of the sons of professional men, 80 percent are professional, 10 percent are skilled laborers, and 10 percent are unskilled laborers. In the case of sons of skilled laborers, 60 percent are skilled laborers, 20 percent are professional, and 20 percent are unskilled. Finally, in the case of unskilled laborers, 50 percent of the sons are unskilled laborers, and 25 percent each are in the other two categories. Assume that every man has at least one son, and form a Markov chain by following the profession of a randomly chosen son of a given family through several generations. Set up
prob_Page_422_Chunk5261
11.1. INTRODUCTION 415 the matrix of transition probabilities. Find the probability that a randomly chosen grandson of an unskilled laborer is a professional man. 12 In Exercise 11, we assumed that every man has a son. Assume instead that the probability that a man has at least one son is .8. Form a Markov chain with four states. If a man has a son, the probability that this son is in a particular profession is the same as in Exercise 11. If there is no son, the process moves to state four which represents families whose male line has died out. Find the matrix of transition probabilities and find the probability that a randomly chosen grandson of an unskilled laborer is a professional man. 13 Write a program to compute u(n) given u and P. Use this program to compute u(10) for the Land of Oz example, with u = (0, 1, 0), and with u = (1/3, 1/3, 1/3). 14 Using the program MatrixPowers, find P1 through P6 for Examples 11.9 and 11.10. See if you can predict the long-range probability of finding the process in each of the states for these examples. 15 Write a program to simulate the outcomes of a Markov chain after n steps, given the initial starting state and the transition matrix P as data (see Ex- ample 11.12). Keep this program for use in later problems. 16 Modify the program of Exercise 15 so that it keeps track of the proportion of times in each state in n steps. Run the modified program for different starting states for Example 11.1 and Example 11.8. Does the initial state affect the proportion of time spent in each of the states if n is large? 17 Prove Theorem 11.1. 18 Prove Theorem 11.2. 19 Consider the following process. We have two coins, one of which is fair, and the other of which has heads on both sides. We give these two coins to our friend, who chooses one of them at random (each with probability 1/2). During the rest of the process, she uses only the coin that she chose. She now proceeds to toss the coin many times, reporting the results. We consider this process to consist solely of what she reports to us. (a) Given that she reports a head on the nth toss, what is the probability that a head is thrown on the (n + 1)st toss? (b) Consider this process as having two states, heads and tails. By computing the other three transition probabilities analogous to the one in part (a), write down a “transition matrix” for this process. (c) Now assume that the process is in state “heads” on both the (n −1)st and the nth toss. Find the probability that a head comes up on the (n + 1)st toss. (d) Is this process a Markov chain?
prob_Page_423_Chunk5262
416 CHAPTER 11. MARKOV CHAINS 11.2 Absorbing Markov Chains The subject of Markov chains is best studied by considering special types of Markov chains. The first type that we shall study is called an absorbing Markov chain. Definition 11.1 A state si of a Markov chain is called absorbing if it is impossible to leave it (i.e., pii = 1). A Markov chain is absorbing if it has at least one absorbing state, and if from every state it is possible to go to an absorbing state (not necessarily in one step). 2 Definition 11.2 In an absorbing Markov chain, a state which is not absorbing is called transient. 2 Drunkard’s Walk Example 11.13 A man walks along a four-block stretch of Park Avenue (see Fig- ure 11.3). If he is at corner 1, 2, or 3, then he walks to the left or right with equal probability. He continues until he reaches corner 4, which is a bar, or corner 0, which is his home. If he reaches either home or the bar, he stays there. We form a Markov chain with states 0, 1, 2, 3, and 4. States 0 and 4 are absorbing states. The transition matrix is then P =       0 1 2 3 4 0 1 0 0 0 0 1 1/2 0 1/2 0 0 2 0 1/2 0 1/2 0 3 0 0 1/2 0 1/2 4 0 0 0 0 1       . The states 1, 2, and 3 are transient states, and from any of these it is possible to reach the absorbing states 0 and 4. Hence the chain is an absorbing chain. When a process reaches an absorbing state, we shall say that it is absorbed. 2 The most obvious question that can be asked about such a chain is: What is the probability that the process will eventually reach an absorbing state? Other interesting questions include: (a) What is the probability that the process will end up in a given absorbing state? (b) On the average, how long will it take for the process to be absorbed? (c) On the average, how many times will the process be in each transient state? The answers to all these questions depend, in general, on the state from which the process starts as well as the transition probabilities. Canonical Form Consider an arbitrary absorbing Markov chain. Renumber the states so that the transient states come first. If there are r absorbing states and t transient states, the transition matrix will have the following canonical form
prob_Page_424_Chunk5263
11.2. ABSORBING MARKOV CHAINS 417 1 2 3 0 4 1 1 1/2 1/2 1/2 1/2 1/2 1/2 Figure 11.3: Drunkard’s walk. P =    TR. ABS. TR. Q R ABS. 0 I    Here I is an r-by-r indentity matrix, 0 is an r-by-t zero matrix, R is a nonzero t-by-r matrix, and Q is an t-by-t matrix. The first t states are transient and the last r states are absorbing. In Section 11.1, we saw that the entry p(n) ij of the matrix Pn is the probability of being in the state sj after n steps, when the chain is started in state si. A standard matrix algebra argument shows that Pn is of the form Pn =    TR. ABS. TR. Qn ∗ ABS. 0 I    where the asterisk ∗stands for the t-by-r matrix in the upper right-hand corner of Pn. (This submatrix can be written in terms of Q and R, but the expression is complicated and is not needed at this time.) The form of Pn shows that the entries of Qn give the probabilities for being in each of the transient states after n steps for each possible transient starting state. For our first theorem we prove that the probability of being in the transient states after n steps approaches zero. Thus every entry of Qn must approach zero as n approaches infinity (i.e, Qn →0). Probability of Absorption Theorem 11.3 In an absorbing Markov chain, the probability that the process will be absorbed is 1 (i.e., Qn →0 as n →∞). Proof. From each nonabsorbing state sj it is possible to reach an absorbing state. Let mj be the minimum number of steps required to reach an absorbing state, starting from sj. Let pj be the probability that, starting from sj, the process will not reach an absorbing state in mj steps. Then pj < 1. Let m be the largest of the
prob_Page_425_Chunk5264
418 CHAPTER 11. MARKOV CHAINS mj and let p be the largest of pj. The probability of not being absorbed in m steps is less than or equal to p, in 2m steps less than or equal to p2, etc. Since p < 1 these probabilities tend to 0. Since the probability of not being absorbed in n steps is monotone decreasing, these probabilities also tend to 0, hence limn→∞Qn = 0. 2 The Fundamental Matrix Theorem 11.4 For an absorbing Markov chain the matrix I −Q has an inverse N and N = I + Q + Q2 + · · · . The ij-entry nij of the matrix N is the expected number of times the chain is in state sj, given that it starts in state si. The initial state is counted if i = j. Proof. Let (I −Q)x = 0; that is x = Qx. Then, iterating this we see that x = Qnx. Since Qn →0, we have Qnx →0, so x = 0. Thus (I −Q)−1 = N exists. Note next that (I −Q)(I + Q + Q2 + · · · + Qn) = I −Qn+1 . Thus multiplying both sides by N gives I + Q + Q2 + · · · + Qn = N(I −Qn+1) . Letting n tend to infinity we have N = I + Q + Q2 + · · · . Let si and sj be two transient states, and assume throughout the remainder of the proof that i and j are fixed. Let X(k) be a random variable which equals 1 if the chain is in state sj after k steps, and equals 0 otherwise. For each k, this random variable depends upon both i and j; we choose not to explicitly show this dependence in the interest of clarity. We have P(X(k) = 1) = q(k) ij , and P(X(k) = 0) = 1 −q(k) ij , where q(k) ij is the ijth entry of Qk. These equations hold for k = 0 since Q0 = I. Therefore, since X(k) is a 0-1 random variable, E(X(k)) = q(k) ij . The expected number of times the chain is in state sj in the first n steps, given that it starts in state si, is clearly E  X(0) + X(1) + · · · + X(n) = q(0) ij + q(1) ij + · · · + q(n) ij . Letting n tend to infinity we have E  X(0) + X(1) + · · ·  = q(0) ij + q(1) ij + · · · = nij . 2
prob_Page_426_Chunk5265
11.2. ABSORBING MARKOV CHAINS 419 Definition 11.3 For an absorbing Markov chain P, the matrix N = (I −Q)−1 is called the fundamental matrix for P. The entry nij of N gives the expected number of times that the process is in the transient state sj if it is started in the transient state si. 2 Example 11.14 (Example 11.13 continued) In the Drunkard’s Walk example, the transition matrix in canonical form is P =      1 2 3 0 4 1 0 1/2 0 1/2 0 2 1/2 0 1/2 0 0 3 0 1/2 0 0 1/2 0 0 0 0 1 0 4 0 0 0 0 1     . From this we see that the matrix Q is Q =   0 1/2 0 1/2 0 1/2 0 1/2 0  , and I −Q =   1 −1/2 0 −1/2 1 −1/2 0 −1/2 1  . Computing (I −Q)−1, we find N = (I −Q)−1 =   1 2 3 1 3/2 1 1/2 2 1 2 1 3 1/2 1 3/2  . From the middle row of N, we see that if we start in state 2, then the expected number of times in states 1, 2, and 3 before being absorbed are 1, 2, and 1. 2 Time to Absorption We now consider the question: Given that the chain starts in state si, what is the expected number of steps before the chain is absorbed? The answer is given in the next theorem. Theorem 11.5 Let ti be the expected number of steps before the chain is absorbed, given that the chain starts in state si, and let t be the column vector whose ith entry is ti. Then t = Nc , where c is a column vector all of whose entries are 1.
prob_Page_427_Chunk5266
420 CHAPTER 11. MARKOV CHAINS Proof. If we add all the entries in the ith row of N, we will have the expected number of times in any of the transient states for a given starting state si, that is, the expected time required before being absorbed. Thus, ti is the sum of the entries in the ith row of N. If we write this statement in matrix form, we obtain the theorem. 2 Absorption Probabilities Theorem 11.6 Let bij be the probability that an absorbing chain will be absorbed in the absorbing state sj if it starts in the transient state si. Let B be the matrix with entries bij. Then B is an t-by-r matrix, and B = NR , where N is the fundamental matrix and R is as in the canonical form. Proof. We have Bij = X n X k q(n) ik rkj = X k X n q(n) ik rkj = X k nikrkj = (NR)ij . This completes the proof. 2 Another proof of this is given in Exercise 34. Example 11.15 (Example 11.14 continued) In the Drunkard’s Walk example, we found that N =   1 2 3 1 3/2 1 1/2 2 1 2 1 3 1/2 1 3/2  . Hence, t = Nc =   3/2 1 1/2 1 2 1 1/2 1 3/2     1 1 1   =   3 4 3  .
prob_Page_428_Chunk5267
11.2. ABSORBING MARKOV CHAINS 421 Thus, starting in states 1, 2, and 3, the expected times to absorption are 3, 4, and 3, respectively. From the canonical form, R =   0 4 1 1/2 0 2 0 0 3 0 1/2  . Hence, B = NR =   3/2 1 1/2 1 2 1 1/2 1 3/2  ·   1/2 0 0 0 0 1/2   =   0 4 1 3/4 1/4 2 1/2 1/2 3 1/4 3/4  . Here the first row tells us that, starting from state 1, there is probability 3/4 of absorption in state 0 and 1/4 of absorption in state 4. 2 Computation The fact that we have been able to obtain these three descriptive quantities in matrix form makes it very easy to write a computer program that determines these quantities for a given absorbing chain matrix. The program AbsorbingChain calculates the basic descriptive quantities of an absorbing Markov chain. We have run the program AbsorbingChain for the example of the drunkard’s walk (Example 11.13) with 5 blocks. The results are as follows: Q =     1 2 3 4 1 .00 .50 .00 .00 2 .50 .00 .50 .00 3 .00 .50 .00 .50 4 .00 .00 .50 .00    ; R =     0 5 1 .50 .00 2 .00 .00 3 .00 .00 4 .00 .50    ;
prob_Page_429_Chunk5268
422 CHAPTER 11. MARKOV CHAINS N =     1 2 3 4 1 1.60 1.20 .80 .40 2 1.20 2.40 1.60 .80 3 .80 1.60 2.40 1.20 4 .40 .80 1.20 1.60    ; t =     1 4.00 2 6.00 3 6.00 4 4.00    ; B =     0 5 1 .80 .20 2 .60 .40 3 .40 .60 4 .20 .80    . Note that the probability of reaching the bar before reaching home, starting at x, is x/5 (i.e., proportional to the distance of home from the starting point). (See Exercise 24.) Exercises 1 In Example 11.4, for what values of a and b do we obtain an absorbing Markov chain? 2 Show that Example 11.7 is an absorbing Markov chain. 3 Which of the genetics examples (Examples 11.9, 11.10, and 11.11) are ab- sorbing? 4 Find the fundamental matrix N for Example 11.10. 5 For Example 11.11, verify that the following matrix is the inverse of I −Q and hence is the fundamental matrix N. N =     8/3 1/6 4/3 2/3 4/3 4/3 8/3 4/3 4/3 1/3 8/3 4/3 2/3 1/6 4/3 8/3    . Find Nc and NR. Interpret the results. 6 In the Land of Oz example (Example 11.1), change the transition matrix by making R an absorbing state. This gives P =   R N S R 1 0 0 N 1/2 0 1/2 S 1/4 1/4 1/2  .
prob_Page_430_Chunk5269
11.2. ABSORBING MARKOV CHAINS 423 Find the fundamental matrix N, and also Nc and NR. Interpret the results. 7 In Example 11.8, make states 0 and 4 into absorbing states. Find the fun- damental matrix N, and also Nc and NR, for the resulting absorbing chain. Interpret the results. 8 In Example 11.13 (Drunkard’s Walk) of this section, assume that the proba- bility of a step to the right is 2/3, and a step to the left is 1/3. Find N, Nc, and NR. Compare these with the results of Example 11.15. 9 A process moves on the integers 1, 2, 3, 4, and 5. It starts at 1 and, on each successive step, moves to an integer greater than its present position, moving with equal probability to each of the remaining larger integers. State five is an absorbing state. Find the expected number of steps to reach state five. 10 Using the result of Exercise 9, make a conjecture for the form of the funda- mental matrix if the process moves as in that exercise, except that it now moves on the integers from 1 to n. Test your conjecture for several different values of n. Can you conjecture an estimate for the expected number of steps to reach state n, for large n? (See Exercise 11 for a method of determining this expected number of steps.) *11 Let bk denote the expected number of steps to reach n from n −k, in the process described in Exercise 9. (a) Define b0 = 0. Show that for k > 0, we have bk = 1 + 1 k
prob_Page_431_Chunk5270
424 CHAPTER 11. MARKOV CHAINS it fires. The tanks fire together and each tank fires at the strongest opponent not yet destroyed. Form a Markov chain by taking as states the subsets of the set of tanks. Find N, Nc, and NR, and interpret your results. Hint: Take as states ABC, AC, BC, A, B, C, and none, indicating the tanks that could survive starting in state ABC. You can omit AB because this state cannot be reached from ABC. 13 Smith is in jail and has 3 dollars; he can get out on bail if he has 8 dollars. A guard agrees to make a series of bets with him. If Smith bets A dollars, he wins A dollars with probability .4 and loses A dollars with probability .6. Find the probability that he wins 8 dollars before losing all of his money if (a) he bets 1 dollar each time (timid strategy). (b) he bets, each time, as much as possible but not more than necessary to bring his fortune up to 8 dollars (bold strategy). (c) Which strategy gives Smith the better chance of getting out of jail? 14 With the situation in Exercise 13, consider the strategy such that for i < 4, Smith bets min(i, 4 −i), and for i ≥4, he bets according to the bold strategy, where i is his current fortune. Find the probability that he gets out of jail using this strategy. How does this probability compare with that obtained for the bold strategy? 15 Consider the game of tennis when deuce is reached. If a player wins the next point, he has advantage. On the following point, he either wins the game or the game returns to deuce. Assume that for any point, player A has probability .6 of winning the point and player B has probability .4 of winning the point. (a) Set this up as a Markov chain with state 1: A wins; 2: B wins; 3: advantage A; 4: deuce; 5: advantage B. (b) Find the absorption probabilities. (c) At deuce, find the expected duration of the game and the probability that B will win. Exercises 16 and 17 concern the inheritance of color-blindness, which is a sex- linked characteristic. There is a pair of genes, g and G, of which the former tends to produce color-blindness, the latter normal vision. The G gene is dominant. But a man has only one gene, and if this is g, he is color-blind. A man inherits one of his mother’s two genes, while a woman inherits one gene from each parent. Thus a man may be of type G or g, while a woman may be type GG or Gg or gg. We will study a process of inbreeding similar to that of Example 11.11 by constructing a Markov chain. 16 List the states of the chain. Hint: There are six. Compute the transition probabilities. Find the fundamental matrix N, Nc, and NR.
prob_Page_432_Chunk5271
11.2. ABSORBING MARKOV CHAINS 425 17 Show that in both Example 11.11 and the example just given, the probability of absorption in a state having genes of a particular type is equal to the proportion of genes of that type in the starting state. Show that this can be explained by the fact that a game in which your fortune is the number of genes of a particular type in the state of the Markov chain is a fair game.5 18 Assume that a student going to a certain four-year medical school in northern New England has, each year, a probability q of flunking out, a probability r of having to repeat the year, and a probability p of moving on to the next year (in the fourth year, moving on means graduating). (a) Form a transition matrix for this process taking as states F, 1, 2, 3, 4, and G where F stands for flunking out and G for graduating, and the other states represent the year of study. (b) For the case q = .1, r = .2, and p = .7 find the time a beginning student can expect to be in the second year. How long should this student expect to be in medical school? (c) Find the probability that this beginning student will graduate. 19 (E. Brown6) Mary and John are playing the following game: They have a three-card deck marked with the numbers 1, 2, and 3 and a spinner with the numbers 1, 2, and 3 on it. The game begins by dealing the cards out so that the dealer gets one card and the other person gets two. A move in the game consists of a spin of the spinner. The person having the card with the number that comes up on the spinner hands that card to the other person. The game ends when someone has all the cards. (a) Set up the transition matrix for this absorbing Markov chain, where the states correspond to the number of cards that Mary has. (b) Find the fundamental matrix. (c) On the average, how many moves will the game last? (d) If Mary deals, what is the probability that John will win the game? 20 Assume that an experiment has m equally probable outcomes. Show that the expected number of independent trials before the first occurrence of k consec- utive occurrences of one of these outcomes is (mk −1)/(m −1). Hint: Form an absorbing Markov chain with states 1, 2, . . . , k with state i representing the length of the current run. The expected time until a run of k is 1 more than the expected time until absorption for the chain started in state 1. It has been found that, in the decimal expansion of pi, starting with the 24,658,601st digit, there is a run of nine 7’s. What would your result say about the ex- pected number of digits necessary to find such a run if the digits are produced randomly? 5H. Gonshor, “An Application of Random Walk to a Problem in Population Genetics,” Amer- ican Math Monthly, vol. 94 (1987), pp. 668–671 6Private communication.
prob_Page_433_Chunk5272
426 CHAPTER 11. MARKOV CHAINS 21 (Roberts7) A city is divided into 3 areas 1, 2, and 3. It is estimated that amounts u1, u2, and u3 of pollution are emitted each day from these three areas. A fraction qij of the pollution from region i ends up the next day at region j. A fraction qi = 1−P j qij > 0 goes into the atmosphere and escapes. Let w(n) i be the amount of pollution in area i after n days. (a) Show that w(n) = u + uQ + · · · + uQn−1. (b) Show that w(n) →w, and show how to compute w from u. (c) The government wants to limit pollution levels to a prescribed level by prescribing w. Show how to determine the levels of pollution u which would result in a prescribed limiting value w. 22 In the Leontief economic model,8 there are n industries 1, 2, . . . , n. The ith industry requires an amount 0 ≤qij ≤1 of goods (in dollar value) from company j to produce 1 dollar’s worth of goods. The outside demand on the industries, in dollar value, is given by the vector d = (d1, d2, . . . , dn). Let Q be the matrix with entries qij. (a) Show that if the industries produce total amounts given by the vector x = (x1, x2, . . . , xn) then the amounts of goods of each type that the industries will need just to meet their internal demands is given by the vector xQ. (b) Show that in order to meet the outside demand d and the internal de- mands the industries must produce total amounts given by a vector x = (x1, x2, . . . , xn) which satisfies the equation x = xQ + d. (c) Show that if Q is the Q-matrix for an absorbing Markov chain, then it is possible to meet any outside demand d. (d) Assume that the row sums of Q are less than or equal to 1. Give an economic interpretation of this condition. Form a Markov chain by taking the states to be the industries and the transition probabilites to be the qij. Add one absorbing state 0. Define qi0 = 1 − X j qij . Show that this chain will be absorbing if every company is either making a profit or ultimately depends upon a profit-making company. (e) Define xc to be the gross national product. Find an expression for the gross national product in terms of the demand vector d and the vector t giving the expected time to absorption. 23 A gambler plays a game in which on each play he wins one dollar with prob- ability p and loses one dollar with probability q = 1 −p. The Gambler’s Ruin 7F. Roberts, Discrete Mathematical Models (Englewood Cliffs, NJ: Prentice Hall, 1976). 8W. W. Leontief, Input-Output Economics (Oxford: Oxford University Press, 1966).
prob_Page_434_Chunk5273
11.2. ABSORBING MARKOV CHAINS 427 problem is the problem of finding the probability wx of winning an amount T before losing everything, starting with state x. Show that this problem may be considered to be an absorbing Markov chain with states 0, 1, 2, . . . , T with 0 and T absorbing states. Suppose that a gambler has probability p = .48 of winning on each play. Suppose, in addition, that the gambler starts with 50 dollars and that T = 100 dollars. Simulate this game 100 times and see how often the gambler is ruined. This estimates w50. 24 Show that wx of Exercise 23 satisfies the following conditions: (a) wx = pwx+1 + qwx−1 for x = 1, 2, . . . , T −1. (b) w0 = 0. (c) wT = 1. Show that these conditions determine wx. Show that, if p = q = 1/2, then wx = x T satisfies (a), (b), and (c) and hence is the solution. If p ̸= q, show that wx = (q/p)x −1 (q/p)T −1 satisfies these conditions and hence gives the probability of the gambler win- ning. 25 Write a program to compute the probability wx of Exercise 24 for given values of x, p, and T. Study the probability that the gambler will ruin the bank in a game that is only slightly unfavorable, say p = .49, if the bank has significantly more money than the gambler. *26 We considered the two examples of the Drunkard’s Walk corresponding to the cases n = 4 and n = 5 blocks (see Example 11.13). Verify that in these two examples the expected time to absorption, starting at x, is equal to x(n −x). See if you can prove that this is true in general. Hint: Show that if f(x) is the expected time to absorption then f(0) = f(n) = 0 and f(x) = (1/2)f(x −1) + (1/2)f(x + 1) + 1 for 0 < x < n. Show that if f1(x) and f2(x) are two solutions, then their difference g(x) is a solution of the equation g(x) = (1/2)g(x −1) + (1/2)g(x + 1) . Also, g(0) = g(n) = 0. Show that it is not possible for g(x) to have a strict maximum or a strict minimum at the point i, where 1 ≤i ≤n −1. Use this to show that g(i) = 0 for all i. This shows that there is at most one solution. Then verify that the function f(x) = x(n −x) is a solution.
prob_Page_435_Chunk5274
428 CHAPTER 11. MARKOV CHAINS 27 Consider an absorbing Markov chain with state space S. Let f be a function defined on S with the property that f(i) = X j∈S pijf(j) , or in vector form f = Pf . Then f is called a harmonic function for P. If you imagine a game in which your fortune is f(i) when you are in state i, then the harmonic condition means that the game is fair in the sense that your expected fortune after one step is the same as it was before the step. (a) Show that for f harmonic f = Pnf for all n. (b) Show, using (a), that for f harmonic f = P∞f , where P∞= lim n→∞Pn =  0 B 0 I  . (c) Using (b), prove that when you start in a transient state i your expected final fortune X k bikf(k) is equal to your starting fortune f(i). In other words, a fair game on a finite state space remains fair to the end. (Fair games in general are called martingales. Fair games on infinite state spaces need not remain fair with an unlimited number of plays allowed. For example, consider the game of Heads or Tails (see Example 1.4). Let Peter start with 1 penny and play until he has 2. Then Peter will be sure to end up 1 penny ahead.) 28 A coin is tossed repeatedly. We are interested in finding the expected number of tosses until a particular pattern, say B = HTH, occurs for the first time. If, for example, the outcomes of the tosses are HHTTHTH we say that the pattern B has occurred for the first time after 7 tosses. Let T B be the time to obtain pattern B for the first time. Li9 gives the following method for determining E(T B). We are in a casino and, before each toss of the coin, a gambler enters, pays 1 dollar to play, and bets that the pattern B = HTH will occur on the next 9S-Y. R. Li, “A Martingale Approach to the Study of Occurrence of Sequence Patterns in Repeated Experiments,” Annals of Probability, vol. 8 (1980), pp. 1171–1176.
prob_Page_436_Chunk5275
11.2. ABSORBING MARKOV CHAINS 429 three tosses. If H occurs, he wins 2 dollars and bets this amount that the next outcome will be T. If he wins, he wins 4 dollars and bets this amount that H will come up next time. If he wins, he wins 8 dollars and the pattern has occurred. If at any time he loses, he leaves with no winnings. Let A and B be two patterns. Let AB be the amount the gamblers win who arrive while the pattern A occurs and bet that B will occur. For example, if A = HT and B = HTH then AB = 2 + 4 = 6 since the first gambler bet on H and won 2 dollars and then bet on T and won 4 dollars more. The second gambler bet on H and lost. If A = HH and B = HTH, then AB = 2 since the first gambler bet on H and won but then bet on T and lost and the second gambler bet on H and won. If A = B = HTH then AB = BB = 8 + 2 = 10. Now for each gambler coming in, the casino takes in 1 dollar. Thus the casino takes in T B dollars. How much does it pay out? The only gamblers who go offwith any money are those who arrive during the time the pattern B occurs and they win the amount BB. But since all the bets made are perfectly fair bets, it seems quite intuitive that the expected amount the casino takes in should equal the expected amount that it pays out. That is, E(T B) = BB. Since we have seen that for B = HTH, BB = 10, the expected time to reach the pattern HTH for the first time is 10. If we had been trying to get the pattern B = HHH, then BB = 8 + 4 + 2 = 14 since all the last three gamblers are paid offin this case. Thus the expected time to get the pattern HHH is 14. To justify this argument, Li used a theorem from the theory of martingales (fair games). We can obtain these expectations by considering a Markov chain whose states are the possible initial segments of the sequence HTH; these states are HTH, HT, H, and ∅, where ∅is the empty set. Then, for this example, the transition matrix is     HTH HT H ∅ HTH 1 0 0 0 HT .5 0 0 .5 H 0 .5 .5 0 ∅ 0 0 .5 .5    , and if B = HTH, E(T B) is the expected time to absorption for this chain started in state ∅. Show, using the associated Markov chain, that the values E(T B) = 10 and E(T B) = 14 are correct for the expected time to reach the patterns HTH and HHH, respectively. 29 We can use the gambling interpretation given in Exercise 28 to find the ex- pected number of tosses required to reach pattern B when we start with pat- tern A. To be a meaningful problem, we assume that pattern A does not have pattern B as a subpattern. Let EA(T B) be the expected time to reach pattern B starting with pattern A. We use our gambling scheme and assume that the first k coin tosses produced the pattern A. During this time, the gamblers
prob_Page_437_Chunk5276
430 CHAPTER 11. MARKOV CHAINS made an amount AB. The total amount the gamblers will have made when the pattern B occurs is BB. Thus, the amount that the gamblers made after the pattern A has occurred is BB - AB. Again by the fair game argument, EA(T B) = BB-AB. For example, suppose that we start with pattern A = HT and are trying to get the pattern B = HTH. Then we saw in Exercise 28 that AB = 4 and BB = 10 so EA(T B) = BB-AB= 6. Verify that this gambling interpretation leads to the correct answer for all starting states in the examples that you worked in Exercise 28. 30 Here is an elegant method due to Guibas and Odlyzko10 to obtain the expected time to reach a pattern, say HTH, for the first time. Let f(n) be the number of sequences of length n which do not have the pattern HTH. Let fp(n) be the number of sequences that have the pattern for the first time after n tosses. To each element of f(n), add the pattern HTH. Then divide the resulting sequences into three subsets: the set where HTH occurs for the first time at time n + 1 (for this, the original sequence must have ended with HT); the set where HTH occurs for the first time at time n + 2 (cannot happen for this pattern); and the set where the sequence HTH occurs for the first time at time n + 3 (the original sequence ended with anything except HT). Doing this, we have f(n) = fp(n + 1) + fp(n + 3) . Thus, f(n) 2n = 2fp(n + 1) 2n+1 + 23fp(n + 3) 2n+3 . If T is the time that the pattern occurs for the first time, this equality states that P(T > n) = 2P(T = n + 1) + 8P(T = n + 3) . Show that if you sum this equality over all n you obtain ∞ X n=0 P(T > n) = 2 + 8 = 10 . Show that for any integer-valued random variable E(T) = ∞ X n=0 P(T > n) , and conclude that E(T) = 10. Note that this method of proof makes very clear that E(T) is, in general, equal to the expected amount the casino pays out and avoids the martingale system theorem used by Li. 10L. J. Guibas and A. M. Odlyzko, “String Overlaps, Pattern Matching, and Non-transitive Games,” Journal of Combinatorial Theory, Series A, vol. 30 (1981), pp. 183–208.
prob_Page_438_Chunk5277
11.2. ABSORBING MARKOV CHAINS 431 31 In Example 11.11, define f(i) to be the proportion of G genes in state i. Show that f is a harmonic function (see Exercise 27). Why does this show that the probability of being absorbed in state (GG, GG) is equal to the proportion of G genes in the starting state? (See Exercise 17.) 32 Show that the stepping stone model (Example 11.12) is an absorbing Markov chain. Assume that you are playing a game with red and green squares, in which your fortune at any time is equal to the proportion of red squares at that time. Give an argument to show that this is a fair game in the sense that your expected winning after each step is just what it was before this step.Hint: Show that for every possible outcome in which your fortune will decrease by one there is another outcome of exactly the same probability where it will increase by one. Use this fact and the results of Exercise 27 to show that the probability that a particular color wins out is equal to the proportion of squares that are initially of this color. 33 Consider a random walker who moves on the integers 0, 1, . . . , N, moving one step to the right with probability p and one step to the left with probability q = 1 −p. If the walker ever reaches 0 or N he stays there. (This is the Gambler’s Ruin problem of Exercise 23.) If p = q show that the function f(i) = i is a harmonic function (see Exercise 27), and if p ̸= q then f(i) = q p i is a harmonic function. Use this and the result of Exercise 27 to show that the probability biN of being absorbed in state N starting in state i is biN = ( i N , if p = q, ( q p )i−1 ( q p )N−1, if p ̸= q. For an alternative derivation of these results see Exercise 24. 34 Complete the following alternate proof of Theorem 11.6. Let si be a tran- sient state and sj be an absorbing state. If we compute bij in terms of the possibilities on the outcome of the first step, then we have the equation bij = pij + X k pikbkj , where the summation is carried out over all transient states sk. Write this in matrix form, and derive from this equation the statement B = NR .
prob_Page_439_Chunk5278
432 CHAPTER 11. MARKOV CHAINS 35 In Monte Carlo roulette (see Example 6.6), under option (c), there are six states (S, W, L, E, P1, and P2). The reader is referred to Figure 6.2, which contains a tree for this option. Form a Markov chain for this option, and use the program AbsorbingChain to find the probabilities that you win, lose, or break even for a 1 franc bet on red. Using these probabilities, find the expected winnings for this bet. For a more general discussion of Markov chains applied to roulette, see the article of H. Sagan referred to in Example 6.13. 36 We consider next a game called Penney-ante by its inventor W. Penney.11 There are two players; the first player picks a pattern A of H’s and T’s, and then the second player, knowing the choice of the first player, picks a different pattern B. We assume that neither pattern is a subpattern of the other pattern. A coin is tossed a sequence of times, and the player whose pattern comes up first is the winner. To analyze the game, we need to find the probability pA that pattern A will occur before pattern B and the probability pB = 1 −pA that pattern B occurs before pattern A. To determine these probabilities we use the results of Exercises 28 and 29. Here you were asked to show that, the expected time to reach a pattern B for the first time is, E(T B) = BB , and, starting with pattern A, the expected time to reach pattern B is EA(T B) = BB −AB . (a) Show that the odds that the first player will win are given by John Conway’s formula12: pA 1 −pA = pA pB = BB −BA AA −AB . Hint: Explain why E(T B) = E(T A or B) + pAEA(T B) and thus BB = E(T A or B) + pA(BB −AB) . Interchange A and B to find a similar equation involving the pB. Finally, note that pA + pB = 1 . Use these equations to solve for pA and pB. (b) Assume that both players choose a pattern of the same length k. Show that, if k = 2, this is a fair game, but, if k = 3, the second player has an advantage no matter what choice the first player makes. (It has been shown that, for k ≥3, if the first player chooses a1, a2, . . . , ak, then the optimal strategy for the second player is of the form b, a1, . . . , ak−1 where b is the better of the two choices H or T.13) 11W. Penney, “Problem: Penney-Ante,” Journal of Recreational Math, vol. 2 (1969), p. 241. 12M. Gardner, “Mathematical Games,” Scientific American, vol. 10 (1974), pp. 120–125. 13Guibas and Odlyzko, op. cit.
prob_Page_440_Chunk5279
11.3. ERGODIC MARKOV CHAINS 433 11.3 Ergodic Markov Chains A second important kind of Markov chain we shall study in detail is an ergodic Markov chain, defined as follows. Definition 11.4 A Markov chain is called an ergodic chain if it is possible to go from every state to every state (not necessarily in one move). 2 In many books, ergodic Markov chains are called irreducible. Definition 11.5 A Markov chain is called a regular chain if some power of the transition matrix has only positive elements. 2 In other words, for some n, it is possible to go from any state to any state in exactly n steps. It is clear from this definition that every regular chain is ergodic. On the other hand, an ergodic chain is not necessarily regular, as the following examples show. Example 11.16 Let the transition matrix of a Markov chain be defined by P =  1 2 1 0 1 2 1 0  . Then is clear that it is possible to move from any state to any state, so the chain is ergodic. However, if n is odd, then it is not possible to move from state 0 to state 0 in n steps, and if n is even, then it is not possible to move from state 0 to state 1 in n steps, so the chain is not regular. 2 A more interesting example of an ergodic, non-regular Markov chain is provided by the Ehrenfest urn model. Example 11.17 Recall the Ehrenfest urn model (Example 11.8). The transition matrix for this example is P =       0 1 2 3 4 0 0 1 0 0 0 1 1/4 0 3/4 0 0 2 0 1/2 0 1/2 0 3 0 0 3/4 0 1/4 4 0 0 0 1 0       . In this example, if we start in state 0 we will, after any even number of steps, be in either state 0, 2 or 4, and after any odd number of steps, be in states 1 or 3. Thus this chain is ergodic but not regular. 2
prob_Page_441_Chunk5280
434 CHAPTER 11. MARKOV CHAINS Regular Markov Chains Any transition matrix that has no zeros determines a regular Markov chain. How- ever, it is possible for a regular Markov chain to have a transition matrix that has zeros. The transition matrix of the Land of Oz example of Section 11.1 has pNN = 0 but the second power P2 has no zeros, so this is a regular Markov chain. An example of a nonregular Markov chain is an absorbing chain. For example, let P =  1 0 1/2 1/2  be the transition matrix of a Markov chain. Then all powers of P will have a 0 in the upper right-hand corner. We shall now discuss two important theorems relating to regular chains. Theorem 11.7 Let P be the transition matrix for a regular chain. Then, as n → ∞, the powers Pn approach a limiting matrix W with all rows the same vector w. The vector w is a strictly positive probability vector (i.e., the components are all positive and they sum to one). 2 In the next section we give two proofs of this fundamental theorem. We give here the basic idea of the first proof. We want to show that the powers Pn of a regular transition matrix tend to a matrix with all rows the same. This is the same as showing that Pn converges to a matrix with constant columns. Now the jth column of Pn is Pny where y is a column vector with 1 in the jth entry and 0 in the other entries. Thus we need only prove that for any column vector y, Pny approaches a constant vector as n tend to infinity. Since each row of P is a probability vector, Py replaces y by averages of its components. Here is an example:   1/2 1/4 1/4 1/3 1/3 1/3 1/2 1/2 0     1 2 3  =   1/2 · 1 + 1/4 · 2 + 1/4 · 3 1/3 · 1 + 1/3 · 2 + 1/3 · 3 1/2 · 1 + 1/2 · 2 + 0 · 3  =   7/4 2 3/2  . The result of the averaging process is to make the components of Py more similar than those of y. In particular, the maximum component decreases (from 3 to 2) and the minimum component increases (from 1 to 3/2). Our proof will show that as we do more and more of this averaging to get Pny, the difference between the maximum and minimum component will tend to 0 as n →∞. This means Pny tends to a constant vector. The ijth entry of Pn, p(n) ij , is the probability that the process will be in state sj after n steps if it starts in state si. If we denote the common row of W by w, then Theorem 11.7 states that the probability of being in sj in the long run is approximately wj, the jth entry of w, and is independent of the starting state.
prob_Page_442_Chunk5281
11.3. ERGODIC MARKOV CHAINS 435 Example 11.18 Recall that for the Land of Oz example of Section 11.1, the sixth power of the transition matrix P is, to three decimal places, P6 =   R N S R .4 .2 .4 N .4 .2 .4 S .4 .2 .4  . Thus, to this degree of accuracy, the probability of rain six days after a rainy day is the same as the probability of rain six days after a nice day, or six days after a snowy day. Theorem 11.7 predicts that, for large n, the rows of P approach a common vector. It is interesting that this occurs so soon in our example. 2 Theorem 11.8 Let P be a regular transition matrix, let W = lim n→∞Pn , let w be the common row of W, and let c be the column vector all of whose components are 1. Then (a) wP = w, and any row vector v such that vP = v is a constant multiple of w. (b) Pc = c, and any column vector x such that Px = x is a multiple of c. Proof. To prove part (a), we note that from Theorem 11.7, Pn →W . Thus, Pn+1 = Pn · P →WP . But Pn+1 →W, and so W = WP, and w = wP. Let v be any vector with vP = v. Then v = vPn, and passing to the limit, v = vW. Let r be the sum of the components of v. Then it is easily checked that vW = rw. So, v = rw. To prove part (b), assume that x = Px. Then x = Pnx, and again passing to the limit, x = Wx. Since all rows of W are the same, the components of Wx are all equal, so x is a multiple of c. 2 Note that an immediate consequence of Theorem 11.8 is the fact that there is only one probability vector v such that vP = v. Fixed Vectors Definition 11.6 A row vector w with the property wP = w is called a fixed row vector for P. Similarly, a column vector x such that Px = x is called a fixed column vector for P. 2
prob_Page_443_Chunk5282
436 CHAPTER 11. MARKOV CHAINS Thus, the common row of W is the unique vector w which is both a fixed row vector for P and a probability vector. Theorem 11.8 shows that any fixed row vector for P is a multiple of w and any fixed column vector for P is a constant vector. One can also state Definition 11.6 in terms of eigenvalues and eigenvectors. A fixed row vector is a left eigenvector of the matrix P corresponding to the eigenvalue 1. A similar statement can be made about fixed column vectors. We will now give several different methods for calculating the fixed row vector w for a regular Markov chain. Example 11.19 By Theorem 11.7 we can find the limiting vector w for the Land of Oz from the fact that w1 + w2 + w3 = 1 and ( w1 w2 w3 )   1/2 1/4 1/4 1/2 0 1/2 1/4 1/4 1/2  = ( w1 w2 w3 ) . These relations lead to the following four equations in three unknowns: w1 + w2 + w3 = 1 , (1/2)w1 + (1/2)w2 + (1/4)w3 = w1 , (1/4)w1 + (1/4)w3 = w2 , (1/4)w1 + (1/2)w2 + (1/2)w3 = w3 . Our theorem guarantees that these equations have a unique solution. If the equations are solved, we obtain the solution w = ( .4 .2 .4 ) , in agreement with that predicted from P6, given in Example 11.2. 2 To calculate the fixed vector, we can assume that the value at a particular state, say state one, is 1, and then use all but one of the linear equations from wP = w. This set of equations will have a unique solution and we can obtain w from this solution by dividing each of its entries by their sum to give the probability vector w. We will now illustrate this idea for the above example. Example 11.20 (Example 11.19 continued) We set w1 = 1, and then solve the first and second linear equations from wP = w. We have (1/2) + (1/2)w2 + (1/4)w3 = 1 , (1/4) + (1/4)w3 = w2 . If we solve these, we obtain ( w1 w2 w3 ) = ( 1 1/2 1 ) .
prob_Page_444_Chunk5283
11.3. ERGODIC MARKOV CHAINS 437 Now we divide this vector by the sum of the components, to obtain the final answer: w = ( .4 .2 .4 ) . This method can be easily programmed to run on a computer. 2 As mentioned above, we can also think of the fixed row vector w as a left eigenvector of the transition matrix P. Thus, if we write I to denote the identity matrix, then w satisfies the matrix equation wP = wI , or equivalently, w(P −I) = 0 . Thus, w is in the left nullspace of the matrix P −I. Furthermore, Theorem 11.8 states that this left nullspace has dimension 1. Certain computer programming languages can find nullspaces of matrices. In such languages, one can find the fixed row probability vector for a matrix P by computing the left nullspace and then normalizing a vector in the nullspace so the sum of its components is 1. The program FixedVector uses one of the above methods (depending upon the language in which it is written) to calculate the fixed row probability vector for regular Markov chains. So far we have always assumed that we started in a specific state. The following theorem generalizes Theorem 11.7 to the case where the starting state is itself determined by a probability vector. Theorem 11.9 Let P be the transition matrix for a regular chain and v an arbi- trary probability vector. Then lim n→∞vPn = w , where w is the unique fixed probability vector for P. Proof. By Theorem 11.7, lim n→∞Pn = W . Hence, lim n→∞vPn = vW . But the entries in v sum to 1, and each row of W equals w. From these statements, it is easy to check that vW = w . 2 If we start a Markov chain with initial probabilities given by v, then the proba- bility vector vPn gives the probabilities of being in the various states after n steps. Theorem 11.9 then establishes the fact that, even in this more general class of processes, the probability of being in sj approaches wj.
prob_Page_445_Chunk5284
438 CHAPTER 11. MARKOV CHAINS Equilibrium We also obtain a new interpretation for w. Suppose that our starting vector picks state si as a starting state with probability wi, for all i. Then the probability of being in the various states after n steps is given by wPn = w, and is the same on all steps. This method of starting provides us with a process that is called “stationary.” The fact that w is the only probability vector for which wP = w shows that we must have a starting probability vector of exactly the kind described to obtain a stationary process. Many interesting results concerning regular Markov chains depend only on the fact that the chain has a unique fixed probability vector which is positive. This property holds for all ergodic Markov chains. Theorem 11.10 For an ergodic Markov chain, there is a unique probability vec- tor w such that wP = w and w is strictly positive. Any row vector such that vP = v is a multiple of w. Any column vector x such that Px = x is a constant vector. Proof. This theorem states that Theorem 11.8 is true for ergodic chains. The result follows easily from the fact that, if P is an ergodic transition matrix, then ¯P = (1/2)I + (1/2)P is a regular transition matrix with the same fixed vectors (see Exercises 25–28). 2 For ergodic chains, the fixed probability vector has a slightly different inter- pretation. The following two theorems, which we will not prove here, furnish an interpretation for this fixed vector. Theorem 11.11 Let P be the transition matrix for an ergodic chain. Let An be the matrix defined by An = I + P + P2 + · · · + Pn n + 1 . Then An →W, where W is a matrix all of whose rows are equal to the unique fixed probability vector w for P. 2 If P is the transition matrix of an ergodic chain, then Theorem 11.8 states that there is only one fixed row probability vector for P. Thus, we can use the same techniques that were used for regular chains to solve for this fixed vector. In particular, the program FixedVector works for ergodic chains. To interpret Theorem 11.11, let us assume that we have an ergodic chain that starts in state si. Let X(m) = 1 if the mth step is to state sj and 0 otherwise. Then the average number of times in state sj in the first n steps is given by H(n) = X(0) + X(1) + X(2) + · · · + X(n) n + 1 . But X(m) takes on the value 1 with probability p(m) ij and 0 otherwise. Thus E(X(m)) = p(m) ij , and the ijth entry of An gives the expected value of H(n), that
prob_Page_446_Chunk5285
11.3. ERGODIC MARKOV CHAINS 439 is, the expected proportion of times in state sj in the first n steps if the chain starts in state si. If we call being in state sj success and any other state failure, we could ask if a theorem analogous to the law of large numbers for independent trials holds. The answer is yes and is given by the following theorem. Theorem 11.12 (Law of Large Numbers for Ergodic Markov Chains) Let H(n) j be the proportion of times in n steps that an ergodic chain is in state sj. Then for any ϵ > 0, P  |H(n) j −wj| > ϵ  →0 , independent of the starting state si. 2 We have observed that every regular Markov chain is also an ergodic chain. Hence, Theorems 11.11 and 11.12 apply also for regular chains. For example, this gives us a new interpretation for the fixed vector w = (.4, .2, .4) in the Land of Oz example. Theorem 11.11 predicts that, in the long run, it will rain 40 percent of the time in the Land of Oz, be nice 20 percent of the time, and snow 40 percent of the time. Simulation We illustrate Theorem 11.12 by writing a program to simulate the behavior of a Markov chain. SimulateChain is such a program. Example 11.21 In the Land of Oz, there are 525 days in a year. We have simulated the weather for one year in the Land of Oz, using the program SimulateChain. The results are shown in Table 11.2. SSRNRNSSSSSSNRSNSSRNSRNSSSNSRRRNSSSNRRSSSSNRSSNSRRRRRRNSSS SSRRRSNSNRRRRSRSRNSNSRRNRRNRSSNSRNRNSSRRSRNSSSNRSRRSSNRSNR RNSSSSNSSNSRSRRNSSNSSRNSSRRNRRRSRNRRRNSSSNRNSRNSNRNRSSSRSS NRSSSNSSSSSSNSSSNSNSRRNRNRRRRSRRRSSSSNRRSSSSRSRRRNRRRSSSSR RNRRRSRSSRRRRSSRNRRRRRRNSSRNRSSSNRNSNRRRRNRRRNRSNRRNSRRSNR RRRSSSRNRRRNSNSSSSSRRRRSRNRSSRRRRSSSRRRNRNRRRSRSRNSNSSRRRR RNSNRNSNRRNRRRRRRSSSNRSSRSNRSSSNSNRNSNSSSNRRSRRRNRRRRNRNRS SSNSRSNRNRRSNRRNSRSSSRNSRRSSNSRRRNRRSNRRNSSSSSNRNSSSSSSSNR NSRRRNSSRRRNSSSNRRSRNSSRRNRRNRSNRRRRRRRRRNSNRRRRRNSRRSSSSN SNS State Times Fraction R 217 .413 N 109 .208 S 199 .379 Table 11.2: Weather in the Land of Oz.
prob_Page_447_Chunk5286
440 CHAPTER 11. MARKOV CHAINS We note that the simulation gives a proportion of times in each of the states not too different from the long run predictions of .4, .2, and .4 assured by Theorem 11.7. To get better results we have to simulate our chain for a longer time. We do this for 10,000 days without printing out each day’s weather. The results are shown in Table 11.3. We see that the results are now quite close to the theoretical values of .4, .2, and .4. State Times Fraction R 4010 .401 N 1902 .19 S 4088 .409 Table 11.3: Comparison of observed and predicted frequencies for the Land of Oz. 2 Examples of Ergodic Chains The computation of the fixed vector w may be difficult if the transition matrix is very large. It is sometimes useful to guess the fixed vector on purely intuitive grounds. Here is a simple example to illustrate this kind of situation. Example 11.22 A white rat is put into the maze of Figure 11.4. There are nine compartments with connections between the compartments as indicated. The rat moves through the compartments at random. That is, if there are k ways to leave a compartment, it chooses each of these with equal probability. We can represent the travels of the rat by a Markov chain process with transition matrix given by P =                1 2 3 4 5 6 7 8 9 1 0 1/2 0 0 0 1/2 0 0 0 2 1/3 0 1/3 0 1/3 0 0 0 0 3 0 1/2 0 1/2 0 0 0 0 0 4 0 0 1/3 0 1/3 0 0 0 1/3 5 0 1/4 0 1/4 0 1/4 0 1/4 0 6 1/3 0 0 0 1/3 0 1/3 0 0 7 0 0 0 0 0 1/2 0 1/2 0 8 0 0 0 0 1/3 0 1/3 0 1/3 9 0 0 0 1/2 0 0 0 1/2 0                . That this chain is not regular can be seen as follows: From an odd-numbered state the process can go only to an even-numbered state, and from an even-numbered state it can go only to an odd number. Hence, starting in state i the process will be alternately in even-numbered and odd-numbered states. Therefore, odd powers of P will have 0’s for the odd-numbered entries in row 1. On the other hand, a glance at the maze shows that it is possible to go from every state to every other state, so that the chain is ergodic.
prob_Page_448_Chunk5287
11.3. ERGODIC MARKOV CHAINS 441 1 2 3 4 5 6 7 8 9 Figure 11.4: The maze problem. To find the fixed probability vector for this matrix, we would have to solve ten equations in nine unknowns. However, it would seem reasonable that the times spent in each compartment should, in the long run, be proportional to the number of entries to each compartment. Thus, we try the vector whose jth component is the number of entries to the jth compartment: x = ( 2 3 2 3 4 3 2 3 2 ) . It is easy to check that this vector is indeed a fixed vector so that the unique probability vector is this vector normalized to have sum 1: w = ( 1 12 1 8 1 12 1 8 1 6 1 8 1 12 1 8 1 12 ) . 2 Example 11.23 (Example 11.8 continued) We recall the Ehrenfest urn model of Example 11.8. The transition matrix for this chain is as follows: P =       0 1 2 3 4 0 .000 1.000 .000 .000 .000 1 .250 .000 .750 .000 .000 2 .000 .500 .000 .500 .000 3 .000 .000 .750 .000 .250 4 .000 .000 .000 1.000 .000       . If we run the program FixedVector for this chain, we obtain the vector w =
prob_Page_449_Chunk5288
442 CHAPTER 11. MARKOV CHAINS times in state 0 is .0625 and the proportion of times in state 1 is .375. The astute reader will note that these numbers are the binomial distribution 1/16, 4/16, 6/16, 4/16, 1/16. We could have guessed this answer as follows: If we consider a particular ball, it simply moves randomly back and forth between the two urns. This suggests that the equilibrium state should be just as if we randomly distributed the four balls in the two urns. If we did this, the probability that there would be exactly j balls in one urn would be given by the binomial distribution b(n, p, j) with n = 4 and p = 1/2. 2 Exercises 1 Which of the following matrices are transition matrices for regular Markov chains? (a) P =  .5 .5 .5 .5  . (b) P =  .5 .5 1 0  . (c) P =   1/3 0 2/3 0 1 0 0 1/5 4/5  . (d) P =  0 1 1 0  . (e) P =   1/2 1/2 0 0 1/2 1/2 1/3 1/3 1/3  . 2 Consider the Markov chain with transition matrix P =   1/2 1/3 1/6 3/4 0 1/4 0 1 0  . (a) Show that this is a regular Markov chain. (b) The process is started in state 1; find the probability that it is in state 3 after two steps. (c) Find the limiting probability vector w. 3 Consider the Markov chain with general 2 × 2 transition matrix P =  1 −a a b 1 −b  . (a) Under what conditions is P absorbing? (b) Under what conditions is P ergodic but not regular? (c) Under what conditions is P regular?
prob_Page_450_Chunk5289
11.3. ERGODIC MARKOV CHAINS 443 4 Find the fixed probability vector w for the matrices in Exercise 3 that are ergodic. 5 Find the fixed probability vector w for each of the following regular matrices. (a) P =  .75 .25 .5 .5  . (b) P =  .9 .1 .1 .9  . (c) P =   3/4 1/4 0 0 2/3 1/3 1/4 1/4 1/2  . 6 Consider the Markov chain with transition matrix in Exercise 3, with a = b = 1. Show that this chain is ergodic but not regular. Find the fixed probability vector and interpret it. Show that Pn does not tend to a limit, but that An = I + P + P2 + · · · + Pn n + 1 does. 7 Consider the Markov chain with transition matrix of Exercise 3, with a = 0 and b = 1/2. Compute directly the unique fixed probability vector, and use your result to prove that the chain is not ergodic. 8 Show that the matrix P =   1 0 0 1/4 1/2 1/4 0 0 1   has more than one fixed probability vector. Find the matrix that Pn ap- proaches as n →∞, and verify that it is not a matrix all of whose rows are the same. 9 Prove that, if a 3-by-3 transition matrix has the property that its column sums are 1, then (1/3, 1/3, 1/3) is a fixed probability vector. State a similar result for n-by-n transition matrices. Interpret these results for ergodic chains. 10 Is the Markov chain in Example 11.10 ergodic? 11 Is the Markov chain in Example 11.11 ergodic? 12 Consider Example 11.13 (Drunkard’s Walk). Assume that if the walker reaches state 0, he turns around and returns to state 1 on the next step and, simi- larly, if he reaches 4 he returns on the next step to state 3. Is this new chain ergodic? Is it regular? 13 For Example 11.4 when P is ergodic, what is the proportion of people who are told that the President will run? Interpret the fact that this proportion is independent of the starting state.
prob_Page_451_Chunk5290
444 CHAPTER 11. MARKOV CHAINS 14 Consider an independent trials process to be a Markov chain whose states are the possible outcomes of the individual trials. What is its fixed probability vector? Is the chain always regular? Illustrate this for Example 11.5. 15 Show that Example 11.8 is an ergodic chain, but not a regular chain. Show that its fixed probability vector w is a binomial distribution. 16 Show that Example 11.9 is regular and find the limiting vector. 17 Toss a fair die repeatedly. Let Sn denote the total of the outcomes through the nth toss. Show that there is a limiting value for the proportion of the first n values of Sn that are divisible by 7, and compute the value for this limit. Hint: The desired limit is an equilibrium probability vector for an appropriate seven state Markov chain. 18 Let P be the transition matrix of a regular Markov chain. Assume that there are r states and let N(r) be the smallest integer n such that P is regular if and only if PN(r) has no zero entries. Find a finite upper bound for N(r). See if you can determine N(3) exactly. *19 Define f(r) to be the smallest integer n such that for all regular Markov chains with r states, the nth power of the transition matrix has all entries positive. It has been shown,14 that f(r) = r2 −2r + 2. (a) Define the transition matrix of an r-state Markov chain as follows: For states si, with i = 1, 2, . . . , r−2, P(i, i+1) = 1, P(r−1, r) = P(r−1, 1) = 1/2, and P(r, 1) = 1. Show that this is a regular Markov chain. (b) For r = 3, verify that the fifth power is the first power that has no zeros. (c) Show that, for general r, the smallest n such that Pn has all entries positive is n = f(r). 20 A discrete time queueing system of capacity n consists of the person being served and those waiting to be served. The queue length x is observed each second. If 0 < x < n, then with probability p, the queue size is increased by one by an arrival and, inependently, with probability r, it is decreased by one because the person being served finishes service. If x = 0, only an arrival (with probability p) is possible. If x = n, an arrival will depart without waiting for service, and so only the departure (with probability r) of the person being served is possible. Form a Markov chain with states given by the number of customers in the queue. Modify the program FixedVector so that you can input n, p, and r, and the program will construct the transition matrix and compute the fixed vector. The quantity s = p/r is called the traffic intensity. Describe the differences in the fixed vectors according as s < 1, s = 1, or s > 1. 14E. Seneta, Non-Negative Matrices: An Introduction to Theory and Applications, Wiley, New York, 1973, pp. 52-54.
prob_Page_452_Chunk5291
11.3. ERGODIC MARKOV CHAINS 445 21 Write a computer program to simulate the queue in Exercise 20. Have your program keep track of the proportion of the time that the queue length is j for j = 0, 1, . . . , n and the average queue length. Show that the behavior of the queue length is very different depending upon whether the traffic intensity s has the property s < 1, s = 1, or s > 1. 22 In the queueing problem of Exercise 20, let S be the total service time required by a customer and T the time between arrivals of the customers. (a) Show that P(S = j) = (1 −r)j−1r and P(T = j) = (1 −p)j−1p, for j > 0. (b) Show that E(S) = 1/r and E(T) = 1/p. (c) Interpret the conditions s < 1, s = 1 and s > 1 in terms of these expected values. 23 In Exercise 20 the service time S has a geometric distribution with E(S) = 1/r. Assume that the service time is, instead, a constant time of t seconds. Modify your computer program of Exercise 21 so that it simulates a constant time service distribution. Compare the average queue length for the two types of distributions when they have the same expected service time (i.e., take t = 1/r). Which distribution leads to the longer queues on the average? 24 A certain experiment is believed to be described by a two-state Markov chain with the transition matrix P, where P =  .5 .5 p 1 −p  and the parameter p is not known. When the experiment is performed many times, the chain ends in state one approximately 20 percent of the time and in state two approximately 80 percent of the time. Compute a sensible estimate for the unknown parameter p and explain how you found it. 25 Prove that, in an r-state ergodic chain, it is possible to go from any state to any other state in at most r −1 steps. 26 Let P be the transition matrix of an r-state ergodic chain. Prove that, if the diagonal entries pii are positive, then the chain is regular. 27 Prove that if P is the transition matrix of an ergodic chain, then (1/2)(I+P) is the transition matrix of a regular chain. Hint: Use Exercise 26. 28 Prove that P and (1/2)(I + P) have the same fixed vectors. 29 In his book, Wahrscheinlichkeitsrechnung und Statistik,15 A. Engle proposes an algorithm for finding the fixed vector for an ergodic Markov chain when the transition probabilities are rational numbers. Here is his algorithm: For 15A. Engle, Wahrscheinlichkeitsrechnung und Statistik, vol. 2 (Stuttgart: Klett Verlag, 1976).
prob_Page_453_Chunk5292
446 CHAPTER 11. MARKOV CHAINS (4 2 4) (5 2 3) (8 2 4) (7 3 4) (8 4 4) (8 3 5) (8 4 8) (10 4 6) (12 4 8) (12 5 7) (12 6 8) (13 5 8) (16 6 8) (15 6 9) (16 6 12) (17 7 10) (20 8 12) (20 8 12) . Table 11.4: Distribution of chips. each state i, let ai be the least common multiple of the denominators of the non-zero entries in the ith row. Engle describes his algorithm in terms of mov- ing chips around on the states—indeed, for small examples, he recommends implementing the algorithm this way. Start by putting ai chips on state i for all i. Then, at each state, redistribute the ai chips, sending aipij to state j. The number of chips at state i after this redistribution need not be a multiple of ai. For each state i, add just enough chips to bring the number of chips at state i up to a multiple of ai. Then redistribute the chips in the same manner. This process will eventually reach a point where the number of chips at each state, after the redistribution, is the same as before redistribution. At this point, we have found a fixed vector. Here is an example: P =   1 2 3 1 1/2 1/4 1/4 2 1/2 0 1/2 3 1/2 1/4 1/4  . We start with a = (4, 2, 4). The chips after successive redistributions are shown in Table 11.4. We find that a = (20, 8, 12) is a fixed vector. (a) Write a computer program to implement this algorithm. (b) Prove that the algorithm will stop. Hint: Let b be a vector with integer components that is a fixed vector for P and such that each coordinate of
prob_Page_454_Chunk5293
11.4. FUNDAMENTAL LIMIT THEOREM 447 the starting vector a is less than or equal to the corresponding component of b. Show that, in the iteration, the components of the vectors are always increasing, and always less than or equal to the corresponding component of b. 30 (Coffman, Kaduta, and Shepp16) A computing center keeps information on a tape in positions of unit length. During each time unit there is one request to occupy a unit of tape. When this arrives the first free unit is used. Also, during each second, each of the units that are occupied is vacated with probability p. Simulate this process, starting with an empty tape. Estimate the expected number of sites occupied for a given value of p. If p is small, can you choose the tape long enough so that there is a small probability that a new job will have to be turned away (i.e., that all the sites are occupied)? Form a Markov chain with states the number of sites occupied. Modify the program FixedVector to compute the fixed vector. Use this to check your conjecture by simulation. *31 (Alternate proof of Theorem 11.8) Let P be the transition matrix of an ergodic Markov chain. Let x be any column vector such that Px = x. Let M be the maximum value of the components of x. Assume that xi = M. Show that if pij > 0 then xj = M. Use this to prove that x must be a constant vector. 32 Let P be the transition matrix of an ergodic Markov chain. Let w be a fixed probability vector (i.e., w is a row vector with wP = w). Show that if wi = 0 and pji > 0 then wj = 0. Use this to show that the fixed probability vector for an ergodic chain cannot have any 0 entries. 33 Find a Markov chain that is neither absorbing or ergodic. 11.4 Fundamental Limit Theorem for Regular Chains The fundamental limit theorem for regular Markov chains states that if P is a regular transition matrix then lim n→∞Pn = W , where W is a matrix with each row equal to the unique fixed probability row vector w for P. In this section we shall give two very different proofs of this theorem. Our first proof is carried out by showing that, for any column vector y, Pny tends to a constant vector. As indicated in Section 11.3, this will show that Pn converges to a matrix with constant columns or, equivalently, to a matrix with all rows the same. The following lemma says that if an r-by-r transition matrix has no zero entries, and y is any column vector with r entries, then the vector Py has entries which are “closer together” than the entries are in y. 16E. G. Coffman, J. T. Kaduta, and L. A. Shepp, “On the Asymptotic Optimality of First- Storage Allocation,” IEEE Trans. Software Engineering, vol. II (1985), pp. 235-239.
prob_Page_455_Chunk5294
448 CHAPTER 11. MARKOV CHAINS Lemma 11.1 Let P be an r-by-r transition matrix with no zero entries. Let d be the smallest entry of the matrix. Let y be a column vector with r components, the largest of which is M0 and the smallest m0. Let M1 and m1 be the largest and smallest component, respectively, of the vector Py. Then M1 −m1 ≤(1 −2d)(M0 −m0) . Proof. In the discussion following Theorem11.7, it was noted that each entry in the vector Py is a weighted average of the entries in y. The largest weighted average that could be obtained in the present case would occur if all but one of the entries of y have value M0 and one entry has value m0, and this one small entry is weighted by the smallest possible weight, namely d. In this case, the weighted average would equal dm0 + (1 −d)M0 . Similarly, the smallest possible weighted average equals dM0 + (1 −d)m0 . Thus, M1 −m1 ≤  dm0 + (1 −d)M0  −  dM0 + (1 −d)m0  = (1 −2d)(M0 −m0) . This completes the proof of the lemma. 2 We turn now to the proof of the fundamental limit theorem for regular Markov chains. Theorem 11.13 (Fundamental Limit Theorem for Regular Chains) If P is the transition matrix for a regular Markov chain, then lim n→∞Pn = W , where W is matrix with all rows equal. Furthermore, all entries in W are strictly positive. Proof. We prove this theorem for the special case that P has no 0 entries. The extension to the general case is indicated in Exercise 5. Let y be any r-component column vector, where r is the number of states of the chain. We assume that r > 1, since otherwise the theorem is trivial. Let Mn and mn be, respectively, the maximum and minimum components of the vector Pn y. The vector Pny is obtained from the vector Pn−1y by multiplying on the left by the matrix P. Hence each component of Pny is an average of the components of Pn−1y. Thus M0 ≥M1 ≥M2 ≥· · ·
prob_Page_456_Chunk5295
11.4. FUNDAMENTAL LIMIT THEOREM 449 and m0 ≤m1 ≤m2 ≤· · · . Each sequence is monotone and bounded: m0 ≤mn ≤Mn ≤M0 . Hence, each of these sequences will have a limit as n tends to infinity. Let M be the limit of Mn and m the limit of mn. We know that m ≤M. We shall prove that M −m = 0. This will be the case if Mn −mn tends to 0. Let d be the smallest element of P. Since all entries of P are strictly positive, we have d > 0. By our lemma Mn −mn ≤(1 −2d)(Mn−1 −mn−1) . From this we see that Mn −mn ≤(1 −2d)n(M0 −m0) . Since r ≥2, we must have d ≤1/2, so 0 ≤1 −2d < 1, so the difference Mn −mn tends to 0 as n tends to infinity. Since every component of Pny lies between mn and Mn, each component must approach the same number u = M = m. This shows that lim n→∞Pny = u , where u is a column vector all of whose components equal u. Now let y be the vector with jth component equal to 1 and all other components equal to 0. Then Pny is the jth column of Pn. Doing this for each j proves that the columns of Pn approach constant column vectors. That is, the rows of Pn approach a common row vector w, or, lim n→∞Pn = W . It remains to show that all entries in W are strictly positive. As before, let y be the vector with jth component equal to 1 and all other components equal to 0. Then Py is the jth column of P, and this column has all entries strictly positive. The minimum component of the vector Py was defined to be m1, hence m1 > 0. Since m1 ≤m, we have m > 0. Note finally that this value of m is just the jth component of w, so all components of w are strictly positive. 2 Doeblin’s Proof We give now a very different proof of the main part of the fundamental limit theorem for regular Markov chains. This proof was first given by Doeblin,17 a brilliant young mathematician who was killed in his twenties in the Second World War. 17W. Doeblin, “Expos´e de la Th´eorie des Chaines Simple Constantes de Markov `a un Nombre Fini d’Etats,” Rev. Mach. de l’Union Interbalkanique, vol. 2 (1937), pp. 77–105.
prob_Page_457_Chunk5296
450 CHAPTER 11. MARKOV CHAINS Theorem 11.14 Let P be the transition matrix for a regular Markov chain with fixed vector w. Then for any initial probability vector u, uPn →w as n →∞. Proof. Let X0, X1, . . . be a Markov chain with transition matrix P started in state si. Let Y0, Y1, . . . be a Markov chain with transition probability P started with initial probabilities given by w. The X and Y processes are run independently of each other. We consider also a third Markov chain P∗which consists of watching both the X and Y processes. The states for P∗are pairs (si, sj). The transition probabilities are given by P∗[(i, j), (k, l)] = P(i, k) · P(j, l) . Since P is regular there is an N such that PN(i, j) > 0 for all i and j. Thus for the P∗chain it is also possible to go from any state (si, sj) to any other state (sk, sl) in at most N steps. That is P∗is also a regular Markov chain. We know that a regular Markov chain will reach any state in a finite time. Let T be the first time the the chain P∗is in a state of the form (sk, sk). In other words, T is the first time that the X and the Y processes are in the same state. Then we have shown that P[T > n] →0 as n →∞. If we watch the X and Y processes after the first time they are in the same state we would not predict any difference in their long range behavior. Since this will happen no matter how we started these two processes, it seems clear that the long range behaviour should not depend upon the starting state. We now show that this is true. We first note that if n ≥T, then since X and Y are both in the same state at time T, P(Xn = j | n ≥T) = P(Yn = j | n ≥T) . If we multiply both sides of this equation by P(n ≥T), we obtain P(Xn = j, n ≥T) = P(Yn = j, n ≥T) . (11.1) We know that for all n, P(Yn = j) = wj . But P(Yn = j) = P(Yn = j, n ≥T) + P(Yn = j, n < T) , and the second summand on the right-hand side of this equation goes to 0 as n goes to ∞, since P(n < T) goes to 0 as n goes to ∞. So, P(Yn = j, n ≥T) →wj , as n goes to ∞. From Equation 11.1, we see that P(Xn = j, n ≥T) →wj ,
prob_Page_458_Chunk5297
11.4. FUNDAMENTAL LIMIT THEOREM 451 as n goes to ∞. But by similar reasoning to that used above, the difference between this last expression and P(Xn = j) goes to 0 as n goes to ∞. Therefore, P(Xn = j) →wj , as n goes to ∞. This completes the proof. 2 In the above proof, we have said nothing about the rate at which the distributions of the Xn’s approach the fixed distribution w. In fact, it can be shown that18 r X j=1 | P(Xn = j) −wj |≤2P(T > n) . The left-hand side of this inequality can be viewed as the distance between the distribution of the Markov chain after n steps, starting in state si, and the limiting distribution w. Exercises 1 Define P and y by P =  .5 .5 .25 .75  , y =  1 0  . Compute Py, P2y, and P4y and show that the results are approaching a constant vector. What is this vector? 2 Let P be a regular r × r transition matrix and y any r-component column vector. Show that the value of the limiting constant vector for Pny is wy. 3 Let P =   1 0 0 .25 0 .75 0 0 1   be a transition matrix of a Markov chain. Find two fixed vectors of P that are linearly independent. Does this show that the Markov chain is not regular? 4 Describe the set of all fixed column vectors for the chain given in Exercise 3. 5 The theorem that Pn →W was proved only for the case that P has no zero entries. Fill in the details of the following extension to the case that P is regular. Since P is regular, for some N, PN has no zeros. Thus, the proof given shows that MnN −mnN approaches 0 as n tends to infinity. However, the difference Mn −mn can never increase. (Why?) Hence, if we know that the differences obtained by looking at every Nth time tend to 0, then the entire sequence must also tend to 0. 6 Let P be a regular transition matrix and let w be the unique non-zero fixed vector of P. Show that no entry of w is 0. 18T. Lindvall, Lectures on the Coupling Method (New York: Wiley 1992).
prob_Page_459_Chunk5298
452 CHAPTER 11. MARKOV CHAINS 7 Here is a trick to try on your friends. Shuffle a deck of cards and deal them out one at a time. Count the face cards each as ten. Ask your friend to look at one of the first ten cards; if this card is a six, she is to look at the card that turns up six cards later; if this card is a three, she is to look at the card that turns up three cards later, and so forth. Eventually she will reach a point where she is to look at a card that turns up x cards later but there are not x cards left. You then tell her the last card that she looked at even though you did not know her starting point. You tell her you do this by watching her, and she cannot disguise the times that she looks at the cards. In fact you just do the same procedure and, even though you do not start at the same point as she does, you will most likely end at the same point. Why? 8 Write a program to play the game in Exercise 7. 9 (Suggested by Peter Doyle) In the proof of Theorem 11.14, we assumed the existence of a fixed vector w. To avoid this assumption, beef up the coupling argument to show (without assuming the existence of a stationary distribution w) that for appropriate constants C and r < 1, the distance between αP n and βP n is at most Crn for any starting distributions α and β. Apply this in the case where β = αP to conclude that the sequence αP n is a Cauchy sequence, and that its limit is a matrix W whose rows are all equal to a probability vector w with wP = w. Note that the distance between αP n and w is at most Crn, so in freeing ourselves from the assumption about having a fixed vector we’ve proved that the convergence to equilibrium takes place exponentially fast. 11.5 Mean First Passage Time for Ergodic Chains In this section we consider two closely related descriptive quantities of interest for ergodic chains: the mean time to return to a state and the mean time to go from one state to another state. Let P be the transition matrix of an ergodic chain with states s1, s2, . . . , sr. Let w = (w1, w2, . . . , wr) be the unique probability vector such that wP = w. Then, by the Law of Large Numbers for Markov chains, in the long run the process will spend a fraction wj of the time in state sj. Thus, if we start in any state, the chain will eventually reach state sj; in fact, it will be in state sj infinitely often. Another way to see this is the following: Form a new Markov chain by making sj an absorbing state, that is, define pjj = 1. If we start at any state other than sj, this new process will behave exactly like the original chain up to the first time that state sj is reached. Since the original chain was an ergodic chain, it was possible to reach sj from any other state. Thus the new chain is an absorbing chain with a single absorbing state sj that will eventually be reached. So if we start the original chain at a state si with i ̸= j, we will eventually reach the state sj. Let N be the fundamental matrix for the new chain. The entries of N give the expected number of times in each state before absorption. In terms of the original
prob_Page_460_Chunk5299
11.5. MEAN FIRST PASSAGE TIME 453 1 2 3 4 5 6 7 8 9 Figure 11.5: The maze problem. chain, these quantities give the expected number of times in each of the states before reaching state sj for the first time. The ith component of the vector Nc gives the expected number of steps before absorption in the new chain, starting in state si. In terms of the old chain, this is the expected number of steps required to reach state sj for the first time starting at state si. Mean First Passage Time Definition 11.7 If an ergodic Markov chain is started in state si, the expected number of steps to reach state sj for the first time is called the mean first passage time from si to sj. It is denoted by mij. By convention mii = 0. 2 Example 11.24 Let us return to the maze example (Example 11.22). We shall make this ergodic chain into an absorbing chain by making state 5 an absorbing state. For example, we might assume that food is placed in the center of the maze and once the rat finds the food, he stays to enjoy it (see Figure 11.5). The new transition matrix in canonical form is P =                 1 2 3 4 6 7 8 9 5 1 0 1/2 0 0 1/2 0 0 0 0 2 1/3 0 1/3 0 0 0 0 0 1/3 3 0 1/2 0 1/2 0 0 0 0 0 4 0 0 1/3 0 0 1/3 0 1/3 1/3 6 1/3 0 0 0 0 0 0 0 1/3 7 0 0 0 0 1/2 0 1/2 0 0 8 0 0 0 0 0 1/3 0 1/3 1/3 9 0 0 0 1/2 0 0 1/2 0 0 5 0 0 0 0 0 0 0 0 1                 .
prob_Page_461_Chunk5300