Tutorials › Linear Algebra › Markov Transition Matrices and Probability-State Conventions

Applications of Diagonalization · Tutorial 588 of 1000

Markov Transition Matrices and Probability-State Conventions

Compare the two matrix conventions and use them consistently to compute normalized probability states through multiple transitions.

Intermediate 10 min read

What You'll Learn

  • Define row-stochastic and column-stochastic transition matrices using their row or column sums.
  • Match a row probability vector or column probability vector to the appropriate multiplication rule.
  • Prove that each update preserves nonnegative entries and total probability one.
  • Calculate multiple steps of finite-state Markov models using exact arithmetic.
  • Interpret entries of a matrix power as probabilities of moving between states.
  • Detect and correct a mismatch between a matrix convention and a probability-state orientation.

States, Probabilities, and Transition Rules

A finite-state Markov model describes a system that occupies one state at each discrete time. Its transition rule gives the probabilities of moving from one state to another in a single step. A matrix makes those probabilities easy to organize, but there are two consistent ways to do so: probability distributions can be written as rows or as columns. The multiplication rule depends on that choice. In either convention, a valid probability state has nonnegative entries whose sum is one, and a valid transition must preserve those properties.

Suppose the possible states are \(S_1,\dots,S_n\). A probability state is a list of numbers giving the probabilities of occupying each state at the current time. The probability of being in state \(S_i\) is its \(i\)th entry. A Markov transition rule specifies the probabilities of the next state given the current state; the rule is assumed not to depend on earlier states once the current state is known.

Definition: A row probability vector is a row of nonnegative real numbers whose entries sum to \(1\). A column probability vector is a column of nonnegative real numbers whose entries sum to \(1\). A matrix is row-stochastic if its entries are nonnegative and each row sums to \(1\). It is column-stochastic if its entries are nonnegative and each column sums to \(1\).

In the row convention, \(P_{ij}\) is the probability of moving from state \(S_i\) to state \(S_j\). The current distribution is a row vector \(\mathbf{q}\), and its next value is \(\mathbf{q}P\). Each row of \(P\) describes all possible destinations from one starting state, so the rows sum to one.

In the column convention, \(P_{ij}\) is the probability of moving from state \(S_j\) to state \(S_i\). The current distribution is a column vector \(\mathbf{x}\), and its next value is \(P\mathbf{x}\). Each column describes the destinations from one starting state, so the columns sum to one. For the same transitions, the column-convention matrix is the transpose of the row-convention matrix. Thus, the two conventions describe the same model when both the matrix and the probability vector are oriented consistently.

Why Each Update Remains a Probability State

Theorem: If \(\mathbf{q}\) is a row probability vector and \(P\) is a row-stochastic matrix of compatible size, then \(\mathbf{q}P\) is a row probability vector. If \(\mathbf{x}\) is a column probability vector and \(P\) is column-stochastic, then \(P\mathbf{x}\) is a column probability vector.

Proof. First consider the row convention. The \(j\)th entry of \(\mathbf{q}P\) is \(\sum_{i=1}^{n}q_iP_{ij}\). Every term is nonnegative because \(q_i\geq0\) and \(P_{ij}\geq0\), so every entry of \(\mathbf{q}P\) is nonnegative. Its entries sum to \(\sum_{j=1}^{n}\sum_{i=1}^{n}q_iP_{ij} =\sum_{i=1}^{n}q_i\left(\sum_{j=1}^{n}P_{ij}\right) =\sum_{i=1}^{n}q_i=1\), because each row of \(P\) sums to \(1\) and \(\mathbf{q}\) is a probability vector.

Now consider the column convention. The \(i\)th entry of \(P\mathbf{x}\) is \(\sum_{j=1}^{n}P_{ij}x_j\), which is nonnegative because each factor is nonnegative. The sum of the entries is \(\sum_{i=1}^{n}\sum_{j=1}^{n}P_{ij}x_j =\sum_{j=1}^{n}x_j\left(\sum_{i=1}^{n}P_{ij}\right) =\sum_{j=1}^{n}x_j=1\), because each column of \(P\) sums to \(1\). Both updates therefore produce probability vectors. \(\square\)

This result also applies repeatedly: after each step, the updated vector still satisfies the conditions needed for the next step. In particular, if the same transition matrix is used at every step, then after \(k\) steps the row state is \(\mathbf{q}_0P^k\), or the column state is \(P^k\mathbf{x}_0\), where \(P^k\) means the product of \(k\) copies of \(P\). The probability-preservation theorem can be applied at each multiplication.

Worked Example: Three Steps with a Row-Stochastic Matrix

Consider three states and the row-stochastic matrix

$$ P=\begin{bmatrix} \frac12&\frac14&\frac14\\ \frac14&\frac12&\frac14\\ \frac14&\frac14&\frac12 \end{bmatrix}. $$

Each row sums to \(1\), and all entries are nonnegative. Begin in state \(S_1\) with row probability vector \(\mathbf{q}_0=(1,0,0)\). The first update is

$$ \mathbf{q}_1=\mathbf{q}_0P =(1,0,0) \begin{bmatrix} \frac12&\frac14&\frac14\\ \frac14&\frac12&\frac14\\ \frac14&\frac14&\frac12 \end{bmatrix} =\left(\frac12,\frac14,\frac14\right). $$

For the second step, multiply each entry of \(\mathbf{q}_1\) by the corresponding row of \(P\) and add:

$$ \begin{aligned} \mathbf{q}_2 &=\left(\frac12,\frac14,\frac14\right)P\\ &=\left( \frac14+\frac1{16}+\frac1{16},\ \frac18+\frac18+\frac1{16},\ \frac18+\frac1{16}+\frac18 \right)\\ &=\left(\frac38,\frac5{16},\frac5{16}\right). \end{aligned} $$

For the third step, the three entries are

$$ \begin{aligned} \mathbf{q}_3 &=\left(\frac38,\frac5{16},\frac5{16}\right)P\\ &=\left( \frac3{16}+\frac5{64}+\frac5{64},\ \frac3{32}+\frac5{32}+\frac5{64},\ \frac3{32}+\frac5{64}+\frac5{32} \right)\\ &=\left(\frac{11}{32},\frac{21}{64},\frac{21}{64}\right). \end{aligned} $$

Check: the entries of \(\mathbf{q}_1\) sum to \(\frac12+\frac14+\frac14=1\); those of \(\mathbf{q}_2\) sum to \(\frac38+\frac5{16}+\frac5{16}=\frac6{16}+\frac{10}{16}=1\); and those of \(\mathbf{q}_3\) sum to \(\frac{22}{64}+\frac{21}{64}+\frac{21}{64}=1\). Each vector is nonnegative, as the transition rule requires.

What Matrix Powers Record

Repeated multiplication is not just a convenient way to calculate. In the row convention, the entry in row \(i\), column \(j\) of \(P^k\) is the probability of being in state \(S_j\) after \(k\) steps, given that the system began in state \(S_i\). Intermediate states are included through the sums in matrix multiplication.

Theorem: Let \(P\) be the row-stochastic matrix of a finite-state transition rule. For each positive integer \(k\), the entry \((P^k)_{ij}\) is the probability of moving from \(S_i\) to \(S_j\) in \(k\) steps.

Proof. When \(k=1\), this statement is exactly the definition of \(P_{ij}\). Assume it holds for a positive integer \(k\). By matrix multiplication, \((P^{k+1})_{ij}=\sum_{\ell=1}^{n}(P^k)_{i\ell}P_{\ell j}\). For each intermediate state \(S_\ell\), the induction assumption makes \((P^k)_{i\ell}\) the probability of reaching \(S_\ell\) from \(S_i\) in \(k\) steps, and \(P_{\ell j}\) is the probability of moving from \(S_\ell\) to \(S_j\) in one further step. The Markov rule makes the probability of that combined route the product of these two probabilities. The routes distinguished by their intermediate state \(S_\ell\) are disjoint and cover all ways to reach \(S_j\) after \(k+1\) steps. Adding their probabilities gives the displayed sum, which is therefore the required probability. Induction proves the statement for every positive integer \(k\). \(\square\)

