Before you turn this problem in, make sure everything runs as expected. First, restart the kernel (in the menubar, select Kernel\(\rightarrow\)Restart) and then run all cells (in the menubar, select Cell\(\rightarrow\)Run All).

Make sure you fill in any place that says YOUR CODE HERE or “YOUR ANSWER HERE”, as well as your name and collaborators below:

NAME = ""
COLLABORATORS = ""

inverse by linear algebra#

If we have a matrix:

\(\mathbf{A} = \left[ \begin{smallmatrix} 1 & -1\\ 1 & 2 \end{smallmatrix} \right]\)

that we want to find the inverse of, we want to find values of \(x, y, w, z\) that satisfy this matrix equation.

\(\mathbf{A} = \left[ \begin{smallmatrix} 1 & -1\\ 1 & 2 \end{smallmatrix} \right] \left[ \begin{smallmatrix} x & z\\ y & w \end{smallmatrix} \right] = \left[ \begin{smallmatrix} 1 & 0\\ 0 & 1 \end{smallmatrix} \right]\)

We can write this as a set of linear equations:

\(x - y = 1\)

\(x + 2y = 0\)

\(z - w = 0\)

\(z + 2w = 1\)

Use np.linalg.solve to solve these equations.

Show that the \(x, y, w, z\) values you get form a matrix equivalent to one from np.linalg.inv.

Finally, show that \(\mathbf{A} \cdot \mathbf{A^{-1}} = \mathbf{I}\).

When you are done, download a PDF and turn it in on Canvas. Make sure to save your notebook, then run this cell and click on the download link.

%run ~/f23-06623/f23.py
%pdf