Three Ways to Compute an n-Step Transition Matrix
For a Markov chain, the probability of moving from state \(i\) to state \(j\) in \(n\) steps is the entry \(p_{ij}^{(n)}\) of its n-step transition matrix \(P^{(n)}=P^n\). There is no single best way to compute this power in every problem. A small \(n\) often makes a path calculation shortest; repeated multiplication gives a dependable method for moderate \(n\); and diagonalization can make a very large power manageable when the matrix has a suitable eigenstructure. The aim here is to choose among these methods, keep the arithmetic verifiable, and recognize when a method does not apply.
Throughout, \((X_n)_{n\ge0}\) is a discrete-time Markov chain on a finite state space \(S\), defined on a probability space \((\Omega,\mathcal F,\mathbb P)\). Its transition matrix \(P=(p_{ij})\) is row-stochastic, and \(p_{ij}^{(n)}=\mathbb P_i(X_n=j)\). In particular, \(P^{(0)}=I\). Chapman–Kolmogorov gives \(P^{(m+n)}=P^mP^n\); equivalently, the distribution row vector evolves by \(\mu_{n+1}=\mu_nP\). These identities let us compute the same quantities in different ways.
Why the Three Methods Work
A path of length \(n\) from \(i\) to \(j\) is a sequence \(i=i_0,i_1,\ldots,i_n=j\) of states. Its probability, conditional on starting at \(i\), is the product of the transition probabilities along that path. Summing over all such paths gives the n-step probability.
Proof. For \(n=1\), the displayed sum has no intermediate states and consists of \(p_{ij}\), as required. Suppose the formula holds for \(n\). Chapman–Kolmogorov gives \(p_{ij}^{(n+1)}=\sum_{k\in S}p_{ik}^{(n)}p_{kj}\). Substitute the length-\(n\) path expansion for each \(p_{ik}^{(n)}\). Each term then corresponds to a length-\((n+1)\) path whose penultimate state is \(k\), and its product includes the final factor \(p_{kj}\). As \(k\) ranges over \(S\), these are exactly all length-\((n+1)\) paths, each counted once. For \(n=0\), the chain is in its starting state with probability one and in any different state with probability zero, which is the identity matrix. \(\square\)
Recursive multiplication is the same combination of intermediate states written as matrix arithmetic. Compute \(P^{(0)}=I\), then \(P^{(r+1)}=P^{(r)}P\). In each matrix product, the entry for \(i,j\) is \(\sum_k p_{ik}^{(r)}p_{kj}\), precisely the final-step conditioning in Chapman–Kolmogorov. A second route to a large power is to express a diagonalizable matrix as \(P=V D V^{-1}\), where \(D\) is diagonal.
Proof. For \(n=0\), \(P^0=I=VIV^{-1}=VD^0V^{-1}\). For \(n\ge1\), multiply \(P=VDV^{-1}\) by itself \(n\) times. Each adjacent factor \(V^{-1}V\) equals \(I\), leaving \(V D^n V^{-1}\). This proves the formula for every nonnegative integer \(n\). \(\square\)
This identity does not say that every matrix can be diagonalized. If \(P\) has too few linearly independent eigenvectors, this route is unavailable; recursive multiplication remains valid. The following examples show how the choice affects the work.
Worked Example: Enumerating Paths for a Small Power
Let \((X_n)_{n\ge0}\) be a chain on \(S=\{1,2,3\}\), with transition matrix
Each row sums to \(1\): the row sums are \(\tfrac12+\tfrac12+0=1\), \(0+\tfrac12+\tfrac12=1\), and \(\tfrac12+0+\tfrac12=1\). Find \(p_{13}^{(2)}\). There is just one possible two-step path from \(1\) to \(3\) with positive probability: \(1\to2\to3\). Its probability is the product \(\tfrac12\cdot\tfrac12=\tfrac14\). The other possible intermediate states contribute zero: the path through \(1\) has final transition \(p_{13}=0\), and the path through \(3\) has first transition \(p_{13}=0\). Therefore \(p_{13}^{(2)}=\tfrac14\).
Check by multiplication: the entry in row \(1\), column \(3\) of \(P^2\) is \(\sum_{k=1}^3p_{1k}p_{k3}=\tfrac12\cdot0+\tfrac12\cdot\tfrac12+0\cdot\tfrac12=\tfrac14\), agreeing with the path calculation.
Worked Example: Recursive Multiplication for Three Steps
Use the same chain to find \(P^3\). Since \(n=3\), it is feasible to multiply two small matrices; enumeration would require checking paths for each entry. The matrix \(P\) has row sums \(1,1,1\), as checked in the preceding example. First compute \(P^2=PP\): for instance, its first row is \(\tfrac12( \tfrac12,\tfrac12,0)+\tfrac12(0,\tfrac12,\tfrac12)+0(\tfrac12,0,\tfrac12)=(\tfrac14,\tfrac12,\tfrac14)\). Multiplying each row in the same way gives
Each row of \(P^2\) sums to \(1\): \(\tfrac14+\tfrac12+\tfrac14=1\), \(\tfrac14+\tfrac14+\tfrac12=1\), and \(\tfrac12+\tfrac14+\tfrac14=1\). Now use \(P^3=P^2P\). The first row is \(\tfrac14\) times row \(1\) of \(P\), plus \(\tfrac12\) times row \(2\), plus \(\tfrac14\) times row \(3\), giving \((\tfrac14,\tfrac38,\tfrac38)\). The second row is \(\tfrac14\) times row \(1\), plus \(\tfrac14\) times row \(2\), plus \(\tfrac12\) times row \(3\), giving \((\tfrac38,\tfrac14,\tfrac38)\). The third row is \(\tfrac12\) times row \(1\), plus \(\tfrac14\) times row \(2\), plus \(\tfrac14\) times row \(3\), giving \((\tfrac38,\tfrac38,\tfrac14)\). Thus
Checks: The row sums are \(\tfrac14+\tfrac38+\tfrac38=1\), \(\tfrac38+\tfrac14+\tfrac38=1\), and \(\tfrac38+\tfrac38+\tfrac14=1\). Also, the earlier path calculation can be extended to \(p_{13}^{(3)}\): the paths are \(1\to1\to2\to3\), \(1\to2\to2\to3\), and \(1\to2\to3\to3\), each with probability \(\tfrac18\), giving \(\tfrac38\), the \((1,3)\) entry above.
Worked Example: Diagonalization for a Large Power
Let \((X_n)_{n\ge0}\) be a chain on \(S=\{1,2,3\}\) with
Each row sums to \(1\): \(\tfrac7{12}+\tfrac1{12}+\tfrac13=\tfrac{12}{12}=1\), \(\tfrac1{12}+\tfrac7{12}+\tfrac13=\tfrac{12}{12}=1\), and \(\tfrac13+\tfrac13+\tfrac13=1\). To compute \(p_{11}^{(10)}\) without ten successive matrix multiplications, use three eigenvectors. Let \(u=(1,1,1)^\mathsf{T}\), \(v=(1,-1,0)^\mathsf{T}\), and \(w=(1,1,-2)^\mathsf{T}\). Direct multiplication gives \(Pu=u\), \(Pv=\tfrac12v\), and \(Pw=0w\). These three vectors are linearly independent: if \(a u+b v+c w=0\), the third coordinate gives \(a-2c=0\), and the first two coordinates then give \(b=0\) and \(a+c=0\), so \(a=b=c=0\). Thus they form a basis of eigenvectors and \(P\) is diagonalizable.
Write \(e_1=(1,0,0)^\mathsf{T}\). Its coordinates in this eigenvector basis are \(e_1=\tfrac13u+\tfrac12v+\tfrac16w\), as can be checked coordinatewise: the first coordinate is \(\tfrac13+\tfrac12+\tfrac16=1\), the second is \(\tfrac13-\tfrac12+\tfrac16=0\), and the third is \(\tfrac13-\tfrac13=0\). Applying \(P^{10}\) multiplies these components by \(1^{10}\), \((\tfrac12)^{10}\), and \(0^{10}\). Hence the first coordinate of \(P^{10}e_1\), which is \((P^{10})_{11}\), is
Check: The corresponding formula for every \(n\ge1\) is \((P^n)_{11}=\tfrac13+\tfrac12( \tfrac12)^n\); at \(n=1\) it gives \(\tfrac13+\tfrac14=\tfrac7{12}\), the original \((1,1)\) entry. At \(n=10\), converting to a common denominator gives \(\tfrac{2048}{6144}+\tfrac3{6144}=\tfrac{2051}{6144}\), as above.
Choosing Efficiently—and Avoiding a Common Error
For a small exponent and a single requested entry, path enumeration may avoid calculating entries that are not needed. Its cost grows with the number of possible paths, however: if every state can transition to every state, there can be \(|S|^{n-1}\) intermediate-state sequences for one entry. Recursive multiplication organizes those sums systematically and is usually clearer when several entries are required. For a very large exponent, diagonalization can replace many multiplications by raising eigenvalues to the \(n\)th power, but only if a full eigenvector basis exists and the resulting arithmetic is manageable. The result must still be checked against the probability structure.
Common mistake: adding transition probabilities along a path. In the first example, the path \(1\to2\to3\) has probability \(\tfrac12+\tfrac12=1\) if its two transition probabilities are incorrectly added. The probability of the path is instead their product, \(\tfrac12\cdot\tfrac12=\tfrac14\), because both transitions must occur. Then probabilities of distinct paths are added. For \(p_{13}^{(2)}\), the only positive-probability path contributes \(\tfrac14\), not \(1\).
Another limitation is that diagonalization is not guaranteed. For example, consider the matrix below on \(S=\{1,2,3\}\), where \((X_n)\) is again a discrete-time chain on a probability space:
Its row sums are \(1\), \(\tfrac14+\tfrac12+\tfrac14=1\), and \(\tfrac12+0+\tfrac12=1\). The characteristic polynomial is \((1-\lambda)(\tfrac12-\lambda)^2\). For eigenvalue \(\tfrac12\), the equation \((R-\tfrac12I)x=0\) forces \(x_1=0\) from the first row and \(x_3=0\) from the second row; \(x_2\) is free. Thus this eigenvalue has only one linearly independent eigenvector, despite having algebraic multiplicity two, so \(R\) is not diagonalizable. Do not force the diagonalization method in this case; recursive multiplication is still justified by Chapman–Kolmogorov.
For any computed power, row sums provide a basic check: if \(P\) is row-stochastic, then \(P^n\) is row-stochastic for every \(n\ge0\). Indeed, if a row vector \(x\) has nonnegative entries summing to one, then the \(i\)th row of \(P^{n+1}=P^nP\) is a nonnegative weighted sum of rows of \(P\), with weights from row \(i\) of \(P^n\); those weights sum to one, so the resulting row also sums to one. This check detects many arithmetic errors, though it does not by itself verify every entry.
Check Your Understanding
For each question, identify a method and verify the proposed computation using the definitions or a second calculation.
- For a single entry \(p_{ij}^{(2)}\), what quantities are multiplied along each path, and what quantities are summed across paths?
- Why is recursive multiplication a direct implementation of Chapman–Kolmogorov?
- What additional condition, beyond having eigenvalues, is required to use \(P=VDV^{-1}\) for computing powers?
- Suppose \(P\) is row-stochastic. Explain why the rows of \(P^n\) must sum to one.
- For the first worked example, recompute \(p_{13}^{(2)}\) by evaluating \(\sum_{k=1}^3p_{1k}p_{k3}\).