A vectors is an ordered array of real numbers written down in a column. This is much better understood with some examples first:
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 and 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()
This is a picture of the vector 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 , , , or . For instance, we spent a lot of time in school thinking about these sort of expressions/equations:
When we are naming a variable for a vector, a convention you must follow is to put an arrow on top like so:
The arrows will let you know that , 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 entries are precisely ordered lists of real numbers -- these are precisely elements of the -dimensional Euclidean space . Hence we view vectors with entries as elements of , and denote their membership as such: