I have a matrix of non-negative numbers, say $A$.
(1) How do we calculate $A^n$?
(2) How can we calculate $A^n$ using usual matrix exponential trick to do it fast ?
Edit 1
Also theres another property of matrix A that its diagonals consists always of 0 & other elements either 0 or 1.
Can we do this just by involving matrix multiplication ?
Best Answer
Another approach is called exponentiation by squaring. It still requires you to multiply out matrices like normal, but you only need $O(\log n)$ such multiplications.
This approach is most useful if you want a few values for $A^k$ with $k$ large. But if you want the values of $A^k$ for a sequence of values $k=0,1,\dots$ it is isn't much help.