Skip to main content
Mathematics LibreTexts

2.9: An Application to Markov Chains

  • Page ID
    59003
  • \( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)

    \( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)

    \( \newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\)

    ( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\)

    \( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\)

    \( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\)

    \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\)

    \( \newcommand{\Span}{\mathrm{span}}\)

    \( \newcommand{\id}{\mathrm{id}}\)

    \( \newcommand{\Span}{\mathrm{span}}\)

    \( \newcommand{\kernel}{\mathrm{null}\,}\)

    \( \newcommand{\range}{\mathrm{range}\,}\)

    \( \newcommand{\RealPart}{\mathrm{Re}}\)

    \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\)

    \( \newcommand{\Argument}{\mathrm{Arg}}\)

    \( \newcommand{\norm}[1]{\| #1 \|}\)

    \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\)

    \( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\AA}{\unicode[.8,0]{x212B}}\)

    \( \newcommand{\vectorA}[1]{\vec{#1}}      % arrow\)

    \( \newcommand{\vectorAt}[1]{\vec{\text{#1}}}      % arrow\)

    \( \newcommand{\vectorB}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)

    \( \newcommand{\vectorC}[1]{\textbf{#1}} \)

    \( \newcommand{\vectorD}[1]{\overrightarrow{#1}} \)

    \( \newcommand{\vectorDt}[1]{\overrightarrow{\text{#1}}} \)

    \( \newcommand{\vectE}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash{\mathbf {#1}}}} \)

    \( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)

    \( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)

    \(\newcommand{\avec}{\mathbf a}\) \(\newcommand{\bvec}{\mathbf b}\) \(\newcommand{\cvec}{\mathbf c}\) \(\newcommand{\dvec}{\mathbf d}\) \(\newcommand{\dtil}{\widetilde{\mathbf d}}\) \(\newcommand{\evec}{\mathbf e}\) \(\newcommand{\fvec}{\mathbf f}\) \(\newcommand{\nvec}{\mathbf n}\) \(\newcommand{\pvec}{\mathbf p}\) \(\newcommand{\qvec}{\mathbf q}\) \(\newcommand{\svec}{\mathbf s}\) \(\newcommand{\tvec}{\mathbf t}\) \(\newcommand{\uvec}{\mathbf u}\) \(\newcommand{\vvec}{\mathbf v}\) \(\newcommand{\wvec}{\mathbf w}\) \(\newcommand{\xvec}{\mathbf x}\) \(\newcommand{\yvec}{\mathbf y}\) \(\newcommand{\zvec}{\mathbf z}\) \(\newcommand{\rvec}{\mathbf r}\) \(\newcommand{\mvec}{\mathbf m}\) \(\newcommand{\zerovec}{\mathbf 0}\) \(\newcommand{\onevec}{\mathbf 1}\) \(\newcommand{\real}{\mathbb R}\) \(\newcommand{\twovec}[2]{\left[\begin{array}{r}#1 \\ #2 \end{array}\right]}\) \(\newcommand{\ctwovec}[2]{\left[\begin{array}{c}#1 \\ #2 \end{array}\right]}\) \(\newcommand{\threevec}[3]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \end{array}\right]}\) \(\newcommand{\cthreevec}[3]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \end{array}\right]}\) \(\newcommand{\fourvec}[4]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \\ #4 \end{array}\right]}\) \(\newcommand{\cfourvec}[4]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \\ #4 \end{array}\right]}\) \(\newcommand{\fivevec}[5]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \\ #4 \\ #5 \\ \end{array}\right]}\) \(\newcommand{\cfivevec}[5]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \\ #4 \\ #5 \\ \end{array}\right]}\) \(\newcommand{\mattwo}[4]{\left[\begin{array}{rr}#1 \amp #2 \\ #3 \amp #4 \\ \end{array}\right]}\) \(\newcommand{\laspan}[1]{\text{Span}\{#1\}}\) \(\newcommand{\bcal}{\cal B}\) \(\newcommand{\ccal}{\cal C}\) \(\newcommand{\scal}{\cal S}\) \(\newcommand{\wcal}{\cal W}\) \(\newcommand{\ecal}{\cal E}\) \(\newcommand{\coords}[2]{\left\{#1\right\}_{#2}}\) \(\newcommand{\gray}[1]{\color{gray}{#1}}\) \(\newcommand{\lgray}[1]{\color{lightgray}{#1}}\) \(\newcommand{\rank}{\operatorname{rank}}\) \(\newcommand{\row}{\text{Row}}\) \(\newcommand{\col}{\text{Col}}\) \(\renewcommand{\row}{\text{Row}}\) \(\newcommand{\nul}{\text{Nul}}\) \(\newcommand{\var}{\text{Var}}\) \(\newcommand{\corr}{\text{corr}}\) \(\newcommand{\len}[1]{\left|#1\right|}\) \(\newcommand{\bbar}{\overline{\bvec}}\) \(\newcommand{\bhat}{\widehat{\bvec}}\) \(\newcommand{\bperp}{\bvec^\perp}\) \(\newcommand{\xhat}{\widehat{\xvec}}\) \(\newcommand{\vhat}{\widehat{\vvec}}\) \(\newcommand{\uhat}{\widehat{\uvec}}\) \(\newcommand{\what}{\widehat{\wvec}}\) \(\newcommand{\Sighat}{\widehat{\Sigma}}\) \(\newcommand{\lt}{<}\) \(\newcommand{\gt}{>}\) \(\newcommand{\amp}{&}\) \(\definecolor{fillinmathshade}{gray}{0.9}\)

    Many natural phenomena progress through various stages and can be in a variety of states at each stage. For example, the weather in a given city progresses day by day and, on any given day, may be sunny or rainy. Here the states are “sun” and “rain,” and the weather progresses from one state to another in daily stages. Another example might be a football team: The stages of its evolution are the games it plays, and the possible states are “win,” “draw,” and “loss.”

    The general setup is as follows: A real conceptual “system” is run generating a sequence of outcomes. The system evolves through a series of “stages,” and at any stage it can be in any one of a finite number of “states.” At any given stage, the state to which it will go at the next stage depends on the past and present history of the system—that is, on the sequence of states it has occupied to date.

    Markov Chain007191 A Markov chain is such an evolving system wherein the state to which it will go next depends only on its present state and does not depend on the earlier history of the system.

    Even in the case of a Markov chain, the state the system will occupy at any stage is determined only in terms of probabilities. In other words, chance plays a role. For example, if a football team wins a particular game, we do not know whether it will win, draw, or lose the next game. On the other hand, we may know that the team tends to persist in winning streaks; for example, if it wins one game it may win the next game \(\frac{1}{2}\) of the time, lose \(\frac{4}{10}\) of the time, and draw \(\frac{1}{10}\) of the time. These fractions are called the probabilities of these various possibilities. Similarly, if the team loses, it may lose the next game with probability \(\frac{1}{2}\) (that is, half the time), win with probability \(\frac{1}{4}\), and draw with probability \(\frac{1}{4}\). The probabilities of the various outcomes after a drawn game will also be known.

    We shall treat probabilities informally here: The probability that a given event will occur is the long-run proportion of the time that the event does indeed occur. Hence, all probabilities are numbers between \(0\) and \(1\). A probability of \(0\) means the event is impossible and never occurs; events with probability \(1\) are certain to occur.

    If a Markov chain is in a particular state, the probabilities that it goes to the various states at the next stage of its evolution are called the transition probabilities for the chain, and they are assumed to be known quantities. To motivate the general conditions that follow, consider the following simple example. Here the system is a man, the stages are his successive lunches, and the states are the two restaurants he chooses.

    007199 A man always eats lunch at one of two restaurants, \(A\) and \(B\). He never eats at \(A\) twice in a row. However, if he eats at \(B\), he is three times as likely to eat at \(B\) next time as at \(A\). Initially, he is equally likely to eat at either restaurant.

    1. What is the probability that he eats at \(A\) on the third day after the initial one?
    2. What proportion of his lunches does he eat at \(A\)?

    The table of transition probabilities follows. The \(A\) column indicates that if he eats at \(A\) on one day, he never eats there again on the next day and so is certain to go to \(B\).

    to 80mm|X[2,c]X[1,c]|X[1,c]|X[1,c]| & &
    & & A & B
    & A & 0 & 0.25
    & B & 1 & 0.75

    The \(B\) column shows that, if he eats at \(B\) on one day, he will eat there on the next day \(\frac{3}{4}\) of the time and switches to \(A\) only \(\frac{1}{4}\) of the time.

    The restaurant he visits on a given day is not determined. The most that we can expect is to know the probability that he will visit \(A\) or \(B\) on that day.

    Let \(\mathbf{s}_{m} = \left[ \def\arraystretch{1.5}\begin{array}{c} s_{1}^{(m)} \\ s_{2}^{(m)} \end{array} \right]\) denote the state vector for day \(m\). Here \(s_{1}^{(m)}\) denotes the probability that he eats at \(A\) on day \(m\), and \(s_{2}^{(m)}\) is the probability that he eats at \(B\) on day \(m\). It is convenient to let \(\mathbf{s}_{0}\) correspond to the initial day. Because he is equally likely to eat at \(A\) or \(B\) on that initial day, \(s_{1}^{(0)} = 0.5\) and \(s_{2}^{(0)} = 0.5\), so \(\mathbf{s}_{0} = \left[ \begin{array}{c} 0.5 \\ 0.5 \end{array} \right]\). Now let

    \[P = \left[ \begin{array}{rr} 0 & 0.25 \\ 1 & 0.75 \end{array} \right] \nonumber \]

    denote the transition matrix. We claim that the relationship

    \[\mathbf{s}_{m+1} = P\mathbf{s}_m \nonumber \]

    holds for all integers \(m \geq 0\). This will be derived later; for now, we use it as follows to successively compute \(\mathbf{s}_{1}, \mathbf{s}_{2}, \mathbf{s}_{3}, \dots\).

    \[\begin{aligned} \mathbf{s}_{1} &= P\mathbf{s}_0 = \left[ \begin{array}{rr} 0 & 0.25 \\ 1 & 0.75 \end{array} \right] \left[ \begin{array}{r} 0.5 \\ 0.5 \end{array} \right] = \left[ \begin{array}{r} 0.125 \\ 0.875 \end{array} \right] \\ \mathbf{s}_{2} &= P\mathbf{s}_1 = \left[ \begin{array}{rr} 0 & 0.25 \\ 1 & 0.75 \end{array} \right] \left[ \begin{array}{r} 0.125 \\ 0.875 \end{array} \right] = \left[ \begin{array}{r} 0.21875 \\ 0.78125 \end{array} \right] \\ \mathbf{s}_{3} &= P\mathbf{s}_2 = \left[ \begin{array}{rr} 0 & 0.25 \\ 1 & 0.75 \end{array} \right] \left[ \begin{array}{r} 0.21875 \\ 0.78125 \end{array} \right] = \left[ \begin{array}{r} 0.1953125 \\ 0.8046875 \end{array} \right]\end{aligned} \nonumber \]

    Hence, the probability that his third lunch (after the initial one) is at \(A\) is approximately \(0.195\), whereas the probability that it is at \(B\) is \(0.805\). If we carry these calculations on, the next state vectors are (to five figures):

    \[\begin{aligned} \mathbf{s}_4 &= \left[ \begin{array}{r} 0.20117 \\ 0.79883 \end{array} \right] \quad \mathbf{s}_5 = \left[ \begin{array}{r} 0.19971 \\ 0.80029 \end{array} \right] \\ \mathbf{s}_6 &= \left[ \begin{array}{r} 0.20007 \\ 0.79993 \end{array} \right] \quad \mathbf{s}_7 = \left[ \begin{array}{r} 0.19998 \\ 0.80002 \end{array} \right]\end{aligned} \nonumber \]

    Moreover, as \(m\) increases the entries of \(\mathbf{s}_{m}\) get closer and closer to the corresponding entries of \(\left[ \begin{array}{c} 0.2 \\ 0.8 \end{array} \right]\). Hence, in the long run, he eats \(20\%\) of his lunches at \(A\) and \(80\%\) at \(B\).

    Example [exa:007199] incorporates most of the essential features of all Markov chains. The general model is as follows: The system evolves through various stages and at each stage can be in exactly one of \(n\) distinct states. It progresses through a sequence of states as time goes on. If a Markov chain is in state \(j\) at a particular stage of its development, the probability \(p_{ij}\) that it goes to state \(i\) at the next stage is called the transition probability. The \(n \times n\) matrix \(P = \left[ p_{ij} \right]\) is called the transition matrix for the Markov chain. The situation is depicted graphically in the diagram.

    We make one important assumption about the transition matrix \(P = \left[ p_{ij} \right]\): It does not depend on which stage the process is in. This assumption means that the transition probabilities are independent of time—that is, they do not change as time goes on. It is this assumption that distinguishes Markov chains in the literature of this subject.

    007243 Suppose the transition matrix of a three-state Markov chain is

    \[\begin{tabu}{ccccccc@{}ll} & & & & \multicolumn{3}{c}{\arraycolsep=10pt\begin{array}{ccc} \multicolumn{3}{c}{\mbox{Present state}} \\ 1 & 2 & 3 \end{array}} & & \\ P & = & \left[ \begin{array}{rrr} p_{11} & p_{12} & p_{13} \\ p_{21} & p_{22} & p_{23} \\ p_{31} & p_{32} & p_{33} \end{array} \right] & = & \multicolumn{3}{c}{ \left[ \begin{array}{ccc} 0.3 & 0.1 & 0.6 \\ 0.5 & 0.9 & 0.2 \\ 0.2 & 0.0 & 0.2 \end{array} \right]} & \arraycolsep=-3pt\begin{array}{c} 1 \\ 2 \\ 3 \end{array} & \mbox{Next state} \\ \end{tabu} \nonumber \]

    If, for example, the system is in state 2, then column 2 lists the probabilities of where it goes next. Thus, the probability is \(p_{12} = 0.1\) that it goes from state 2 to state 1, and the probability is \(p_{22} = 0.9\) that it goes from state 2 to state 2. The fact that \(p_{32} = 0\) means that it is impossible for it to go from state 2 to state 3 at the next stage.

    Consider the \(j\)th column of the transition matrix \(P\).

    \[\left[ \begin{array}{c} p_{1j} \\ p_{2j} \\ \vdots \\ p_{nj} \end{array} \right] \nonumber \]

    If the system is in state \(j\) at some stage of its evolution, the transition probabilities \(p_{1j}, p_{2j}, \dots, p_{nj}\) represent the fraction of the time that the system will move to state 1, state 2, …, state \(n\), respectively, at the next stage. We assume that it has to go to some state at each transition, so the sum of these probabilities is \(1\):

    \[p_{1j} + p_{2j} + \cdots + p_{nj} = 1 \quad \mbox{for each } j \nonumber \]

    Thus, the columns of \(P\) all sum to \(1\) and the entries of \(P\) lie between \(0\) and \(1\). Hence \(P\) is called a stochastic matrix.

    As in Example [exa:007199], we introduce the following notation: Let \(s_{i}^{(m)}\) denote the probability that the system is in state \(i\) after \(m\) transitions. The \(n \times 1\) matrices

    \[\mathbf{s}_m = \left[ \def\arraystretch{1.5}\begin{array}{c} s_{1}^{(m)} \\ s_{2}^{(m)} \\ \vdots \\ s_{n}^{(m)} \end{array} \right] \quad m = 0, 1, 2, \dots \nonumber \]

    are called the state vectors for the Markov chain. Note that the sum of the entries of \(\mathbf{s}_{m}\) must equal \(1\) because the system must be in some state after \(m\) transitions. The matrix \(\mathbf{s}_{0}\) is called the initial state vector for the Markov chain and is given as part of the data of the particular chain. For example, if the chain has only two states, then an initial vector \(\mathbf{s}_0 = \left[ \begin{array}{c} 1 \\ 0 \end{array} \right]\) means that it started in state 1. If it started in state 2, the initial vector would be \(\mathbf{s}_0 = \left[ \begin{array}{c} 0 \\ 1 \end{array} \right]\). If \(\mathbf{s}_0 = \left[ \begin{array}{c} 0.5 \\ 0.5 \end{array} \right]\), it is equally likely that the system started in state 1 or in state 2.

    007270 Let \(P\) be the transition matrix for an \(n\)-state Markov chain. If \(\mathbf{s}_{m}\) is the state vector at stage \(m\), then

    \[\mathbf{s}_{m+1} = P\mathbf{s}_m \nonumber \]

    for each \(m = 0, 1, 2, \dots\).

    Suppose that the Markov chain has been run \(N\) times, each time starting with the same initial state vector. Recall that \(p_{ij}\) is the proportion of the time the system goes from state \(j\) at some stage to state \(i\) at the next stage, whereas \(s_{i}^{(m)}\) is the proportion of the time it is in state \(i\) at stage \(m\). Hence

    \[s_{i}^{m+1}N \nonumber \]

    is (approximately) the number of times the system is in state \(i\) at stage \(m + 1\). We are going to calculate this number another way. The system got to state \(i\) at stage \(m + 1\) through some other state (say state \(j\)) at stage \(m\). The number of times it was in state \(j\) at that stage is (approximately) \(s_{j}^{(m)}N\), so the number of times it got to state \(i\) via state \(j\) is \(p_{ij}(s_{j}^{(m)}N)\). Summing over \(j\) gives the number of times the system is in state \(i\) (at stage \(m + 1\)). This is the number we calculated before, so

    \[s_{i}^{(m+1)}N = p_{i1}s_{1}^{(m)}N + p_{i2}s_{2}^{(m)}N + \cdots + p_{in}s_{n}^{(m)}N \nonumber \]

    Dividing by \(N\) gives \(s_{i}^{(m+1)} = p_{i1}s_{1}^{(m)} + p_{i2}s_{2}^{(m)} + \cdots + p_{in}s_{n}^{(m)}\) for each \(i\), and this can be expressed as the matrix equation \(\mathbf{s}_{m+1} = P\mathbf{s}_{m}\).

    If the initial probability vector \(\mathbf{s}_{0}\) and the transition matrix \(P\) are given, Theorem [thm:007270] gives \(\mathbf{s}_{1}, \mathbf{s}_{2}, \mathbf{s}_{3}, \dots\), one after the other, as follows:

    \[\begin{array}{c} \mathbf{s}_{1} = P\mathbf{s}_0 \\ \mathbf{s}_{2} = P\mathbf{s}_1 \\ \mathbf{s}_{3} = P\mathbf{s}_2 \\ \vdots \end{array} \nonumber \]

    Hence, the state vector \(\mathbf{s}_{m}\) is completely determined for each \(m = 0, 1, 2, \dots\) by \(P\) and \(\mathbf{s}_{0}\).

    007301 A wolf pack always hunts in one of three regions \(R_{1}\), \(R_{2}\), and \(R_{3}\). Its hunting habits are as follows:

    1. If it hunts in some region one day, it is as likely as not to hunt there again the next day.
    2. If it hunts in \(R_{1}\), it never hunts in \(R_{2}\) the next day.
    3. If it hunts in \(R_{2}\) or \(R_{3}\), it is equally likely to hunt in each of the other regions the next day.

    If the pack hunts in \(R_{1}\) on Monday, find the probability that it hunts there on Thursday.

    The stages of this process are the successive days; the states are the three regions. The transition matrix \(P\) is determined as follows (see the table): The first habit asserts that \(p_{11} = p_{22} = p_{33} = \frac{1}{2}\). Now column 1 displays what happens when the pack starts in \(R_{1}\): It never goes to state 2, so \(p_{21} = 0\) and, because the column must sum to \(1\), \(p_{31} = \frac{1}{2}\). Column 2 describes what happens if it starts in \(R_{2}\): \(p_{22} = \frac{1}{2}\) and \(p_{12}\) and \(p_{32}\) are equal (by habit 3), so \(p_{12} = p_{32} = \frac{1}{2}\) because the column sum must equal \(1\). Column 3 is filled in a similar way.

    \[\def\arraystretch{1.5} \begin{tabu}{|c|c|c|c|} \hline & R_{1} & R_{2} & R_{3} \\ \hline R_{1} & \frac{1}{2} & \frac{1}{4} & \frac{1}{4} \\ R_{2} & 0 & \frac{1}{2} & \frac{1}{4} \\ R_{3} & \frac{1}{2} & \frac{1}{4} & \frac{1}{2} \\ \hline \end{tabu} \nonumber \]

    Now let Monday be the initial stage. Then \(\mathbf{s}_0 = \left[ \begin{array}{r} 1 \\ 0 \\ 0 \end{array} \right]\) because the pack hunts in \(R_{1}\) on that day. Then \(\mathbf{s}_{1}\), \(\mathbf{s}_{2}\), and \(\mathbf{s}_{3}\) describe Tuesday, Wednesday, and Thursday, respectively, and we compute them using Theorem [thm:007270].

    \[\mathbf{s}_1 = P\mathbf{s}_0 = \left[ \def\arraystretch{1.5}\begin{array}{r} \frac{1}{2} \\ 0 \\ \frac{1}{2} \end{array} \right] \quad \mathbf{s}_2 = P\mathbf{s}_1 = \left[ \def\arraystretch{1.5}\begin{array}{r} \frac{3}{8} \\ \frac{1}{8} \\ \frac{4}{8} \end{array} \right] \quad \mathbf{s}_3 = P\mathbf{s}_2 = \left[ \def\arraystretch{1.5}\begin{array}{r} \frac{11}{32} \\ \frac{6}{32} \\ \frac{15}{32} \end{array} \right] \nonumber \]

    Hence, the probability that the pack hunts in Region \(R_{1}\) on Thursday is \(\frac{11}{32}\).

    Steady State Vector

    Another phenomenon that was observed in Example [exa:007199] can be expressed in general terms. The state vectors \(\mathbf{s}_{0}, \mathbf{s}_{1}, \mathbf{s}_{2}, \dots\) were calculated in that example and were found to “approach” \(\mathbf{s} = \left[ \begin{array}{c} 0.2 \\ 0.8 \end{array} \right]\). This means that the first component of \(\mathbf{s}_{m}\) becomes and remains very close to \(0.2\) as \(m\) becomes large, whereas the second component gets close to \(0.8\) as \(m\) increases. When this is the case, we say that \(\mathbf{s}_{m}\) converges to \(\mathbf{s}\). For large \(m\), then, there is very little error in taking \(\mathbf{s}_{m} = \mathbf{s}\), so the long-term probability that the system is in state 1 is \(0.2\), whereas the probability that it is in state 2 is \(0.8\). In Example [exa:007199], enough state vectors were computed for the limiting vector \(\mathbf{s}\) to be apparent. However, there is a better way to do this that works in most cases.

    Suppose \(P\) is the transition matrix of a Markov chain, and assume that the state vectors \(\mathbf{s}_{m}\) converge to a limiting vector \(\mathbf{s}\). Then \(\mathbf{s}_{m}\) is very close to \(\mathbf{s}\) for sufficiently large \(m\), so \(\mathbf{s}_{m+1}\) is also very close to \(\mathbf{s}\). Thus, the equation \(\mathbf{s}_{m+1} = P\mathbf{s}_{m}\) from Theorem [thm:007270] is closely approximated by

    \[\mathbf{s} = P\mathbf{s} \nonumber \]

    so it is not surprising that \(\mathbf{s}\) should be a solution to this matrix equation. Moreover, it is easily solved because it can be written as a system of homogeneous linear equations

    \[(I - P)\mathbf{s} = \mathbf{0} \nonumber \]

    with the entries of \(\mathbf{s}\) as variables.

    In Example [exa:007199], where \(P = \left[ \begin{array}{rr} 0 & 0.25 \\ 1 & 0.75 \end{array} \right]\), the general solution to \((I - P)\mathbf{s} = \mathbf{0}\) is \(\mathbf{s} = \left[ \begin{array}{r} t \\ 4t \end{array} \right]\), where \(t\) is a parameter. But if we insist that the entries of \(S\) sum to \(1\) (as must be true of all state vectors), we find \(t = 0.2\) and so \(\mathbf{s} = \left[ \begin{array}{r} 0.2 \\ 0.8 \end{array} \right]\) as before.

    All this is predicated on the existence of a limiting vector for the sequence of state vectors of the Markov chain, and such a vector may not always exist. However, it does exist in one commonly occurring situation. A stochastic matrix \(P\) is called regular if some power \(P^{m}\) of \(P\) has every entry greater than zero. The matrix \(P = \left[ \begin{array}{rr} 0 & 0.25 \\ 1 & 0.75 \end{array} \right]\) of Example [exa:007199] is regular (in this case, each entry of \(P^{2}\) is positive), and the general theorem is as follows:

    007400 Let \(P\) be the transition matrix of a Markov chain and assume that \(P\) is regular. Then there is a unique column matrix \(\mathbf{s}\) satisfying the following conditions:

    1. \(P\mathbf{s} = \mathbf{s}\).
    2. The entries of \(\mathbf{s}\) are positive and sum to \(1\).

    Moreover, condition 1 can be written as

    \[(I - P)\mathbf{s} = \mathbf{0} \nonumber \]

    and so gives a homogeneous system of linear equations for \(\mathbf{s}\). Finally, the sequence of state vectors \(\mathbf{s}_{0}, \mathbf{s}_{1}, \mathbf{s}_{2}, \dots\) converges to \(\mathbf{s}\) in the sense that if \(m\) is large enough, each entry of \(\mathbf{s}_{m}\) is closely approximated by the corresponding entry of \(\mathbf{s}\).

    This theorem will not be proved here.1

    If \(P\) is the regular transition matrix of a Markov chain, the column \(\mathbf{s}\) satisfying conditions 1 and 2 of Theorem [thm:007400] is called the steady-state vector for the Markov chain. The entries of \(\mathbf{s}\) are the long-term probabilities that the chain will be in each of the various states.

    007416 A man eats one of three soups—beef, chicken, and vegetable—each day. He never eats the same soup two days in a row. If he eats beef soup on a certain day, he is equally likely to eat each of the others the next day; if he does not eat beef soup, he is twice as likely to eat it the next day as the alternative.

    1. If he has beef soup one day, what is the probability that he has it again two days later?
    2. What are the long-run probabilities that he eats each of the three soups?

    The states here are \(B\), \(C\), and \(V\), the three soups. The transition matrix \(P\) is given in the table. (Recall that, for each state, the corresponding column lists the probabilities for the next state.)

    \[\def\arraystretch{1.5} \begin{tabu}{|c|c|c|c|} \hline & B & C & V \\ \hline B & 0 & \frac{2}{3} & \frac{2}{3} \\ C & \frac{1}{2} & 0 & \frac{1}{3} \\ V & \frac{1}{2} & \frac{1}{3} & 0 \\ \hline \end{tabu} \nonumber \]

    If he has beef soup initially, then the initial state vector is

    \[\mathbf{s}_0 = \left[ \begin{array}{r} 1 \\ 0 \\ 0 \end{array} \right] \nonumber \]

    Then two days later the state vector is \(\mathbf{s}_{2}\). If \(P\) is the transition matrix, then

    \[\mathbf{s}_1 = P\mathbf{s}_0 = \frac{1}{2} \left[ \begin{array}{r} 0 \\ 1 \\ 1 \end{array} \right], \quad \mathbf{s}_2 = P\mathbf{s}_1 = \frac{1}{6} \left[ \begin{array}{r} 4 \\ 1 \\ 1 \end{array} \right] \nonumber \]

    so he eats beef soup two days later with probability \(\frac{2}{3}\). This answers (a.) and also shows that he eats chicken and vegetable soup each with probability \(\frac{1}{6}\).

    To find the long-run probabilities, we must find the steady-state vector \(\mathbf{s}\). Theorem [thm:007400] applies because \(P\) is regular (\(P^{2}\) has positive entries), so \(\mathbf{s}\) satisfies \(P\mathbf{s} = \mathbf{s}\). That is, \((I - P)\mathbf{s} = \mathbf{0}\) where

    \[I - P = \frac{1}{6} \left[ \begin{array}{rrr} 6 & -4 & -4 \\ -3 & 6 & -2 \\ -3 & -2 & 6 \end{array} \right] \nonumber \]

    The solution is \(\mathbf{s} = \left[ \begin{array}{r} 4t \\ 3t \\ 3t \end{array} \right]\), where \(t\) is a parameter, and we use \(\mathbf{s} = \left[ \begin{array}{r} 0.4 \\ 0.3 \\ 0.3 \end{array} \right]\) because the entries of \(\mathbf{s}\) must sum to \(1\). Hence, in the long run, he eats beef soup \(40\%\) of the time and eats chicken soup and vegetable soup each \(30\%\) of the time.


    1. The interested reader can find an elementary proof in J. Kemeny, H. Mirkil, J. Snell, and G. Thompson, Finite Mathematical Structures (Englewood Cliffs, N.J.: Prentice-Hall, 1958).↩

    This page titled 2.9: An Application to Markov Chains is shared under a CC BY-NC-SA 4.0 license and was authored, remixed, and/or curated by W. Keith Nicholson (Lyryx Learning Inc.) via source content that was edited to the style and standards of the LibreTexts platform.