Raising a matrix to the infinite power How do I raise a matrix to the infinite power? I know that the main method for doing this is by diagonalizing the matrix, but what if I can't?
For example, let's say I have the matrix
\begin{bmatrix}0&0&0&0&0\\2/3&0&0&0&0\\1/3&0&1&0&0\\0&3/7&0&1&0\\0&4/7&0&0&1\end{bmatrix}
You can see that when I try diaganolizing the matrix in Mathematica, the eigenvector matrix is singular, so I'm unable to take its inverse.



However, I know that when I raise this matrix to the power of infinity, I know I get the following matrix
\begin{bmatrix}0&0&0&0&0\\0&0&0&0&0\\1/3&0&1&0&0\\2/7&3/7&0&1&0\\8/21&4/7&0&0&1\end{bmatrix}
Is there any general algorithm or formula or steps I can take to get there?
 A: This depends on the spectral radius $\rho(M)$ of your matrix $M$.

*

*If $\rho(M)<1$, then $\lim_{k\to \infty} M^k=0$.

*If $\rho(M)>1$, then  $\lim_{k\to \infty} \|M^k\|=\infty$ so the limit does not exists.

*If $\rho(M)=1$, then the limit may or may not converge.

A: Being lower triangular, the characteristic polynomial of the matrix, call it $M$, is easy to calculate: $p(z)=\det(M-zI) = z^2(z-1)^3$. The Hamilton-Cayley theorem stipulates that $M$ is a root of $p$, i.e. $$p(M)= M^2(M-I)^3=0.$$
The minimal polynomial for $M$ is the polynomial $q$ of smallest degree so that $q(M)=0$. You may find it  by trial and error looking for the smallest powers (instead of 2 and 3) for which you get the zero matrix. Trying out you find
here $M^2(M-I)=0$ or equivalently $M^3=M^2$ which implies that $M^n=M^2$ for all $n\geq 2$.
This solves the problem for the given matrix. In the general case, it works as follows: Calculate the characteristic polynomial, and by trial and error the minimal polynomial (as above). Then $M^n$ to converge to a non-zero matrix iff $1$ is a simple root of the minimal polynomial and all other roots (simple or not) are strictly smaller than one in absolute values. So if for example $M^2(M-I)^2=0$ had been the minimal polynomial then $M^n$ would not converge (which may be interpreted as the presence of a non-trivial Jordan block associated to the eigenvalue 1).
A: $
\def\idx{{\rm index}(A)}
$For a Markov/stochastic matrix $M\in{\mathbb R}^{n\times n}$, you could calculate the limit in terms of the Drazin inverse.
First, define the auxiliary matrix $$A = I-M$$
Then, the limit is $$\lim_{\ell\to\infty}M^\ell = \big(I-AA^D\big)$$
For a small matrix like yours, the Drazin inverse can be readily calculated in terms of the pseudoinverse of an appropriate power of $A$
$$A^D = A^k\Big(A^{2k+1}\Big)^+A^k,\qquad k\ge\idx$$
Since $\,(0\le\idx\le n),\,$ if you are unable to calculate $\idx$, just use $k=n$.
