Vectors

...and things we can do with them

Vectors in $\mathbb{R}^2$

A "vector" in $\mathbb{R}^2$ is a object consisting of two real numbers. E.g. \[ \begin{bmatrix} 3 \\ 4 \end{bmatrix}. \]

In general, we consider mathematical objects of the form \[ \begin{bmatrix} a \\ b \end{bmatrix}. \] where $a$ and $b$ are real numbers. They are called "vectors". Here, $a$ and $b$ are called entries (or elements or coefficients) of the vectors.

The collection of all such vectors is denoted $\mathbb{R}^2$ (read as "R-two").

Stated more explicitly: \[ \mathbb{R}^2 = \left\{ \begin{bmatrix} a \\ b \end{bmatrix} \;:\; a,b \in \mathbb{R} \right\}. \]

Among them, the very special vector \[ \begin{bmatrix} 0 \\ 0 \end{bmatrix} \] is known as the zero vector.

Very often we use the notation $\mathbf{0}$ for the zero vector. However, it is not to be confused with 0 (the number).

Equality of vectors

Two vectors are consider equal if and only if their entries match: \[ \begin{bmatrix} a_1 \\ b_1 \end{bmatrix} = \begin{bmatrix} a_2 \\ b_2 \end{bmatrix} \quad\text{if and only if}\quad a_1 = a_2 \text{ and } b_1 = b_2. \] I.e., the ordering of the entries matters.

So \[ \begin{bmatrix} 3 \\ 4 \end{bmatrix} \;\ne\; \begin{bmatrix} 4 \\ 3 \end{bmatrix}. \]

Representing data

Vectors of this form \[ \begin{bmatrix} a \\ b \end{bmatrix} \] are quite useful in representing real world data whenever the description require a pair of numbers.

Can you think of real objects whose descriptions require a pair of numbers?

Notations

In this course, most often we will use boldface lower case letters, e.g., $\mathbf{u}$ and $\mathbf{v}$, as the names of vectors to distinguish them from other objects.

In physics and multi-variable calculus, it is more popular to use notations such as $\vec{u}$ and $\vec{v}$.

Using these notations is mostly about personal choices, and what they mean should always be clear from context.

Adding vectors together

Two vectors can be added entry by entry:

$ \begin{bmatrix} 2 \\ 3 \end{bmatrix} + \begin{bmatrix} 4 \\ 5 \end{bmatrix} $ $ \;\;=\; \begin{bmatrix} 2 + 4 \\ 3 + 5 \end{bmatrix} $ $ \;\;=\; \begin{bmatrix} 6 \\ 8 \end{bmatrix}. $

In general, \[ \begin{bmatrix} a_1 \\ b_1 \end{bmatrix} + \begin{bmatrix} a_2 \\ b_2 \end{bmatrix} = \begin{bmatrix} a_1 + a_2 \\ b_1 + b_2 \end{bmatrix} \] as expected.

Properties of vector addition

Just like the addition of "regular" numbers, for two vectors $\mathbf{u},\mathbf{v} \in \mathbb{R}^2$, \[ \mathbf{u} + \mathbf{v} = \mathbf{v} + \mathbf{u}. \]

This property is known as commutativity.

Also, as expected, we can verify that for any vector $\mathbf{v}$, \[ \mathbf{v} + \mathbf{0} = \mathbf{v} \quad\quad \mathbf{0} + \mathbf{v} = \mathbf{v}. \]

Additive inverse

Just like we have negative version of each positive number, we can form the "negative version" of a vector \[ - \begin{bmatrix} 3 \\ 4 \end{bmatrix} = \begin{bmatrix} -3 \\ -4 \end{bmatrix}. \]

This is known as the additive inverse of the vector.

In general, \[ - \begin{bmatrix} a \\ b \end{bmatrix} = \begin{bmatrix} -a \\ -b \end{bmatrix}. \]

In more compact notation, the additive inverse of the vector $\mathbf{v}$ is $-\mathbf{v}$.

As expected, \[ \mathbf{v} + (-\mathbf{v}) = \mathbf{0}. \]

Subtracting a vector from another

Remember that subtraction is simply addition of the negative.

