Check Course Information on OWL

Important: first online quiz 9/20-9/25

My notes: at http://www-home.math.uwo.ca/~pzsambok/MATH 1229A 004 2017 Fall

Linear Algebra is a cornerstone of Mathematics, and thus of sciences which use Mathematics. It is like a language which you need to learn before you can speak it. This course is concentrated on Linear Algebra itself. Today, I wanted to showcase some applications of Linear Algebra, and thus introduce some concepts we'll be learning.

Example 1. A kayaker is crossing Westward a 1km wide river flowing South, paddling with 8km/h. The river has a current of 2km/h. In what direction and with what speed is the kayak moving?

Planar movement can be described by *planar vectors*. A vector signifies direction and magnitude. You can represent them as arrows, but remember that what we care about is direction and length, that is a vector remains the same when you translate it, just as it doesn't matter where you put a compass on a map. Therefore, we'll most often represent vectors by *components*, which are the differences of the coordinates of the end and starting points of the arrows. Therefore, another way to get the components of a vector is to translate its arrow so that its starting point is the origin. In this particular case, the paddling velocity vector will be \(\mathbf v_p=\langle -8,0\rangle\), and the current vector will be \(\mathbf v_c=\langle 0,-2\rangle\). The total velocity vector can be gotten by *vector addition*. The sum of two vectors can be given either as the arrow you get if you make the starting point of one arrow the endpoint of another, or just adding up the components. That is, in our case, the total velocity vector is \(\mathbf v_t=\mathbf v_p+\mathbf v_c=\langle -8,-2\rangle\). The speed of the kayak is the length of the total velocity vector: \(|\mathbf v_t|=\sqrt{(-8)^2+(-2)^2}=\sqrt{68}\).

Example 2. A plane is ascending Northward with degree \(\frac{\pi}{6}\) and speed 900 km/h. It encounters a 20 km/h East wind. What is its total velocity vector?

The propulsion vector is \(\mathbf v_p=\langle0,900\cos\frac{\pi}{6},900\sin\frac{\pi}{6}\rangle=\langle0,450\sqrt2,450\rangle\), and the wind vector is \(\mathbf v_w=\langle 20,0,0\rangle\). Therefore, the total velocity vector is \(\mathbf v_t=\mathbf v_p+\mathbf v_w=\langle 20,450\sqrt2,450\rangle\).

Example 1. Let's find the line which goes through the points \(P_0(1,2)\) and \(P_1(3,-1)\).

Since the line won't be vertical, we can write it as \(a_0+a_1x=y\). Substituting the coordinates of the two points, we get the following system of equations \[\begin{align*} a_0+a_1=&2\\ a_0+3a_1=&-1 \end{align*}\]Solving the equation, we get \(a_0=\frac72,\,a_1=-\frac32\). That is, the line that goes through \(P_0\) and \(P_1\) is \(y=\frac72-\frac32x\). Click here for a demonstration.

We can use the same method to write the quadratic polynomial \(y=a_0+a_1x+a_2x^2\) through \(P_0(1,2),P_1(3,-1)\) and \(P_2(2,1)\). This time, we get the following system of linear equations \[\begin{align*} a_0+a_1+a_2&=2\\ a_0+3a_1+9a_2&=-1\\ a_0+2a_1+4a_2&=1 \end{align*}\]We can solve this in a similar way. We'll learn a very efficient method to solve systems of linear equations called *Gauss elimination*. Solving the resulting system of linear equations, we get \(a_0=2,\,a_1=\frac12,\,a_2=-\frac12\), that is the interpolation polynomial is \(y=2+\frac12x-\frac12x^2\). Click here for a demonstration. Note that I'm using the same program, just changed the point list.

After we've learnt about matrices, we will be able to understand the *method of least squares*. This is a widely used method in fields like data analysis to get a low degree polynomial which approximates an arbitrarily large data set. Click here for a demonstration. Still the same program! Changed least_squares to true from false, and set the degree as \(n=1\).

