**Read** Markov chains part of Section 3.7 for next class.
Work through recommended homework
questions (and check for updates).

**Extra Midterm Review:** Today, 4:30-6:00pm, MC110. Bring questions.

**Midterm location** is based on first letter of last name:
HSB35 A-H, HSB236 I-Q, HSB240 R-Z.
Be sure to write in the correct room!

**Midterm:** Saturday, March 1, 6:30pm-9:30pm.
It will cover the material up to and including Monday's lecture,
but not electrical networks.
**Practice midterms** are on the website.
See the missed exam section of
the course web page for policies, including for illness.

**Tutorials:** Quiz next week covers 3.5 and 3.6.

**Help Centers:** Monday-Friday 2:30-6:30 in MC106.

**Theorem 3.29:** For every vector $v$ in $S$, there is *exactly one
way* to write $v$ as a linear combination of the vectors in $\cB$:
$$
\vv = c_1 \vv_1 + \cdots + c_k \vv_k
$$

**Proof:** Try to work it out yourself! It's a good exercise.$\quad\Box$

We call the coefficients $c_1, c_2, \ldots, c_k$ the **coordinates
of $\vv$ with respect to $\cB$**, and write
$$
[\vv]_{\cB} = \ccollll {c_1} {c_2} {\vdots} {c_k}
$$

We already intuitively understood this theorem in the case where $S$ is a plane through the origin in $\R^3$. Here's an example of this case:

**Example:** Let $S$ be the plane through the origin in $\R^3$
spanned by $\vv_1 = \colll 1 2 3$ and $\vv_2 = \colll 4 5 6$,
so $\cB = \{ \vv_1, \vv_2 \}$ is a basis for $S$.
Let $\vv = \colll 6 9 {12}$. Then
$$
\vv = 2 \vv_1 + 1 \vv_2
\qqtext{so}
[\vv]_{\cB} = \coll 2 1
$$
Note that while $\vv$ is a vector in $\R^3$, it only has **two** coordinates
with respect to $\cB$.

We already know how to find the coordinates. For this example, we would solve the system $$ \bmat{rr} 1 & 4 \\ 2 & 5 \\ 3 & 6 \\ \emat \, \coll {c_1} {c_2} = \ccolll 6 9 {12} $$

**Example:** Let $\cB = \{ \ve_1, \ve_2, \ve_3 \}$ be the standard basis
for $\R^3$, and consider $\vv = \colll 6 9 {12}$. Then
$$
\vv = 6 \ve_1 + 9 \ve_2 + 12\ve_3
\qqtext{so}
[\vv]_{\cB} = \colll 6 9 {12}
$$
We've implicitly been using the standard basis everywhere, but often in
applications it is better to use a basis suited to the problem.

**Example:** If
$
A = \bmat{rr} 0 & 1 \\ 2 & 3 \\ 4 & 5 \emat
$
then
$$
\kern-9ex
T_A\left(\coll {\!-1} 2\right) = A \coll {\!-1} 2 = \bmat{rr} 0 & 1 \\ 2 & 3 \\ 4 & 5 \emat \coll {-1} 2
= -1 \colll 0 2 4 + 2 \colll 1 3 5 = \colll 2 4 6
$$
In general (omitting parentheses),
$$
\kern-9ex
T_A \coll x y = A \coll x y = \bmat{rr} 0 & 1 \\ 2 & 3 \\ 4 & 5 \emat \coll x y
= x \colll 0 2 4 + y \colll 1 3 5 = \colll y {2x+3y} {4x + 5y}
$$
Note that the matrix $A$ is visible in the last expression.

Any rule $T$ that assigns to each $\vx$ in $\R^n$ a unique vector
$T(\vx)$ in $\R^m$ is called a **transformation** from $\R^n$ to $\R^m$
and is written $T : \R^n \to \R^m$.

For our $A$ above, we have $T_A : \R^2 \to \R^3$.
$T_A$ is in fact a *linear* transformation.

**Definition:** A transformation $T : \R^n \to \R^m$ is called a
**linear transformation** if:

1. $T(\vu + \vv) = T(\vu) + T(\vv)$ for all $\vu$ and $\vv$ in $\R^n$, and

2. $T(c \vu) = c \, T(\vu)$ for all $\vu$ in $\R^n$ and all scalars $c$.