Therefore, \[ \mathbf{u} - \mathbf{v} = \mathbf{u} + (-\mathbf{v}). \]

Can you compute \[ \begin{bmatrix} 3 \\ 4 \end{bmatrix} - \begin{bmatrix} 2 \\ 5 \end{bmatrix} ? \]

In that sense, "subtraction" is not a new operation (it's just a version of addition).

Vector scaling

We can also multiply a real number to a vector entry-by-entry:

$ 5 \cdot \begin{bmatrix} 2 \\ 3 \end{bmatrix} $ $ \;\;=\; \begin{bmatrix} 5 \cdot 2 \\ 5 \cdot 3 \end{bmatrix} $ $ \;\;=\; \begin{bmatrix} 10 \\ 15 \end{bmatrix}. $

In general, for any real number $r$, we define \[ r \cdot \begin{bmatrix} a \\ b \end{bmatrix} = \begin{bmatrix} r \cdot a \\ r \cdot b \end{bmatrix}. \]

This is known as the scalar multiplication. (Not to be confused with other products we are going to learn later)

For a real number $r$ and a vector $\mathbf{v}$, we can use notations $r \cdot \mathbf{v}$, $r \mathbf{v}$, or $\mathbf{v} r$ for the scalar multiplication. And we usually drop the "$\cdot$" whenever it is not confusing (e.g. $3\mathbf{v}$ instead of $3 \cdot \mathbf{v}$).

Scalars

In our context, the real number $r$ in the scalar multiplication \[ r \cdot \mathbf{v} \] is called a "scalar". (Its job is to scale a vector)

Throughout this course, we will call real numbers "scalars" to distinguish them from vectors.

Later, we will also see complex numbers play the role of scalars.

Scaling by 0

It is easy to see from how scalar multiplication is defined that \[ 0 \cdot \begin{bmatrix} a \\ b \end{bmatrix} = \begin{bmatrix} 0 \cdot a \\ 0 \cdot b \end{bmatrix} = \begin{bmatrix} 0 \\ 0 \end{bmatrix}. \]

In general, as expected, \[ 0 \mathbf{v} = \mathbf{0} \] for any vector $\mathbf{v} \in \mathbb{R}^2$. Make sure you understand that "0" and "$\mathbf{0}$" are not the same thing.

Scaling by negative scalar

It is also easy to see that \[ (-1) \cdot \begin{bmatrix} a \\ b \end{bmatrix} = \begin{bmatrix} (-1) \cdot a \\ (-1) \cdot b \end{bmatrix} = \begin{bmatrix} -a \\ -b \end{bmatrix} \] which is exactly the additive inverse of the original vector.

Therefore, \[ (-1) \mathbf{v} = -\mathbf{v} \] for any vector $\mathbf{v} \in \mathbb{R}^2$.

More generally, \[ (-r) \mathbf{v} = - (r \mathbf{v}). \]

Associativity

The way we defined scalar multiplications also implies "associativity": for scalars $r_1,r_2$ and vector $\mathbf{v} \in \mathbb{R}^2$, \[ r_1 ( r_2 \mathbf{v} ) = (r_1 r_2) \mathbf{v} \]

This property is known as the associativity of the scalar multiplication.

For example, as expected, \[ 3 (4 \mathbf{v}) = 12 \mathbf{v}. \]

Distributive property

Just from the way we define vector addition and scalar multiplications, it is easy to see that for a scalar $r$ and two vectors $\mathbf{u},\mathbf{v} \in \mathbb{R}^2$, \[ r ( \mathbf{u} + \mathbf{v} ) = (r \mathbf{u}) + (r \mathbf{v}) \]

This property is known as the distributive property.

Similarly, we can verify that for scalars $r_1,r_2$ and a vector $\mathbf{v}$, \[ r_1 \mathbf{v} + r_2 \mathbf{v} = (r_1 + r_2) \mathbf{v} \] It's just a consequence of how we define scalar multiplications.

E.g., \[ 3 \mathbf{v} + 4 \mathbf{v} = 7 \mathbf{v}. \]

Linear combinations

We can combine the two operations we just learned (scalar multiplication and vector addition): For two scalars $r_1,r_2$ and two vectors $\mathbf{v}_1,\mathbf{v}_2 \in \mathbb{R}^2$, the expression \[ r_1 \mathbf{v}_1 + r_2 \mathbf{v}_2 \] is called a linear combination of $\mathbf{v}_1$ and $\mathbf{v}_2$.

What does this operation mean? E.g., think about two vectors $\mathbf{v}_1,\mathbf{v}_2$ representing some real-world objects. In that case, what would $r_1 \mathbf{v}_1 + r_2 \mathbf{v}_2$ mean?

Dot product

There are several different types of "products" between vectors. Dot product is of particular importance in our context, and it is defined as \[ \begin{bmatrix} a \\ b \end{bmatrix} \;\cdot\; \begin{bmatrix} x \\ y \end{bmatrix} = ax + by. \]

It is important to understand that the dot product produces a scalar rather than a vector.

It is an example of the more general inner product, which we will study later.

The " $\cdot$ " in dot products is necessary. Omitting the " $\cdot$ " in the above will not make sense (it's $\mathbf{u} \cdot \mathbf{v}$, not $\mathbf{u} \mathbf{v}$).

Norm of vectors

For a vector $\mathbf{x} = \left[ \begin{smallmatrix} a \\ b \end{smallmatrix} \right]$ in $\mathbb{R}^2$, we define its norm to be \[ \| \mathbf{x} \| = \sqrt{ a^2 + b^2 }. \]

This can be interpreted as the "length" of the vector. It is always nonnegative, and the only vector that has norm 0 is the zero vector.

We can easily verify that the norm can also be expressed in terms of dot product: For a vector $\mathbf{x} \in \mathbb{R}^2$, \[ \| \mathbf{x} \| = \sqrt{ \mathbf{x} \cdot \mathbf{x} }. \]

Generalization to $\mathbb{R}^n$

Everything we just discussed generalize directly to the collection of column vectors with $n$ entries which we call $\mathbb{R}^n$.

For instance, \[ \begin{bmatrix} x_1 \\ \vdots \\ x_n \end{bmatrix} + \begin{bmatrix} y_1 \\ \vdots \\ y_n \end{bmatrix} = \begin{bmatrix} x_1 + y_1 \\ \vdots \\ x_n + y_n \end{bmatrix} \] and \[ \begin{bmatrix} x_1 \\ \vdots \\ x_n \end{bmatrix} - \begin{bmatrix} y_1 \\ \vdots \\ y_n \end{bmatrix} = \begin{bmatrix} x_1 - y_1 \\ \vdots \\ x_n - y_n \end{bmatrix}. \]

Similarly, the dot product between two vectors is defined as \[ \begin{bmatrix} x_1 \\ \vdots \\ x_n \end{bmatrix} \cdot \begin{bmatrix} y_1 \\ \vdots \\ y_n \end{bmatrix} = x_1 y_1 + \cdots + x_n y_n \]

And for a column vector $\mathbf{v} \in \mathbb{R}^n$, its norm is still \[ \| \mathbf{x} \| = \sqrt{ \mathbf{x} \cdot \mathbf{x} }, \] which is always non-negative. ($\mathbf{0}$ is still the only vector with norm 0)

Generalize all the operations we learned to $\mathbb{R}^n$.

Row vectors

So far, we express vectors as columns of numbers. However, in many situation, we can also write the numbers in rows: \[ \mathbf{x} = \begin{bmatrix} a & b \end{bmatrix} \]

... or more generally, \[ \mathbf{x} = \begin{bmatrix} x_1 & \cdots & x_n \end{bmatrix}. \]

For most purpose, we can use either as long as we are being consistent.

In later sections, we will see row and columns vectors are actually different, and they will play very different roles in linear algebra.

Representing high-dimensional data

Vectors are useful in representing real world data whenever the description require more than one number.

Your grades in this course depends on your performance in several graded components.
  1. Read the syllabus carefully and explain how your graded components can be represented by a vector.
  2. How will the following quantities be expressed as mathematical operations of these vectors?
    • Your overall course score;
    • The average scores of the students in class in each component.