The theorem explains why a row distribution evolves as \(\mathbf{q}_0P^k\): its \(j\)th entry adds the probabilities of starting in each state \(S_i\), weighted by the chance \((P^k)_{ij}\) of reaching \(S_j\) from that state. The same interpretation holds in the column convention with the transposed matrix and the matching column distribution.

Worked Example: Three Steps with a Column-Stochastic Matrix

Use two states with column-convention transition matrix

$$ C=\begin{bmatrix} \frac12&\frac13\\ \frac12&\frac23 \end{bmatrix}. $$

Its columns sum to \(1\): \(\frac12+\frac12=1\) and \(\frac13+\frac23=1\). Starting in the first state gives \(\mathbf{x}_0=\begin{bmatrix}1\\0\end{bmatrix}\). The first update is

$$ \mathbf{x}_1=C\mathbf{x}_0 =\begin{bmatrix} \frac12&\frac13\\ \frac12&\frac23 \end{bmatrix} \begin{bmatrix}1\\0\end{bmatrix} =\begin{bmatrix}\frac12\\\frac12\end{bmatrix}. $$

The second and third updates are

$$ \begin{aligned} \mathbf{x}_2 &=C\mathbf{x}_1 =\begin{bmatrix} \frac12\cdot\frac12+\frac13\cdot\frac12\\ \frac12\cdot\frac12+\frac23\cdot\frac12 \end{bmatrix} =\begin{bmatrix}\frac5{12}\\\frac7{12}\end{bmatrix},\\[4pt] \mathbf{x}_3 &=C\mathbf{x}_2 =\begin{bmatrix} \frac12\cdot\frac5{12}+\frac13\cdot\frac7{12}\\ \frac12\cdot\frac5{12}+\frac23\cdot\frac7{12} \end{bmatrix} =\begin{bmatrix}\frac{29}{72}\\\frac{43}{72}\end{bmatrix}. \end{aligned} $$

Check: the entries sum to \(1\) at every step: \(\frac12+\frac12=1\), \(\frac5{12}+\frac7{12}=1\), and \(\frac{29}{72}+\frac{43}{72}=1\). The matrix and state are both in the column convention, so the updates are valid probability states.

Modeling a Two-State Transition

A matrix should be built from conditional transition probabilities, not from the distribution at one particular time. In the row convention, each row starts with a current state and lists the probabilities of every possible next state. The row must sum to one because the system must move somewhere. Once the transition matrix is built, the current distribution supplies the weights for combining its rows.

Worked Example: Moving Between Two Locations

Suppose a person is in location \(A\) or \(B\). From \(A\), the person stays in \(A\) with probability \(\frac34\) and moves to \(B\) with probability \(\frac14\). From \(B\), the person moves to \(A\) with probability \(\frac13\) and stays in \(B\) with probability \(\frac23\). The row-stochastic transition matrix is

$$ P=\begin{bmatrix} \frac34&\frac14\\ \frac13&\frac23 \end{bmatrix}. $$

Begin with probability \(\frac23\) in \(A\) and \(\frac13\) in \(B\), so \(\mathbf{q}_0=(\frac23,\frac13)\). One step gives

$$ \begin{aligned} \mathbf{q}_1 &=\mathbf{q}_0P\\ &=\left( \frac23\cdot\frac34+\frac13\cdot\frac13,\ \frac23\cdot\frac14+\frac13\cdot\frac23 \right)\\ &=\left(\frac12+\frac19,\frac16+\frac29\right) =\left(\frac{11}{18},\frac7{18}\right). \end{aligned} $$

