You are on page 1of 8

Chapter 7: Tutorial 1

The Transition Matrix

Sec. 7.1

Note: Before starting this tutorial, you may want to review array formulas and manipulations in the Chapter 4 Excel workbook. Suppose you are given the following 2X2 stochastic matrix: s0 0.05 P 0.23 0.11

0.95

0.77 0.89

Note that this is the stochastic matrix from Example 1 in Section 7-1. We'll come back to the questions in the example itself a bit later. We will also expand on this example. The matrix A is given in the blue cells. The initial distribution is given in the yellow cells. Question: What is the distribution of the next state? To compute this, we simple multiply the initial distribution s0 by the matrix P: Recall the following from the chapter 4 workbook on entering arrays: (1) Select the 1X2 region boxed on the right (2) Enter the formula =mmult(b9:c9,e9:f10) and press <CTRL><SHIFT><ENTER> , all at the same time Therefore, in the next year, the probability of an accident is 0.116 and the probability of no accident is 0.884. Question: What is the distribution after 2 years? To compute this, we simply need to take s1 one year further. This is done by computing s1*P: Do this in the boxed region below: s2 s1 0.116

You can also find s2 by computing P^2 first and then premultiplying by s0: P^2: 0.1376 0.1232 0.8624 0.8768

Now multiply s0 with the P^2 matrix above and put your answer in the boxed region below: s2

Your answer should be the same as the s2 obtained above!

Page 1 of 8

(c) 1998 Prentice Hall, Upper Saddle River, NJ

U TRY IT: Compute P^3 - multiply P^2 by P in the boxed region below: P^3

U TRY IT: Similarly, compute P^4, P^5, P^6. What do you observe?

Problem:

Change the matrix P and the vector s to correspond to problems in your text with 2X2 stochastic matrices.

Problems: #45-48, Sec. 7.1

Page 2 of 8

(c) 1998 Prentice Hall, Upper Saddle River, NJ

0.884

Page 3 of 8

(c) 1998 Prentice Hall, Upper Saddle River, NJ

Chapter 7 : Tutorial 2

Stable Distributions and Stochastic Matrices

Let us calculate the stable distribution corresponding to the following matrix and initial distribution from Tutorial 1 of this chapter: (Example 3, Section 8-2.) s0 0.05 P 0.23 0.11

0.95

0.77 0.89

Recall that the stable distribution S can be determined by solving the system of linear equations: sum of the entries of S = 1 and SP = S Let X =(x1,x2). Then we have the system of equations x1 + x2 = 1 0.23 x1 + 0.11 x2 = x1 0.77 x1 + 0.89 x2 = x2 Isolating the variables to one side, we have x1 + x2 =1 -0.77 x1 + 0.11 x2 = 0 0.77 x1 - 0.11 x1 = 0 Due to the special nature of the stochastic matrices, we can safely drop the last equation and retain two equations with two unknowns (this can be shown mathematically, but that involves a discussion beyond the scope of this tutorial). Writing in matrix form, we have M 1 -0.77 b 1 0

1 0.11

To solve this system of equations, we make the following 2X1 boxed area, select it, and enter the formula for solution : mmult(minverse(b33:c34),e33:e34) X 0.125 0.875 This basically produces inverse(M) * b = (x1,x2). If you have not already done so, you may want to review array formulas and manipulations in the Chapter 4 Excel workbook.

Page 4 of 8

(c) 1998 Prentice Hall, Upper Saddle River, NJ

So X = (0.125, 0.875) is the stable distribution. The stable matrix is given by P 0.125 0.125 0.875 0.875

U TRY IT

Suppose you have the following stochastic matrix: P 0.3 0.6

0.7 0.4

Appropriately change the P matrix in the above discussion and find the stable distribution. Problems: Solve problems from Sec 7.2 using the above techniques.

Page 5 of 8

(c) 1998 Prentice Hall, Upper Saddle River, NJ

ochastic Matrices Sec.7.2

Page 6 of 8

(c) 1998 Prentice Hall, Upper Saddle River, NJ

Chapter 7 : Project 1

Application of Stochastic Matrices

The following matrix describes how the percentage for each type of transportation taken by commuters changes from one year to the next. Current Year Bus Train Car Bus 0.85 0.15 0.04 Train 0.1 0.75 0.06 Car 0.05 0.1 0.9

Next Year

(1) Explain in your own words what each of the entries in the above matrix means.

(2) Assume that in 1995, the percentage of people taking the bus was 20%, the percentage taking the train was 10% and the rest of the commuters drove. What is the initial distribution?

(3) How many commuters will take the train in 1996? Explain how you got your answer. Do the same for the years 1997 and 1998.

(4) Calculate what percentage of the commuters will take the bus in the long run. Does this seems realistic to you? Why or why not?

(5) What are some assumptions that we have made in using this model to predict long term behavior?

Page 7 of 8

(c) 1998 Prentice Hall, Upper Saddle River, NJ

Chapter 7 : Project 2

Car Breakdowns and Stochastic Matrices

The ACME rental car company has a fleet of 300 cars. On any given day, there is a 2% chance that a given car will have a problem of some sort and a 80% chance that given car with a problem will be repaired. (1) Write down the stochastic matrix relating to this problem. Clearly label your headings, and explain what each entry means.

(2) Verify that your stochastic matrix is regular.

(3) On a certain day, 10 cars are experiencing trouble while the rest are fine. How many cars will be working the next day?

(4) With same data as in number (3) above, how many cars will be working in 3 days?

(5) In the long run, how many cars would you expect to be functioning? Based on this data would you recommend renting a car from ACME? Justify your answer.

Page 8 of 8

(c) 1998 Prentice Hall, Upper Saddle River, NJ

You might also like