2023-03-26 20:00:14 -07:00
|
|
|
\section{Matrices}
|
|
|
|
|
|
|
|
\definition{}
|
|
|
|
A \textit{matrix} is a two-dimensional array of numbers: \\
|
|
|
|
$$
|
|
|
|
A =
|
|
|
|
\begin{bmatrix}
|
|
|
|
1 & 2 & 3 \\
|
|
|
|
4 & 5 & 6
|
|
|
|
\end{bmatrix}
|
|
|
|
$$
|
|
|
|
The above matrix has two rows and three columns. It is thus a $2 \times 3$ matrix.
|
|
|
|
|
2023-03-26 22:09:51 -07:00
|
|
|
\definition{}
|
2023-04-03 11:13:33 -07:00
|
|
|
We can define the product of a matrix $A$ and a vector $v$:
|
2023-03-26 20:00:14 -07:00
|
|
|
|
|
|
|
$$
|
|
|
|
Av =
|
|
|
|
\begin{bmatrix}
|
|
|
|
1 & 2 & 3 \\
|
|
|
|
4 & 5 & 6
|
|
|
|
\end{bmatrix}
|
|
|
|
\begin{bmatrix}
|
|
|
|
a \\ b \\ c
|
|
|
|
\end{bmatrix}
|
|
|
|
=
|
|
|
|
\begin{bmatrix}
|
|
|
|
1a + 2b + 3c \\
|
|
|
|
4a + 5b + 6c
|
|
|
|
\end{bmatrix}
|
|
|
|
$$
|
2023-04-04 15:03:15 -07:00
|
|
|
Note that each element of the resulting $2 \times 1$ matrix is the dot product of a row of $A$ with $v$:
|
2023-03-26 20:00:14 -07:00
|
|
|
|
|
|
|
$$
|
|
|
|
Av =
|
|
|
|
\begin{bmatrix}
|
|
|
|
\text{---} a_1 \text{---} \\
|
|
|
|
\text{---} a_2 \text{---}
|
|
|
|
\end{bmatrix}
|
|
|
|
\begin{bmatrix}
|
|
|
|
| \\
|
|
|
|
v \\
|
|
|
|
| \\
|
|
|
|
\end{bmatrix}
|
|
|
|
=
|
|
|
|
\begin{bmatrix}
|
|
|
|
r_1v \\
|
|
|
|
r_2v
|
|
|
|
\end{bmatrix}
|
|
|
|
$$
|
|
|
|
|
|
|
|
Naturally, a vector can only be multiplied by a matrix if the number of rows in the vector equals the number of columns in the matrix.
|
|
|
|
|
2023-04-03 13:19:23 -07:00
|
|
|
|
|
|
|
\problem{}
|
|
|
|
Say you multiply a size-$m$ vector by an $m \times n$ matrix. What is the size of your result?
|
|
|
|
|
|
|
|
\vfill
|
|
|
|
|
|
|
|
|
2023-03-26 20:00:14 -07:00
|
|
|
\problem{}
|
2023-03-26 22:09:51 -07:00
|
|
|
Compute the following:
|
2023-03-26 20:00:14 -07:00
|
|
|
|
|
|
|
$$
|
|
|
|
\begin{bmatrix}
|
2023-04-03 11:13:33 -07:00
|
|
|
1 & 2 \\
|
|
|
|
3 & 4 \\
|
|
|
|
5 & 6
|
2023-03-26 20:00:14 -07:00
|
|
|
\end{bmatrix}
|
|
|
|
\begin{bmatrix}
|
|
|
|
5 \\ 3
|
|
|
|
\end{bmatrix}
|
|
|
|
$$
|
|
|
|
|
|
|
|
\vfill
|
|
|
|
\pagebreak
|
|
|
|
|
|
|
|
|
|
|
|
\generic{Remark:}
|
|
|
|
It is a bit more interesting to think of matrix-vector multiplication in the following way: \\
|
|
|
|
|
|
|
|
\begin{minipage}[t]{0.48\textwidth}\vspace{0pt}
|
|
|
|
\begin{center}
|
|
|
|
The problem:
|
|
|
|
\vspace{2mm}
|
|
|
|
|
|
|
|
$$
|
|
|
|
\begin{bmatrix}
|
2023-04-03 11:13:33 -07:00
|
|
|
1 & 2 \\
|
|
|
|
3 & 4 \\
|
|
|
|
5 & 6
|
2023-03-26 20:00:14 -07:00
|
|
|
\end{bmatrix}
|
|
|
|
\begin{bmatrix}
|
|
|
|
5 \\ 3
|
|
|
|
\end{bmatrix}
|
|
|
|
=
|
|
|
|
\begin{bmatrix}
|
2023-04-03 11:13:33 -07:00
|
|
|
11 \\ 27 \\ 43
|
2023-03-26 20:00:14 -07:00
|
|
|
\end{bmatrix}
|
|
|
|
$$
|
|
|
|
\end{center}
|
|
|
|
\end{minipage}%
|
|
|
|
\hfill
|
|
|
|
\begin{minipage}[t]{0.48\textwidth}\vspace{0pt}
|
|
|
|
\begin{center}
|
|
|
|
Top-input, right-output:
|
|
|
|
\vspace{2mm}
|
|
|
|
|
|
|
|
\begin{tikzpicture}[>=stealth,thick,baseline]
|
|
|
|
\matrix [
|
|
|
|
matrix of math nodes,
|
|
|
|
left delimiter={[},
|
|
|
|
right delimiter={]}
|
|
|
|
] (A) {
|
2023-04-03 11:13:33 -07:00
|
|
|
1 & 2 \\
|
2023-03-26 20:00:14 -07:00
|
|
|
3 & 4 \\
|
2023-04-03 11:13:33 -07:00
|
|
|
5 & 6 \\
|
2023-03-26 20:00:14 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
\node[
|
|
|
|
fit=(A-1-1)(A-1-1),
|
|
|
|
inner xsep=0mm,inner ysep=3mm,
|
|
|
|
label=above:5
|
|
|
|
] (L) {};
|
|
|
|
\draw[->, gray] (L.north) -- ([yshift=0mm]A-1-1.north);
|
|
|
|
|
|
|
|
\node[
|
|
|
|
fit=(A-1-2)(A-1-2),
|
|
|
|
inner xsep=0mm,inner ysep=3mm,
|
|
|
|
label=above:3
|
|
|
|
] (R) {};
|
|
|
|
\draw[->, gray] (R.north) -- ([yshift=0mm]A-1-2.north);
|
|
|
|
|
|
|
|
|
|
|
|
\node[
|
|
|
|
fit=(A-1-2)(A-1-2),
|
|
|
|
inner xsep=8mm,inner ysep=0mm,
|
2023-04-03 11:13:33 -07:00
|
|
|
label=right:{$5 + 6 = 11$}
|
2023-03-26 20:00:14 -07:00
|
|
|
](Y) {};
|
|
|
|
\draw[->, gray] ([xshift=3mm]A-1-2.east) -- (Y);
|
|
|
|
|
|
|
|
\node[
|
|
|
|
fit=(A-2-2)(A-2-2),
|
|
|
|
inner xsep=8mm,inner ysep=0mm,
|
2023-04-03 11:13:33 -07:00
|
|
|
label=right:{$15 + 12 = 27$}
|
2023-03-26 20:00:14 -07:00
|
|
|
](H) {};
|
|
|
|
\draw[->, gray] ([xshift=3mm]A-2-2.east) -- (H);
|
|
|
|
|
|
|
|
\node[
|
|
|
|
fit=(A-3-2)(A-3-2),
|
|
|
|
inner xsep=8mm,inner ysep=0mm,
|
2023-04-03 11:13:33 -07:00
|
|
|
label=right:{$25 + 18 = 43$}
|
2023-03-26 20:00:14 -07:00
|
|
|
](N) {};
|
|
|
|
\draw[->, gray] ([xshift=3mm]A-3-2.east) -- (N);
|
|
|
|
\end{tikzpicture}
|
|
|
|
\end{center}
|
|
|
|
\end{minipage}%
|
|
|
|
|
|
|
|
\vspace{2mm}
|
|
|
|
|
2023-04-03 13:19:23 -07:00
|
|
|
This is only a model for intuition, though. \\
|
2023-03-26 20:00:14 -07:00
|
|
|
Make sure you understand the dot product definition on the previous page.
|
|
|
|
|
|
|
|
\vspace{5mm}
|
|
|
|
|
|
|
|
\theorem{}<thebigtheorem>
|
|
|
|
Any linear map $T: \mathbb{R}^n \to \mathbb{R}^m$ can be written as an $n \times m$ matrix. \\
|
|
|
|
Conversely, every $n \times m$ matrix represents a liner map $T: \mathbb{R}^n \to \mathbb{R}^m$ \\
|
|
|
|
|
|
|
|
\vspace{2mm}
|
|
|
|
|
2023-04-03 13:19:23 -07:00
|
|
|
In other words, \textbf{matrices are linear transformations}.
|
2023-03-26 20:00:14 -07:00
|
|
|
\problem{}<prooffwd>
|
|
|
|
Show that the transformation $T: \mathbb{R}^n \to \mathbb{R}^m$ defined by $T(v) = Av$ is linear. \\
|
2023-04-03 13:19:23 -07:00
|
|
|
\hint{What is $A$? What is $v$? What are their sizes?}
|
2023-03-26 20:00:14 -07:00
|
|
|
|
|
|
|
\vfill
|
|
|
|
|
|
|
|
\problem{}<proofback>
|
2023-04-03 13:19:23 -07:00
|
|
|
Show that any linear transformation $T: \mathbb{R}^n \to \mathbb{R}^m$ can be written as $T(v) = Av$.
|
2023-03-26 20:00:14 -07:00
|
|
|
|
2023-03-26 22:09:51 -07:00
|
|
|
\vfill
|
|
|
|
|
2023-04-05 09:08:43 -07:00
|
|
|
\vfill
|
|
|
|
\pagebreak
|
|
|
|
|
|
|
|
\problem{}
|
|
|
|
Show that $\mathbb{P}^n$ is a vector space.
|
|
|
|
\hint{$\mathbb{P}^n$ is the set of all polynomials of degree $ \leq n$.}
|
|
|
|
|
|
|
|
\vfill
|
2023-03-26 22:09:51 -07:00
|
|
|
|
|
|
|
\problem{}
|
2023-04-05 09:08:43 -07:00
|
|
|
Is $\frac{d}{dx}(p): \mathbb{P}^n \to \mathbb{P}^{n-1}$ a linear map on $\mathbb{P}^n$? \\
|
|
|
|
|
|
|
|
\vfill
|
|
|
|
|
|
|
|
\problem{}
|
|
|
|
Consider the transformation $D: \mathbb{P}^3 \to \mathbb{P}^2$ defined by $D(p) = \frac{d}{dx}(p)$. \\
|
2023-03-26 22:09:51 -07:00
|
|
|
Find a matrix that corresponds to $D$. \\
|
2023-04-03 13:19:23 -07:00
|
|
|
\hint{$\mathbb{P}^3$ and $\mathbb{R}^4$ are isomorphic. How so?}
|
2023-03-26 22:09:51 -07:00
|
|
|
|
2023-03-26 20:00:14 -07:00
|
|
|
\vfill
|
|
|
|
|
|
|
|
\problem{}
|
2023-04-05 09:08:43 -07:00
|
|
|
Show that the set of all linear maps $\mathbb{R}^n \to \mathbb{R}^m$ is a vector space.
|
2023-03-26 20:00:14 -07:00
|
|
|
|
|
|
|
\vfill
|
|
|
|
\pagebreak
|