Question: Create a Python function named random square matrix power that can randomly generate a n - by - n squared matrix A and calculate its

Create a Python function named random square matrix power that can randomly generate a n-by-n
squared matrix A and calculate its p-th power Ap
. The specific requirements are as follows.
Two inputs: (i) n, the size of the squared matrix; (ii) p, the power of matrix to be calculated
Two outputs: (ii) A, the randomly generated matrix; (ii) Ap
, the p-th power of A
Test instance: test your algorithm with inputs n =3 and p =10, print the outputs.
Packages and functions you may need to use (click will lead you to the webpages):

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!