3 ms·If you diagonalize the matrix in the problem, the formula pops out pretty quickly.by msds 12y agoIf you diagonalize the matrix in the problem, the formula pops out pretty quickly.hacknat 12y agoNice catch, is that from Knuth's book?dbaupp 12y agoDiagonalization is a fairly standard mathematical trick for doing matrix powers easily. If X is some matrix that can be diagonalised as X = P^(-1) D P then X^n = (P^(-1) D P)^n = P^(-1) D^n P