You can check directly that our $T_A$ is linear. For example, $$ \kern-9ex T_A \left( c \coll x y \right) = T_A \coll {cx} {cy} = \colll {cy} {2cx + 3cy} {4cx + 5cy} = c \colll y {2x+3y} {4x + 5y} = c \, T_A \left( \coll x y \right) $$ Check condition (1) yourself, or see Example 3.55.

In fact, *every* $T_A$ is linear:

**Theorem 3.30:** Let $A$ be an $m \times n$ matrix. Then $T_A : \R^n \to \R^m$
is a linear transformation.

**Proof:** Let $\vu$ and $\vv$ be vectors in $\R^n$ and let $c \in \R$.
Then
$$
T_A(\vu + \vv) = A(\vu + \vv) = A \vu + A \vv = T_A(\vu) + T_A(\vv)
$$
and
$$
T_A(c \vu) = A(c \vu) = c \, A \vu = c \, T_A(\vu) \qquad\Box
$$

**Example 3.56:** Let $F : \R^2 \to \R^2$ be the transformation that
sends each point to its reflection in the $x$-axis. Show that $F$ is linear.

**Solution:** Give a geometrical explanation on the board.

Algebraically, note that $F(\coll x y) = \coll x {-y}$, from which you can check directly that $F$ is linear. (Exercise.)

Or, observe that $F(\coll x y) = \bmat{rr} 1 & 0 \\ 0 & -1 \emat \coll x y$, so $F = T_A$ where $A = \bmat{rr} 1 & 0 \\ 0 & -1 \emat$.

**Example:**
Let $N : \R^2 \to \R^2$ be the transformation
$$
N \coll x y := \coll {xy} {x+y}
$$
Is $N$ linear?

It turns out that *every* linear transformation is a matrix transformation.

**Theorem 3.31:** Let $T : \R^n \to \R^m$ be a linear transformation.
Then $T = T_A$, where
$$
A = [\, T(\ve_1) \mid T(\ve_2) \mid \cdots \mid T(\ve_n) \,]
$$

**Proof:**
We just check:
$$
\kern-4ex
\begin{aligned}
T(\vx) &= T(x_1 \ve_1 + \cdots + x_n \ve_n) \\
&= x_1 T(\ve_1) + \cdots + x_n T(\ve_n) \qtext{since $T$ is linear} \\
&= [\, T(\ve_1) \mid T(\ve_2) \mid \cdots \mid T(\ve_n) \,] \colll {x_1} {\vdots} {x_n} \\
&= A \vx = T_A(\vx) \qquad\qquad\Box
\end{aligned}
$$

The matrix $A$ is called the **standard matrix** of $T$ and is
written $[T]$.

**Example 3.58:** Let $R_\theta : \R^2 \to \R^2$ be rotation by an angle $\theta$
counterclockwise about the origin. Show that $R_\theta$ is linear and find its
standard matrix.

**Solution:** A geometric argument shows that $R_\theta$ is linear. On board.

To find the standard matrix, we note that $$ \kern-6ex R_\theta \coll 1 0 = \coll {\cos \theta} {\sin \theta} \qqtext{and} R_\theta \coll 0 1 = \coll {-\sin \theta} {\cos \theta} $$ Therefore, the standard matrix of $R_\theta$ is $\bmat{rr} \cos \theta & -\sin \theta \\ \sin \theta & \cos \theta \emat$.

Now that we know the matrix, we can compute rotations of arbitrary vectors. For example, to rotate the point $(2, -1)$ by $60^\circ$: $$ \kern-7ex \begin{aligned} R_{60} \coll 2 {-1} &= \bmat{rr} \cos 60^\circ & -\sin 60^\circ \\ \sin 60^\circ & \cos 60^\circ \emat \coll 2 {-1} \\ &= \bmat{rr} 1/2 & -\sqrt{3}/2 \\ \sqrt{3}/2 & 1/2 \emat \coll 2 {-1} = \coll {(2+\sqrt{3})/2} {(2 \sqrt{3}-1)/2} \end{aligned} $$

Rotations will be one of our main examples.

Any guesses for how the the matrix for $S \circ T$ is related to the matrices for $S$ and $T$?

**Theorem 3.32:** $[S \circ T] = [S][T]$, where $[\ \ ]$ is used
to denote the matrix of a linear transformation.

**Proof:** Let $A = [S]$ and $B = [T]$. Then
$$
\kern-6ex
(S \circ T)(\vx) = S(T(\vx)) = S(B\vx) = A(B\vx) = (AB)\vx
$$
so $[S \circ T] = AB$. $\qquad\Box$