Consider the matrix $A$ as follows\begin{pmatrix} -3&2 \\ -1&0 \end{pmatrix}
Find the matrix $A^5$ ?
Instead of doing iterative multiplications, any small approach for this ?
Consider the matrix $A$ as follows\begin{pmatrix} -3&2 \\ -1&0 \end{pmatrix}
Find the matrix $A^5$ ?
Instead of doing iterative multiplications, any small approach for this ?
use the cayley-hamilton theorem. the char poly is $\lambda^2 + 3 \lambda + 2 = 0$ so the matrix $A$ satisfies $$A^2 + 3A + 2I = 0 \to A^2 = -3A - 2I, A^3 = -3A^2 -2A=9A+6I-2A=7A+6I, A^4 = \ldots, A^5 = \ldots $$
you can cut down the work if you use the division algorithm $\lambda^5 = q(\lambda)(\lambda^2 + 3 \lambda + 2) + a\lambda + b$ then $A^5 = aA + bI.$
Rather than doing 4 iterated multiplications ($A^5 = A \cdot A \cdot A \cdot A \cdot A$), a bit quicker would be to do $A\cdot A = A^2$, then $A^2 \cdot A^2 = A^4$ and finally $A \cdot A^4 = A^5$ which reduces the number of matrix multiplications to perform from 4 to 3.
This approach generalizes for higher powers, take a look at exponentation by squaring. You will only need to carry out $\lfloor \log_2n\rfloor$ multiplications to find $A^n$; in your case $\lfloor \log_2 5\rfloor = 3$.
In general you would try to diagonalize a matrix to easily calculate higher powers. This works in your case, as the matrix is diagonalizable. However, for a $2 \times 2$-matrix and exponent $5$, you probably won't gain much time/efficiency compared to direct computation via iterated multiplication. This will be more interesting for higher powers and/or larger matrices.
The use of diagonalization to compute powers of a matrix in a nutshell: if a matrix $A$ can be written as $PDP^{-1}$ with $D$ a diagonal matrix, then you have: $$A^n = \left( PDP^{-1} \right)^n = \ldots = PD^nP^{-1}$$ where $D^n$ is easy (diagonal elements to the power $n$).