Project 3

1. Find two 2 by 2 matrices, M and N, such that M*N is not the same as N*M.
2. Find two matrices, A and B, of any size so that you can compute A*B but you cannot compute B*A. Check your work with Sage.
3. Use Sage to create a random $3\times 6$ matrix, D. Then, multiply this matrix by the following three matrices:

(1)
\begin{align} E_1=\begin{bmatrix} 1 & 0 & 0\\ 0 & 0 & 1\\ 0 & 1 & 0\end{bmatrix} \end{align}
(2)
\begin{align} E_2=\begin{bmatrix} 1 & 0 & 0\\ 0 & 5 & 0\\ 0 & 0 & 1\end{bmatrix} \end{align}
(3)
\begin{align} E_3=\begin{bmatrix} 1 & 0 & 5\\ 0 & 1 & 0\\ 0 & 0 & 1\end{bmatrix} \end{align}

Explain briefly what happened in each case. What do you think the matrices $E_1,E_2, E_3$ represent?

4. Create a $4\times 4$ matrix, $A$, that is singular.
a. What is the rank of the matrix you chose?
b. Use the "span" command to determine the span of the columns of $A$. (notice the "dimension" that is given by Sage).
c. Use the "span" command to determine the span of the rows of $A$. (notice the "dimension" that is given by Sage).
d. Is there any connection between the previous three answers?
e. Determine if the vector $(2,1,2,3)$ is in the span of the columns of your matrix $A$. Is it in the span of the rows of $A$?

5. For the following four matrices, figure out a pattern for the matrix $A^n$ where $n$ is any positive integer.
a. $A=\begin{pmatrix}1 & 0 & 0 & 0\\ 0 & 2 & 0 & 0\\ 0 & 0 & 3 & 0\\ 0 & 0 & 0 & 4 \end{pmatrix}$

b. $A=\begin{pmatrix}1 & 1\\ 0 & 1\end{pmatrix}$

c. $A=\begin{pmatrix}0 & 1 & 0 & 0\\0 & 0 & 1 & 0\\0 & 0 & 0 & 1\\0 & 0 & 0 & 0\end{pmatrix}$

d. $A=\begin{pmatrix}0 & 1 & 0 \\0 & 0 & 1\\1 & 0 & 0\end{pmatrix}$

6. Use Sage to create the functions $T:\mathbb{R}^2\to\mathbb{R}^2$ and $R:\mathbb{R}^2\to\mathbb{R}^2$ given by

(4)
\begin{align} T\left(\begin{pmatrix}x_1\\ x_2\end{pmatrix}\right)=\begin{pmatrix}x_1+x_2\\ x_1-x_2\end{pmatrix}\\ \\ R\left(\begin{pmatrix}x_1\\ x_2\end{pmatrix}\right)=\begin{pmatrix}4x_1x_2\\ 3x_1\end{pmatrix} \end{align}

and then use Sage to determine if either of these is a Linear Transformation.

7. Let $A=\begin{pmatrix}1 & 3\\0 & 1\end{pmatrix}$. Define the linear transformation $\mu_A:\mathbb{R}^2\to\mathbb{R}^2$.
a. Graph a circle and a square (parametrically) and apply the transformation to the circle and to the square, in different colors. (see below for useful code).
b. Graph them on the same axis as the original shapes.
c. Apply the transformation to any other "shape" you choose (use two different colors and graph them on the same plane).

8. Use parametric_plot3d to graph the unit sphere, which is given by the parametric equations: $x=\left(\sqrt{1-u^2}\right)\cdot\cos(t)$, $y=\left(\sqrt{1-u^2}\right)\cdot\sin(t)$, $z=u$ where $-1\leq u\leq 1$ and $0\leq t\leq 2\pi$.
a. Then apply the linear transformation $T:\mathbb{R}^3\to\mathbb{R}^3$ given by $T\left(\begin{pmatrix}x_1\\ x_2\\ x_3\end{pmatrix}\right)=\begin{pmatrix}4x_1\\ 4x_2\\ 4x_3\end{pmatrix}$ (you may want to use opacity=.5 to be able to ``see through objects" that have been graphed).
b Can you guess what this linear transformation does in general by looking at the picture of what it does to the sphere?

Interesting Code to copy

In order to plot a square using parametric equations, try the following command:

P1=parametric_plot([-1,t], (t,-1,1), color='red')
P2=parametric_plot([1,t], (t,-1,1), color='blue')
P3=parametric_plot([t,-1], (t,-1,1), color='green')
P4=parametric_plot([t,1], (t,-1,1), color='yellow')
P1+P2+P3+P4

in one box. As a side note, each plot above gives one side of the square. Notice that the first one gives x coordinate always -1 and the y coordinate ranges between -1 and 1, etc.