Imagine a situation where there are 7 possible locations: 1, 2, ...,
7.
There are one-way streets connecting various pairs. For example, if
you can get from location 3 to location 7, there will be a street
labelled
. Here is a complete list of the streets:
,
,
,
,
,
,
,
,
,
, and
,
.
If you begin on location 1, and take 16 steps, how many different routes are there that put you on each of the locations? (The discussion that follows will be much easier to follow if you draw a picture. Make a circle of 7 dots, labelled 1 through 7, and for each of the pairs above, draw an arrow from the first dot of the pair to the second.)
This time, we can represent the number of paths to each location by a column vector:
The transition matrix looks like this:
If the matrix on the left of equation (4) is called
,
then after 16 steps, the counts will be given by:
>From a computer, here is
:
Since initially
and
,
we have:
This is, of course, very difficult to check. Why don't you check
the results for
--three step routes. The corresponding equation
for only 3 steps is:
So there is no way to get to location 1 in three steps, one way
to get to location 2:
,
no ways to get to locations 3 or 4, one way to get to location 5:
,
three ways to get to location 6:
,
, and
, and finally, two
ways to get to location 7:
and
.
Obviously, there is nothing special about the set of paths and number of locations in the problem above. For any given setup, you just need to work out the associated transition matrix and you're in business. Even if there are ``loops''--paths that lead from a location to itself--there is no problem. A loop will simply generate an entry of 1 in the diagonal of the transition matrix.