For the next step,

$$ \begin{aligned} \mathbf{q}_2 &=\mathbf{q}_1P\\ &=\left( \frac{11}{18}\cdot\frac34+\frac7{18}\cdot\frac13,\ \frac{11}{18}\cdot\frac14+\frac7{18}\cdot\frac23 \right)\\ &=\left(\frac{33}{72}+\frac7{54},\frac{11}{72}+\frac{14}{54}\right)\\ &=\left(\frac{99}{216}+\frac{28}{216},\frac{33}{216}+\frac{56}{216}\right) =\left(\frac{127}{216},\frac{89}{216}\right). \end{aligned} $$

Check: \(\frac{11}{18}+\frac7{18}=1\), and \(\frac{127}{216}+\frac{89}{216}=\frac{216}{216}=1\). Thus after two transitions the probabilities of being in \(A\) and \(B\) are \(\frac{127}{216}\) and \(\frac{89}{216}\), respectively.

Common Pitfall: Mixing the Two Conventions

The condition “the entries sum to one” is not enough by itself. A row-stochastic matrix must multiply a row probability vector on the left; a column-stochastic matrix must multiply a column probability vector on the right. Using the wrong orientation can produce numbers that do not sum to one.

For example, the location matrix above is row-stochastic. A mistaken calculation might treat the initial row \((1,0)\) as a column and compute

$$ \begin{bmatrix} \frac34&\frac14\\ \frac13&\frac23 \end{bmatrix} \begin{bmatrix}1\\0\end{bmatrix} = \begin{bmatrix}\frac34\\\frac13\end{bmatrix}. $$

This is not a probability vector: its entries sum to \(\frac34+\frac13=\frac{13}{12}\), not \(1\). The correction is to keep the row state and calculate \((1,0)P=(\frac34,\frac14)\). Alternatively, use the column convention consistently by transposing the matrix and multiplying the column state:

$$ P^{\top}\begin{bmatrix}1\\0\end{bmatrix} = \begin{bmatrix} \frac34&\frac13\\ \frac14&\frac23 \end{bmatrix} \begin{bmatrix}1\\0\end{bmatrix} = \begin{bmatrix}\frac34\\\frac14\end{bmatrix}. $$

Both corrected calculations give the same distribution, just written in different orientations. Checking nonnegativity and the sum of the entries after an update is a useful arithmetic check, but it does not replace choosing the correct convention before multiplying.

Check Your Understanding

For each question, identify the convention before carrying out any multiplication.

  1. Is \(\begin{bmatrix}\frac12&\frac12\\\frac14&\frac34\end{bmatrix}\) row-stochastic, column-stochastic, both, or neither?
  2. For the row-stochastic matrix in question 1, compute the next state from the row probability vector \((0,1)\).
  3. Write the transpose of that matrix and state why it is column-stochastic.
  4. For \(C=\begin{bmatrix}\frac23&\frac14\\\frac13&\frac34\end{bmatrix}\), compute \(C\begin{bmatrix}0\\1\end{bmatrix}\) and verify that the result is a probability vector.
  5. In the row convention, what does the entry \((P^3)_{ij}\) represent?

Test yourself: Linear Algebra final exam practice

Ready to check what you know? Work a full-length practice final, then open the complete worked solutions.

Want all 1,114 practice problems?

This tutorial covers one topic. Calc Pass covers the full Calculus AB & BC curriculum (the core of Calculus I and II): full review, every practice question, and step-by-step solutions to each one.

QR code to download the Calc Pass app

Get the Calc Pass App

Scan to download and practice on the go, with instant scoring.

Calc Pass Volume 1: 1,114 Practice Questions book cover

Vol. 1: 1,114 Questions

The complete practice question bank, organized by AB & BC topic.

View on Amazon
Calc Pass Volume 2: Solutions Manual book cover

Vol. 2: Solutions Manual

Fully worked solutions to every question in Volume 1.

View on Amazon