Vectors, Matrices, and Some Things We Can Do With Them

What is a Vector?


A vector is a quantity with two properties: magnitude and direction.

We encounter vectors frequently. They can be identified by any description that involves a number representing size, length, distance, value, weight, etc, and an indication of direction.



  • Cleveland is about 100 miles south west of Erie.
  • The unemployment rate has fallen by over 0.02% in the last month.
  • Currently, winds are from the east at 8 mph. Pressure is 30.06 in and rising.
  • A ball thrown at 45 mph at an angle of 45 degrees will travel farther than a ball thrown at 50 mph at an angle of 35 degrees.

What is a Vector?

A vector is usually written as an ordered list of numbers called scalars. Each number in the vector is a component or entry of that vector.

We usually name vectors with lowercase letters, like v, w, x, y, etc.

It does not matter if we write the vector vertically or horizontally. The important part is order. The first entry of the vector is all the way to the left when written horizontally, and at the top when written vertically.

Example: These vectors are the same. Both have the same entries, in the same order.

$$ [1,2,3] \ \ \ = \ \ \ \begin{bmatrix} 1 \\ 2 \\ 3 \end{bmatrix} $$


Example: These vectors are NOT the same. They have the same entries, but not in the same order.

$$ [1,2,3] \ \ \ = \ \ \ [2,3,1] $$

What is a Vector?

The number of components a vector has tells us how many dimensions of space it occupies.


$$ \begin{align*} \mbox{One Dimension:} \hspace{0.5cm} &[4]\\ &\\ \mbox{Two Dimensions:} \hspace{0.5cm} &[4,-8]\\ &\\ \mbox{Three Dimensions:} \hspace{0.5cm} &[4,-8,0]\\ &\\ \mbox{Four Dimensions:} \hspace{0.5cm} &[4,-8,0,1]\\ \end{align*}$$

What is a Vector?

In one dimension, a vector is just one number.

The magnitude of the vector is the absolute value of that number (its distance from 0 on the number line).

Since there's only one dimension to work in, the vector can only go left or right. Its direction is indicated by its sign: a negative vector is aimed to the left, and a positive vector to the right.

v = [3] -4 -2 0 2 4

What is a Vector?

In both mathematics and physics, vectors with two entries are often drawn as arrows in the Cartesian plane.

The tail of the vector is placed at the origin, $(0,0)$.

The head of the vector is placed at the points $(a,b)$ if $a$ is the first entry of the vector and $b$ is the second.

The vector shown at right is
[2, 4]
but you can click on the grid to change it.

What is a Vector?

The direction of a vector in two dimensions is described by the angle it makes with the $x$-axis.

The magnitude of the vector is its length. This can be found using the Pythagorean Theorem:

$$ || v || = \sqrt{x^2 + y^2}$$

Example: The vector \(v = [4,-2]\) has length $$ \begin{align*} || v || &= \sqrt{(4)^2 + (-2)^2} \\ &= \sqrt{16+4} = \sqrt{20} \end{align*} $$

x y v = [x, y]

Binary Operations

A binary operation takes two quantities and returns a third quantity.
The usual mathematical operations are binary: + × ÷ They each take two numbers and combine them in some way to make a third number.
We're used to binary operations, but we can easily overlook an important fact about them: they are not always defined.

Example: We can add 2 and 7 together to make 9.

Example: We cannot add \(x^2\) and \(4x^3\), because they are not like quantities. We cannot add 2 and a new iPhone for the same reason: they are not similar enough.

Binary Operations on Vectors

We do not have as many operations on vectors as we do on numbers, but any operations have something in common:

Binary operations on vectors are only defined when the vectors are in the same space; that is, when they have the same number of components.


Vector Addition

We can add (and subtract) two vectors with the same number of components by adding (or subtracting) the like components together.

Example:
$$ \begin{bmatrix} 2 \\ -3 \\ 8 \end{bmatrix} + \begin{bmatrix} 4 \\ 12 \\ 0 \end{bmatrix} = \begin{bmatrix} 2+4 \\ -3+12 \\ 8+0 \end{bmatrix} = \begin{bmatrix} 6 \\ 9 \\ 8 \end{bmatrix} $$

Example:
$$ \begin{bmatrix} 2 \\ -3 \\ 8 \end{bmatrix} + \begin{bmatrix} 4\\ 12 \end{bmatrix} \mbox{ is not defined} $$



No Multiplication or Division

The operations of multiplication and division are not defined for vectors, even if they have the same number of components.

Example:
$$ \begin{bmatrix} 2 \\ -3 \\ 8 \end{bmatrix} \times \begin{bmatrix} 4\\ 12\\0 \end{bmatrix} \mbox{ is not defined} $$

Example:
$$ \begin{bmatrix} 2 \\ -3 \\ 8 \end{bmatrix} \div \begin{bmatrix} 4\\ 12\\0 \end{bmatrix} \mbox{ is not defined} $$



The Dot Product

Vectors have an operation that the usual numbers do not: the dot product.
To find the dot product of two vectors, multiply their like components and then add up all of the results.

Again, this only works when the vectors have the same number of components!

Example:
$$ \begin{bmatrix} 2 \\ 3 \\ 8 \end{bmatrix} \cdot \begin{bmatrix} 4\\ 5\\0 \end{bmatrix} = (2)(4) + (3)(5) + (8)(0) = 8 + 15 + 0 = 23$$

Example:
$$ \begin{bmatrix}-1 \\ 4 \end{bmatrix} \cdot \begin{bmatrix} 8 \\ 2 \end{bmatrix} = (-1)(8) + (4)(2) = -8 + 8 = 0$$



The Dot Product

There's a few things worth noticing about the dot product:
  • Usually, when we operate on two things that are alike, we get back something that is also alike. Multiplying two numbers gives us a number. Multiplying two polynomials gives us a polynomial: $$(x+3)(x-1) = x^2 + 2x -3 $$ That didn't happen with the dot product - we operated on two vectors and wound up with a single number as an answer, not another vector. This means the dot product is not a closed operation on vectors.
  • When we multiply two non-zero numbers together, we get another non-zero number. This example on the previous slide shows this doesn't hold for the dot product: we can find the dot product of two non-zero vectors and get 0 for an answer.

    Example:
    $$ \begin{bmatrix}-1 \\ 4 \end{bmatrix} \cdot \begin{bmatrix} 8 \\ 2 \end{bmatrix} = (-1)(8) + (4)(2) = -8 + 8 = 0$$



The Dot Product

Useful facts about the dot product:

  • If the dot product of two vectors is 0, it means they are perpendicular (orthogonal) to one another.


  • The length of a vector is the square root of its dot product with itself.

    Example: \(v = [1,0,5,8]\)
    $$ ||v|| = \sqrt{v \cdot v} = \sqrt{1^2 + 0^2 + 5^2 + 8^2} = \sqrt{1+25+64} = \sqrt{90}$$



  • If \(v\) and \(w\) are vectors with the same number of components, then the angle \(\theta\) between them can be found using the formula $$ v \cdot w = ||v|| ||w|| \cos(\theta) $$