Question: 3 . 2 . 1 . 1 Arrays as matrices Import numpy as n p Define A to be a 4 4 matrix containing 1

3.2.1.1 Arrays as matrices
Import numpy as np
Define A to be a 44 matrix containing 1 as every entry. Then, use A to define B, a 44 matrix containing 2 as every entry.
Define c to be a vector containing each integer from 0 to 15 and reshape it into a 44 matrix, C.
Use the NumPy function trace() to confirm that the traces of A, B and C are 4,8 and 30 respectively.
What does the NumPy function eye () create?
NumPy has a submodule for linear algebra called linalg. Using the determinant function ) in this submodule, confirm that the determinants of A, B and C are all zero. Comment on your results.
Define the matrix, Csq, whose entries are each the square root of the corresponding entries of C. Use a function from numpy. linalg to find its inverse and evaluate the product Csq*Csq-1. Comment on your results.
The function eig() in numpy. linalg computes eigenvalues and eigenvectors of its argument. How are eigenvalues and eigenvectors for A and B related? Show that Avi=ivi,iin {1,2,3,4}, where i and vi are eigenvalues and eigenvectors of the matrix A, respectively.
 3.2.1.1 Arrays as matrices Import numpy as np Define A to

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!