Homework 5
Table of Contents
The following assignment is due Thursday 10/10 by 11:59 PM. You should submit all your written solutions to Gradescope as a single pdf. Follow the instructions in the programming problem for code solutions.
- Your solutions must be exceptionally neat and the final answer in your solution to each problem must be abundantly clear, e.g., surrounded in a very visible box. The graders have license to dock points for illegible or unclear solutions.
- For the written part, choose the correct pages corresponding to each problem in Gradescope. Note that Gradescope registers your submission as soon as you submit it, so you don't need to rush to choose the pages. You will receive no credit if you do not choose the correct pages, no exceptions.
1. Matrix Multiplication
Compute each of the following matrix multiplications. Show your work
and/or explain your answer. Your work and/or explanation cannot
include using sympy.rref()
(but, as usual, you can use it to check
your answer.)
1.1. (3 points)
1.2. (3 points)
1.3. (3 points)
1.4. (3 points)
1.5. (3 points)
Hint: Don't work through the entire sequence multiplication. Try to find a pattern.
2. One-to-one/Onto
For each of the following matrices determine if the matrix
transformation it defines is (1) one-to-one, (2) onto, (3) both,
or (4) neither.1 Justify your answer for each part.
Your justification cannot include using sympy.rref()
(but, as usual,
you can use it to check your answer). Hint: There's one of
each. (Errata: 10/6 9:00PM, There was an incorrect number in one of the
matrices. The updated number below is in \textcolor{red}{red}.)
2.1. (3 points)
2.2. (3 points)
2.3. (3 points)
2.4. (3 points)
3. Matrix of a Transformation
For each of the following parts, you must show your work.
3.1. (3 points)
Determine the matrix which implements the transformation \(T : \mathbb R^4 \to \mathbb R^4\) that swaps the first and second entries of its input, e.g.,
\begin{align*} T \left( \begin{bmatrix} 1 \\ 2 \\ 3 \\ 4 \end{bmatrix} \right) = \begin{bmatrix} 2 \\ 1 \\ 3 \\ 4 \end{bmatrix} \end{align*}3.2. (3 points)
Determine the matrix which implements the transformation
\begin{align*} \begin{bmatrix} x_1 \\ x_2 \\ x_3 \\ x_4 \end{bmatrix} \mapsto \begin{bmatrix} -2x_2 + x_3 + x_4 \\ x_1 + x_3 \\ -3x_3 - 3x_4\\ 9x_4 \end{bmatrix} \end{align*}In addition, write down the domain and the codomain of this transformation.
3.3. (3 points)
Determine the matrix which implements the transformation with the following input-output behavior.
\begin{align*} T \left( \begin{bmatrix} -7 \\ -3 \end{bmatrix} \right) = \begin{bmatrix} -4 \\ 3 \\ 4 \\ 0 \\ 1 \end{bmatrix} \qquad T \left( \begin{bmatrix} 9 \\ 4 \end{bmatrix} \right) = \begin{bmatrix} 13 \\ 0 \\ 0 \\ 8 \\ 3 \end{bmatrix} \end{align*}In addition, write down the domain and codomain of this transformation.
4. Reflection
4.1. (5 points EC)
Extra Credit. Determine the matrix which implements the transformation \(T : \mathbb R^3 \to \mathbb R^3\) that reflects vectors across the plane defined by the linear equation \(x + y + z = 0\). You must show your work.
4.2. (5 points)
Determine the matrix which implements the transformation \(T : \mathbb R^2 \to \mathbb R^2\) that reflects vectors across the line \(y = \left(\tan\frac{3\pi}{8}\right)x\). You must show your work.
5. Matrix Tweets (Programming)
(12 points) We're going to have to wait one more week before we can get into some more interesting applications of linear algebra. For now, we continue to practice using NumPy. One of the most important skills we need to develop is the ability to construct and and combine NumPy arrays.
You're given start code in the file hw05.py
. Please do not change
the name of this file when you submit it, nor the names of the
variables included in the starter code. Also, please do not include
any additional functions or comments. You must only fill in
the TODO items in the starter code.
There are six matrices listed below which you have to build as NumPy arrays. Your goal is to build these matrices as NumPy arrays as concisely as possible, specifically in fewer than 140 characters. In particular, you should not build the matrices explicitly. This may require reading through some of the NumPy documentation…
You'll upload a single python file hw05.py
to Gradescope with your
implementation of the TODO items. There are no tests this week.
We'll simply be checking that your matrices are correct, and that you
are within the character limit.
a0
(Hint:numpy.eye
andnp.zeros
andnumpy.vstack
)a1
(Hint: Look at the examples fornumpy.eye
in the NumPy documentation)a2
(Hint:numpy.ones
andnumpy.hstack
)a3
(Hint:np.arange
andnp.reshape
, this is the longest one)a4
(Hint:numpy.diag
and array slicing and matrix addition)a5
(Hint:numpy.tril
andnumpy.triu
, see the examples in the documentation)
Footnotes:
You should write your answer in words, e.g., write "one-to-one", not "(1)".