grandes-ecoles 2020 Q33

grandes-ecoles · France · centrale-maths1__psi Matrices Matrix Power Computation and Application
Write in Python language a function \texttt{puiss2k} that takes as argument a square matrix $M$ and a natural integer $k$ and returns the matrix $M^{2^k}$ by performing $k$ matrix products. One may exploit the fact that $M^{2^{k+1}} = M^{2^k} M^{2^k}$.
Write in Python language a function \texttt{puiss2k} that takes as argument a square matrix $M$ and a natural integer $k$ and returns the matrix $M^{2^k}$ by performing $k$ matrix products. One may exploit the fact that $M^{2^{k+1}} = M^{2^k} M^{2^k}$.