Refer to the hints I've given before Midterm 1.

It's very important to regularly check how much time you have left! If you can't see a clock, ask a proctor to write the remaining time on the board regularly.

Make sure to practice timing yourself using the practice finals on OWL. Set aside 3 hours, and use no notes, textbooks, calculators.

For \(n\)-vectors \(\mathbf u\) and \(\mathbf v\), the dot product is the matrix product if \(\mathbf u\) is represented as a row vector, and \(\mathbf v\) is represented as a column vector: \[ \mathbf u\cdot\mathbf v=\begin{pmatrix} u_1 & \dots & u_n\end{pmatrix}\begin{pmatrix} v_1 \\ \vdots \\ v_n\end{pmatrix}=u_1v_1+\dotsb+u_nv_n. \] The length of an \(n\)-vector \(\mathbf u\) is the square root of its dot product with itself: \[ \|\mathbf u\|=\sqrt{\mathbf u\cdot\mathbf u}=\sqrt{u_1^2+\dotsb+u_n^2}. \]

*Example*. Let \(\mathbf u=(2,-1,3)\). Then the unit vector with the same direction as \(\mathbf u\) is \[
\frac{1}{\|\mathbf u\|}\mathbf u=\frac{1}{\sqrt{14}}\begin{pmatrix}2\\-1\\3\end{pmatrix}.
\]

The "distance of \(\mathbf u\) and \(\mathbf v\)" is the distance of \(P\) and \(Q\), where \(\mathbf u=\vec{OP}\) and \(\mathbf v=\vec{OQ}\). That is, \[ d(\mathbf u,\mathbf v)=\|\mathbf u-\mathbf v\|=\sqrt{(u_1-v_1)^2+\dotsb+(u_n-v_n)^2}. \]

*Example*. The distance of \(\mathbf u=(2,-1,3)\) and \(\mathbf v=(0,-2,1)\) is \[
\|\mathbf u-\mathbf v\|=\|(2,1,2)\|=3.
\]

Suppose that \(\boldsymbol0\ne\mathbf u,\mathbf v\), and let \(\alpha\) be the angle of \(\mathbf u\) and \(\mathbf v\). Then we have \(\alpha=\frac{\mathbf u\cdot\mathbf v}{\|\mathbf u\|\cdot\|\mathbf v\|}\). If \(\cos\alpha=1\), then we say \(\mathbf u\) and \(\mathbf v\) have the same direction. If \(\cos\alpha=-1\), then we say \(\mathbf u\) and \(\mathbf v\) have the opposite direction. If \(\cos\alpha=\pm1\), then we say that \(\mathbf u\) and \(\mathbf v\) are parallel. Is \(\cos\alpha=0\), then we say that \(\mathbf u\) and \(\mathbf v\) are orthogonal.

*Method*. We have 3 ways of deciding whether \(\mathbf u\) and \(\mathbf v\) are parallel.

Check whether \(\mathbf u\cdot\mathbf v=\pm\|\mathbf u\|\cdot\|\mathbf v\|\).

Suppose that \(u_j\ne0\). Then check whether \(\frac{v_j}{u_j}\mathbf u=\mathbf v\).

Check whether the matrix with rows \(\mathbf u\) and \(\mathbf v\) has rank 1.

*Example*. Let \(\mathbf u=(2,-1,3)\) and \(\mathbf v=(4,-2,-6)\). Then by the reduction step \[
\begin{pmatrix}2 & -1 & 3 \\ 4 & -2 & -6\end{pmatrix}\xrightarrow{R_2-2R_1}\begin{pmatrix}2 & -1 & 3 \\ 0 & 0 & -12\end{pmatrix}
\] we get an echelon for matrix and thus see that the matrix with rows \(\mathbf u\) and \(\mathbf v\) has rank 2. Thus, \(\mathbf u\) and \(\mathbf v\) are not parallel.

*Example*. Let \(\mathbf u=(2,-1,3)\) and \(\mathbf v=(4,k,6)\). Then \(\mathbf u\) and \(\mathbf v\) are orthogonal, precisely when \[
0=\mathbf u\cdot\mathbf v=26-k.
\] Therefore, \(\mathbf u\) and \(\mathbf v\) are orthogonal, if \(k=26\).

The cross product of \(\mathbf u\) and \(\mathbf v\) is \(\left|\begin{smallmatrix}\mathbf i & u_1 & v_1 \\ \mathbf j & u_2 & v_2 \\ \mathbf k & u_3 & v_3 \end{smallmatrix}\right|\). You can use any expansion formula you like for this determinant.

*Warning*. Do not use any row or column operation involving multiplication or division by \(\mathbf i,\mathbf j\) or \(\mathbf k\) as that will give a wrong answer or not even make sense! The easiest way is probably to expand along \(C_1\).

*Example*. We have \[
\begin{pmatrix} 2 \\ -1 \\ 3 \end{pmatrix}\times\begin{pmatrix} 0 \\ -2 \\ 1 \end{pmatrix}=\begin{vmatrix} \mathbf i & 2 & 0 \\ \mathbf j & -1 & -2 \\ \mathbf k & 3 & 1 \end{vmatrix}=\mathbf i\begin{vmatrix} -1 & -2 \\ 3 & 1 \end{vmatrix}-\mathbf j\begin{vmatrix} 2 & 0 \\ 3 & 1 \end{vmatrix} +\mathbf k\begin{vmatrix} 2 & 0 \\ -1 & -2 \end{vmatrix}=\begin{pmatrix} 5 \\ -2 \\ -4 \end{pmatrix}.
\]

