# If a matrix is non diagonalizable, what other method can I use to calculate the nth power?

First off, I have this matrix A:

1 0 3
1 0 2
0 5 0


I have calculated the eigenvalues, which are (11-sqrt(141))/2 and (11+sqrt(141))/2. From what I understand, if I don't have 3 distinct eigenvalues then the matrix is not diagonalizable in R. Is this matrix diagonalizable in R?

The second part of my question is: if it's not diagonalizable then what other option do I have for calculating A^n? n is really big, something like the order of 10^12. I need to calculate this for a programming problem.

• I think you need a different approach to your problem. $A^n$ is going to have impossibly big entries for $n=10^{12}$. Already for $n=100$ we have the row 1, col 1 entry as 21569359182880372085408476588692190023999240141617216817121. – almagest Sep 6 '14 at 11:06
• The eigenvalues are false, check on wolframalpha – Bman72 Sep 6 '14 at 11:11
• you may be able to prove something by induction. Do a Jordan normal decomposition, as suggested, then see what you can do with it. – ShakesBeer Sep 6 '14 at 11:11
• The sum of the eigenvalues equals the sum of the diagonal entries. If your two eigenvalues are correct, then $-10$ must also be an eigenvalue. – Gerry Myerson Sep 6 '14 at 11:12
• The solution of the problem will be mod 1000000006. Thanks for pointing out that my calculations were wrong. :) First things first. I need to find out where I went wrong on calculating the eigenvalues and then proceed with the solution. – Ariel Sep 6 '14 at 11:38

Check the Jordan decomposition (diagonal matrix + nilpotent). But as pointed out in the comments, if you raise something to the power $10^{12}$, don't expect your computer to be able to handle it.
• The solution of the problem will be mod 1000000006. – Ariel Sep 6 '14 at 11:39
$$\det(xI-A)=\begin{vmatrix}x-1&0&-3\\ -1&x&-2\\ 0&-5&x\end{vmatrix}=x^2(x-1)-15-10(x-1)=x^3-x^2-10x-5$$