Understand how to implement elementary linear algebra operations in Python
1) Compute the determinant and transpose (by hand) of the following matrices. i.
ii.
iii.
iv.
2) Use Python and Numpy, in particular numpy.linalg.det
and .T
to check if your answers are correct.
3) Compute the element-wise product of the following two matrices.
i.
ii.
4) Use Python and Numpy, in particular .multiply
and *
to check if your answers are correct.
5) Compute the matrix (dot) product (by hand) of the following two matrices.
i.
ii.
6) Use Python and Numpy, in particular .dot
and @
to check if your answers are correct.
7) Compute the matrix inverse (by hand) of the following matrix.
hint: clicky
8) Use Python and Numpy, in particular numpy.linalg.inv
to check if your answers are correct.
9) Create a greyscale pixel image using numpy, and rotate the image clockwise by 90 degrees, only using linear algebra operations.
hint: reuse the pixel art you created in block A.
10) Given the following linear algebraic equation: B = (XTX)-1XTY. Write a psuedocode for a function which will take two matrices X and Y as input, and return B.
As an additional challange, replace the matrix operations in your psuedocode with their
numpy
equivalents.