Let's rotate the point \(X(1,0)\) by \(\frac{\pi}{3}\) around the origin \(O(0,0)\), in the *positive direction*, that is counterclockwise. We get \((\frac12,\frac{\sqrt3}{2})\). If we apply the same rotation to \(Y(0,1)\), we get \((-\frac{\sqrt3}{2},\frac12)\). We can put these two points as column vectors next to each other to form a \[
A=\begin{pmatrix}
\frac12 & -\frac{\sqrt3}{2} \\
\frac{\sqrt3}{2} & \frac12
\end{pmatrix}.
\] Now we can use *matrix multiplication* to apply this rotation to any other vector. The general formula for this is \[
\begin{pmatrix}
a_{11} & a_{12} \\
a_{21} & a_{22}
\end{pmatrix}
\begin{pmatrix}
b_1 \\
b_2
\end{pmatrix}
=\begin{pmatrix}
a_{11}b_1 + a_{12}b_2 \\
a_{21}b_1 + a_{22}b_2
\end{pmatrix}.
\] Using this, applying the rotation to the point \(P(x,y)\), we get the point with coordinates the components of the vector \[
A\cdot\vec{OP}=\begin{pmatrix}
\frac12 & -\frac{\sqrt3}{2} \\
\frac{\sqrt3}{2} & \frac12
\end{pmatrix}\cdot\begin{pmatrix} x \\ y \end{pmatrix}
=\begin{pmatrix} \frac12x-\frac{\sqrt3}{2}y \\ \frac{\sqrt3}{2}x + \frac12y \end{pmatrix}.
\] Using a similar formula, we can *compose matrices*. Let's do this for two rotations of arbitrary angle! That is, let's take \[
A=\begin{pmatrix} \cos\alpha & -\sin\alpha \\ \sin\alpha & \cos\alpha \end{pmatrix}\quad\text{ and }B=\begin{pmatrix} \cos\beta & -\sin\beta \\ \sin\beta & \cos\beta\end{pmatrix}.
\] The matrix of first rotating by \(\beta\) and then by \(\alpha\) is \[
AB=\begin{pmatrix} \cos\alpha & -\sin\alpha \\ \sin\alpha & \cos\alpha \end{pmatrix}\begin{pmatrix} \cos\beta & -\sin\beta \\ \sin\beta & \cos\beta\end{pmatrix}
=\begin{pmatrix} \cos\alpha\cos\beta-\sin\alpha\sin\beta & -\cos\alpha\sin\beta - \cos\beta\sin\alpha \\ \sin\alpha\cos\beta + \sin\beta\cos\alpha & -\sin\alpha\sin\beta + \cos\alpha\cos\beta\end{pmatrix}
=\begin{pmatrix} \cos(\alpha + \beta) & -\sin(\alpha + \beta) \\ \sin(\alpha + \beta) & \cos(\alpha+\beta)\end{pmatrix}.
\] Surprise! The resulting transformation is rotation by \(\alpha+\beta\). You can check that we get the same result if we first rotate by \(\alpha\) and then by \(\beta\), that is we have \[
BA=AB.
\]

We can *project onto the \(x\)-axis* by leaving \(X(1,0)\) intact, but mapping \(Y(0,1)\) to \(O(0,0)\). That is, the matrix is \(P_x=\left(\begin{smallmatrix} 1 & 0 \\ 0 & 0 \end{smallmatrix}\right)\). Note that we have \[
P_xA=\begin{pmatrix} \cos\alpha & -\sin\alpha \\ 0 & 0 \end{pmatrix}\quad\text{ but }\quad AP_x=\begin{pmatrix} \cos\alpha & 0 \\ \sin\alpha & 0 \end{pmatrix}
\] That is, in this case \(P_xA\ne AP_x\). Matrix multiplication is not commutative!

One can ask whether a given transformation is *invertible*, that is, if it's possible to reverse its effect. For example, rotation by \(\alpha\) can be reversed by rotation by \((-\alpha)\). The easiest way to see this is that the composite of those two transformations is rotation by 0, that is doing nothing. On the other hand, we can't reverse a projection. For example, when projecting onto the \(x\)-axis, both \(\langle 1,1\rangle\) and \(\langle 1,2\rangle\) are mapped to \(\langle 1, 0\rangle\), which would be impossible if I could reverse the transformation.

*Determinants* give an easy criterion for invertibility. The formula for a \(2\times2\) matrix is \[
|A|=\begin{vmatrix}
a & b \\ c & d
\end{vmatrix}=ad-bc.
\] The transformation with matrix \(A\) is invertible precisely when its determinant is nonzero. We have \[
\begin{vmatrix}
\cos\alpha & -\sin\alpha \\ \sin\alpha & \cos\alpha
\end{vmatrix}=\cos^2\alpha+\sin^2\alpha=1\ne0,
\] and \[
\begin{vmatrix}
1 & 0 \\ 0 & 0
\end{vmatrix}=0.
\]