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

**Midterm 2**: next Thursday evening, 7-8:30 pm. Send me an e-mail message
**today** if you have a **conflict** (even if you told me before midterm 1).
Midterm 2 covers from Section 2.3 until the end of Chapter 3, but builds on
the earlier material as well.
A **practice exam** is available from the course home page.
Last name A-Q must write in **NS1**, R-Z in **NS7**.
See the missed exam section of
the course web page for policies, including for illness.

**Tutorials:** No tutorials this week! Review in tutorials next week.

**Office hour:** today, 1:30-2:30, MC103B.

**Help Centers:** Monday-Friday 2:30-6:30 in MC 106.
(But probably not Thursday or Friday this week.)

On Friday, we finished Section 3.5. That was a key section, so please study it carefully.

**Example:** If
$$
A = \bmat{rr} 0 & 1 \\ 2 & 3 \\ 4 & 5 \emat
$$
then
$$
\kern-8ex
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-8ex
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-8ex 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.
On whiteboard.

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

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:
$$
\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)
\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 whiteboard.

To find the standard matrix, we note that $$ 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$: $$ \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
$$
(S \circ T)(\vx) = S(T(\vx)) = S(B\vx) = A(B\vx) = (AB)\vx
$$
so $[S \circ T] = AB$. $\qquad\Box$

**Example 3.61:** Find the standard matrix of the transformation
that rotates $90^\circ$ counterclockwise and then reflects in the $x$-axis.
How do $F \circ R$ and $R \circ F$ compare?
On whiteboard.

**Example:** It is geometrically clear that $R_\theta \circ R_\phi =
R_{\theta+\phi}$. This implies some trigonometric identities.
On whiteboard.

.