Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

1.4: Vectors

A vectors is an ordered array of real numbers written down in a column. This is much better understood with some examples first:

(23), (1.23.10.5), (1/22/3), (0π2).\begin{pmatrix} 2 \\ 3\end{pmatrix},\ \begin{pmatrix} -1.2 \\ 3.1 \\ -0.5\end{pmatrix},\ \begin{pmatrix} 1/2 \\ -2/3\end{pmatrix},\ \begin{pmatrix} 0 \\ \pi \\ -\sqrt{2}\end{pmatrix}.

The number of entries in a vector is called the size, of a vector. The examples above have two vectors with size 2, and two vectors with size 3.

Just like Euclidean space, the order of the numbers matter. For instance, the vector (23)\begin{pmatrix} 2\\ 3 \end{pmatrix} and (32)\begin{pmatrix} 3\\ 2 \end{pmatrix} are different objects.

Vectors have size and direction

Speaking of Euclidean space, a good way of thinking about vectors are as arrows in Euclidean space. Here is an illustration of this idea:

import matplotlib.pyplot as plt
import numpy as np

# The vector v = (2,3)
v = np.array([2, 3])

# Different initial points
starts = np.array([
    [0, 0],
    [3, 1],
    [-2, 2],
    [1, -3],
    [-3, -2],
])

fig, ax = plt.subplots(figsize=(7, 7))

# Draw coordinate axes
ax.axhline(0, linewidth=1)
ax.axvline(0, linewidth=1)

# Draw copies of the same vector
for x, y in starts:
    ax.arrow(
        x, y,
        v[0], v[1],
        length_includes_head=True,
        head_width=0.18,
        head_length=0.28,
        linewidth=2
    )

    # Mark initial point
    ax.plot(x, y, 'o', markersize=5)

# Label the vector once
ax.text(
    2.4, 3.3,
    r'',
    fontsize=16
)

ax.set_xlim(-5, 7)
ax.set_ylim(-5, 7)
ax.set_aspect('equal')

ax.set_xlabel(r'$x$')
ax.set_ylabel(r'$y$')
ax.set_title(r'Translated copies of the vector')

ax.grid(alpha=0.3)

plt.show()
<Figure size 700x700 with 1 Axes>

This is a picture of the vector (23)\begin{pmatrix} 2\\ 3\end{pmatrix} on the Euclidean plane. Note that vectors can start at any point of the plane. A good way to summarize this is to say that vectors encode displacements in between points; we’ll discuss this viewpoint in more detail in the next lecture.

The more important takeaway from this viewpoint is that vectors are objects with both size and direction. ‘Size’ refers to the length of the arrow, while ‘direction’ is more clear from the picture above. This is in contrast with real numbers, which only have size. To make this distinction very clear, we will often call real numbers as scalars, to emphasize that scalars have size but not direction.

Understanding vectors as objects with size and direction is very important and is used everywhere in physics, engineering, biology, etc. For instance, force and velocity in physics are both examples of objects that are vectors. Of course, this is not the only way is to think about vectors. For some purposes it is useful to just think of them as arrays of numbers, like data sets.

Notation for vectors

Recall that variables for scalars are usually named aa, bb, xx, or yy. For instance, we spent a lot of time in school thinking about these sort of expressions/equations:

a=b+1, 2xy=3, .a = b+1,\ 2x - y = 3,\ \ldots.

When we are naming a variable for a vector, a convention you must follow is to put an arrow on top like so:

v=(352), w=(2.11.31.23.5).\vec{v} = \begin{pmatrix} 3 \\ 5\\ 2\end{pmatrix},\ \vec{w} = \begin{pmatrix} 2.1 \\ -1.3 \\ 1.2 \\ 3.5 \end{pmatrix}.

The arrows will let you know that v\vec{v}, w\vec{w} are vectors rather than scalars.

Finally, we need a name for the collection of all vectors. For reasons that will become clearer later, it’s better to consider collections of vectors with the same number of entries, i.e. the same size.

Remember that vectors with nn entries are precisely ordered lists of nn real numbers -- these are precisely elements of the nn-dimensional Euclidean space Rn\mathbb{R}^n. Hence we view vectors with nn entries as elements of Rn\mathbb{R}^n, and denote their membership as such:

v=(352)R3, w=(2.11.31.23.5)R4.\vec{v} = \begin{pmatrix} 3 \\ 5\\ 2\end{pmatrix} \in \mathbb{R}^3,\ \vec{w} = \begin{pmatrix} 2.1 \\ -1.3 \\ 1.2 \\ 3.5 \end{pmatrix} \in \mathbb{R}^4.