Week 4 Lecture Notes

This week we’ll be reviewing linear algebra.

Monday, February 3

A vector \(x \in \mathbb{R}^n\) is all three of the following things:

  1. A list of \(n\)-real numbers.
  2. A point in \(n\)-dimensional space.
  3. An arrow with a magnitude and direction.

We looked at the following two examples to test our intuitions about vectors.

  1. Let \(a = \begin{bmatrix} 1 \\ 2 \\ 3 \end{bmatrix}\) and \(b = \begin{bmatrix} 0 \\ -1 \\ 1 \end{bmatrix}\). What vector would you add to \(a\) in order to get \(b\)?

  2. Does the line passing through \(a\) and \(b\) also pass through \(c = \begin{bmatrix} 4 \\ 11 \\ 9 \end{bmatrix}\)?

A matrix \(A \in \mathbb{R}^{m \times n}\) is a rectangular array of real numbers with \(m\) rows and \(n\) columns. Make sure you remember how matrix multiplication works and also what the transpose \(A^T\) of a matrix is.

  1. Let \(A = \begin{bmatrix} 1 & 0 \\ 2 & -1 \\ 3 & 1 \end{bmatrix}\), \(B = \begin{bmatrix} 1 & 0 \\ 0 & 2 \end{bmatrix}\), and \(C = \begin{bmatrix} 1 & 1 & 1 \\ 0 & 0 & 1 \end{bmatrix}\). Which of the following matrix products make sense? \(AB\), \(AC\), \(BA\), \(BC\), \(CA\), \(CB\)? Calculate each product that makes sense.

Of course, a vector \(x \in \mathbb{R}^n\) can be thought of as a matrix. We will always assume that vectors are column vectors unless otherwise specified.

The length or norm of a vector \(x \in \mathbb{R}^n\) is \[ \|x \| = \sqrt{x_1^2 + x_2^2 + \ldots + x_n^2 }.\] Another way to write this is \[ \|x \| = \sqrt{x^T x}.\]

The inner product of \(x,y \in \mathbb{R}^n\) is \(x^T y\).

  1. Prove that \(x^T y = y^T x\).

The inner product is also known as the dot product or scalar product of two vectors.

Theorem (Inner Products and Angles)

For any \(x,y \in \mathbb{R}^n\), \[ x^T y = \|x\| \|y\| \cos \theta\] where \(\theta\) is the angle between \(x\) and \(y\).

  1. Use the Law of Cosines to prove this theorem.

One major application of inner products is the definition of the correlation coefficient for two vectors \(x, y \in \mathbb{R}^n\).

Definition (Correlation Coefficient)

For any \(x,y \in \mathbb{R}^n\) the correlation between \(x\) and \(y\) is: \[ r = \left( \frac{x-\bar{x}}{\|x-\bar{x}\|} \right)^T \left( \frac{y-\bar{y}}{\|y-\bar{y}\|} \right).\]

  1. Find the correlation between \(x = \begin{bmatrix} 3 \\ 5 \\ -8 \end{bmatrix}\) and \(y = \begin{bmatrix}1 \\ 2 \\ 0 \end{bmatrix}\).

Study Questions

  1. Why is it obvious from the definition that the correlation between two vectors will always be between positive and negative one?

  2. What does it mean about \(x\) and \(y\) if \(r = +1\)? What if \(r = -1\)?