Exercises: Matrices and Linear Maps
exercises, matrices, linear maps, composition
1 Scope and Goals
This set trains four things:
- testing whether a rule is linear
- building a matrix from basis images
- interpreting matrix multiplication as composition
- preparing for eigenvalue and least-squares pages
2 Prerequisites
- linear combinations
- basis vectors
- matrix-vector multiplication
3 Warm-Up Problems
- Decide whether \(T(x,y)=(x+y,2y)\) is linear.
- Find the matrix of \(T(x,y)=(2x-y,x+y)\) by computing \(T(e_1)\) and \(T(e_2)\).
4 Core Problems
Let
\[ T(e_1) = \begin{bmatrix} 1 \\ 2 \end{bmatrix}, \qquad T(e_2) = \begin{bmatrix} 3 \\ 0 \end{bmatrix}. \]
Write the matrix of \(T\).
Let
\[ A = \begin{bmatrix} 1 & 2 \\ 0 & 1 \end{bmatrix}, \qquad B = \begin{bmatrix} 2 & 0 \\ 0 & 1 \end{bmatrix}. \]
Compute \(AB\) and \(BA\).
If \(T(x)=Ax\) and \(S(x)=Bx\), explain in words why \(T \circ S\) corresponds to \(AB\).
5 Proof Problems
- Prove that any linear map sends \(0\) to \(0\).
- Prove that if two linear maps agree on a basis, then they agree everywhere.
6 Computational or Applied Problems
- Open Computation Lab: Matrix Composition and Basis Action. Change the shear and scale, then compare \(ABx\) with \(BAx\) for the same sample vector.
- In software, batch several vectors into a matrix \(X\) and verify that applying the same matrix \(W\) to each vector individually matches the batched product.
7 Hints
- For linearity, check both addition and scalar multiplication.
- The columns of the matrix are the images of the basis vectors.
- Composition order is right-to-left in function language.
8 Full Solutions
8.1 Solution 1
For addition,
\[ T((x_1,y_1)+(x_2,y_2)) = T(x_1+x_2, y_1+y_2) = (x_1+x_2+y_1+y_2,\; 2y_1+2y_2), \]
which equals \(T(x_1,y_1)+T(x_2,y_2)\).
For scaling,
\[ T(c(x,y)) = T(cx,cy) = (cx+cy, 2cy) = c(x+y,2y)=cT(x,y). \]
So the map is linear.
8.2 Solution 2
We have
\[ T(e_1)= \begin{bmatrix} 2 \\ 1 \end{bmatrix}, \qquad T(e_2)= \begin{bmatrix} -1 \\ 1 \end{bmatrix}. \]
So the matrix is
\[ \begin{bmatrix} 2 & -1 \\ 1 & 1 \end{bmatrix}. \]
8.3 Solution 3
The matrix is
\[ \begin{bmatrix} 1 & 3 \\ 2 & 0 \end{bmatrix}. \]
8.4 Solution 4
\[ AB = \begin{bmatrix} 2 & 2 \\ 0 & 1 \end{bmatrix}, \qquad BA = \begin{bmatrix} 2 & 4 \\ 0 & 1 \end{bmatrix}. \]
So the matrices do not commute.
8.5 Solution 5
Applying \(S\) first gives \(Bx\). Applying \(T\) after that gives \(A(Bx)=(AB)x\). The product matrix stores the combined action in coordinates.
9 Common Errors
- checking only one linearity property
- writing rows instead of columns when building a matrix from basis images
- reading \(AB\) as “do \(A\) first”
10 What To Do Next
Open Subspaces, Basis, and Dimension next. Once matrices are treated as maps, the next question is which subspaces those maps create or preserve.
11 Sources and Further Reading
- MIT 18.06SC: Linear Transformations and their Matrices -
First pass- official source for exercises in the operator viewpoint. Checked2026-04-24. - Hefferon, Linear Algebra -
Second pass- strong self-study exercise source on linear maps and matrices. Checked2026-04-24. - Attention is All you Need -
Paper bridge- useful later for spotting learned linear projections in an architecture paper. Checked2026-04-24.