That is, we have a parametrization \[ \mathbf r(t)=\begin{pmatrix} x \\ y \end{pmatrix} =\begin{pmatrix}(3/2)t+2\\t\end{pmatrix}=\begin{pmatrix}2 \\ 0 \end{pmatrix}+t\begin{pmatrix}3/2 \\ 1\end{pmatrix} \] Note that the 1-parameter family of solutions has given a point-parallel form equation for the line! You can see that it contains the point \(P(2,0)\), and that a direction vector is \((3/2,1)\).

Of course, there's nothing wrong with using our method of chapter 1: if \((a,b)\) is a direction vector, then \(\pm(-b,a)\) are normal vectors, and vice versa.

*Example*. Consider the line with point-parallel form equation \[
\mathbf r(t)=\begin{pmatrix}2\\-1\end{pmatrix}+t\begin{pmatrix}-3\\1\end{pmatrix}.
\] We can see that the line contains the point \(P(2,-1)\), and that a direction vector is \(\mathbf u=(-3,1)\). Therefore, a normal vector is \(\mathbf n=(1,3)\), and from the point-normal form equation \[
\left(\begin{pmatrix}x & y\end{pmatrix}-\begin{pmatrix}2 & -1\end{pmatrix}\right)\cdot\begin{pmatrix}1\\3\end{pmatrix}=0
\] we get the standard form equation \[
x+3y=1.
\]

Note that a standard equation of a hyperplane in \(\mathbf R^n\) gives a \(1\times n\) matrix with one nonzero row. Therefore, the rank is 1, and you get an (\(n-1\))-parameter family of solutions. This is why in \(\mathbf R^2\), from one normal vector you get one directional vector (unique up multiplication by a nonzero scalar).

That is, we have the parametrization \[ \mathbf r(s,t)=\begin{pmatrix} x\\y\\z \end{pmatrix}=\begin{pmatrix} s/2-t/2+2 \\ s \\ t \end{pmatrix}=\begin{pmatrix}2\\0\\0\end{pmatrix}+\begin{pmatrix}1/2\\1\\0\end{pmatrix}+\begin{pmatrix}-1/2\\0\\1\end{pmatrix}. \]

You can see that a plane is determined by one point and two nonparallel direction vectors. To get the normal vector back from the two direction vectors, you need to find a nonzero vector that is orthogonal to both. There are two ways you can do it:

- Take the cross product
- Solve the homogeneous system of linear equations with coefficient matrix the rows the direction vectors as row vectors.

*Example*. Let \(\Pi\) be the plane with points \(P(1,0,2),Q(0,-3,1),R(-1,1,-2)\). The direction vectors are two nonparallel vectors between two pairs of these points. For example, we can take \[
\mathbf u=\vec{PQ}=\begin{pmatrix}-1\\-3\\-1\end{pmatrix}\text{ and }\vec{PR}=\begin{pmatrix} -2\\1\\-4\end{pmatrix}.
\]

Now one way to get a normal vector is to take the cross product: \[ \mathbf u\times\mathbf v=\begin{vmatrix}-3 & 1 \\ -1 & -4 \end{vmatrix}\mathbf i+\begin{vmatrix}-1 & -4 \\-1 & -2 \end{vmatrix}\mathbf j+\begin{vmatrix}-1 & -2 \\ -3 & 1 \end{vmatrix}\mathbf k=\begin{pmatrix}13\\-2\\-7\end{pmatrix}. \]

Another way is to solve the HSLE with coefficient matrix having \(\mathbf u\) and \(\mathbf v\) as rows: \[ \begin{pmatrix} -1 & -3 & -1 \\ -2 & 1 & -4 \end{pmatrix} \xrightarrow{-R_1;R_2+2R_1}\begin{pmatrix} 1 & 3 & 1 \\ 0 & 7 & -2 \end{pmatrix}\xrightarrow{(1/7)R_2;R_1-3R_2}\begin{pmatrix} 1 & 0 & 13/7 \\ 0 & 1 & -2/7 \end{pmatrix} \] This tells us that \((x,y,z)\) is a normal vector precisely when \((x,y,z)=(-\frac{13}{7}t,\frac27t,t)\) for some \(t\). Note that you get the cross product for \(t=-7\).

Let \(\Pi\) be a hyperplane (note that this includes a line in \(\mathbf R^2\) and a plane in \(\mathbf R^3\)) with normal vector \(\mathbf n\) and point \(P\). Let \(Q\) be another point. Then the distance of \(Q\) from \(\Pi\) is \[ d(Q,\Pi)=\frac{|\vec{PQ}\cdot\mathbf n|}{|\mathbf n|}. \]

*Warning*. Don't forget to take the absolute value in the nominator. Distances can't be negative.

*Example*. Let \(\Pi\) be the plane \(-2x+3y+z=4\), and \(Q(-1,0,-1)\) some other point. To calculate the distance of \(Q\) from \(\Pi\), we need to find a point \(P\) on \(\Pi\), and a normal vector. Setting \(y=z=0\), we see that we need \(x=-2\) to get a solution to the standard equation. That is, \(P(-2,0,0)\) is a point on \(\Pi\). A normal vector \(\mathbf n=(-2,3,4)\) can be read off the standard equation. We have \(\vec{PQ}=(1,0,-1)\), therefore the distance is \[
d(Q,\Pi)=\frac{|\mathbf n\cdot\vec{PQ}|}{|\mathbf n|}=\frac{|-6|}{\sqrt{29}}=\frac{6}{29}.
\]

*Example*. Let \(A=\left(\begin{smallmatrix}2 & -1 \\ 3 & -2 \end{smallmatrix}\right)\). Let's find \(A^11\). Well, first let's calculate \[
A^2=\begin{pmatrix}1 & 0 \\ 0 & 1 \end{pmatrix}
\] Since \(A^2=I\), we can simplify the calculation: \[
A^11=A^{10+1}=(A^2)^5A=IA=A.
\]