Vector Addition and Subtraction
Operating on vectors is the foundational building block for more complex operations like projections, transformations, and matrix multiplications. In this lesson, we will explore how to add and subtract vectors both algebraically and geometrically, and see how these two viewpoints are completely congruent.
1. The Dimensionality Constraint
Before performing any arithmetic operations on vectors, you must keep in mind the golden rule of vector algebra:
⚠️ The Dimensionality Rule: You can only add or subtract vectors that have the exact same dimensionality (the same number of elements).
If you attempt to add an -dimensional vector to an -dimensional vector where , the operation is mathematically undefined. There is no corresponding element in the shorter vector to pair with elements of the longer vector!
2. The Algebraic Interpretation
Algebraically, adding or subtracting vectors is extremely simple: you just add or subtract the corresponding elements at each coordinate index.
Numerical Example (4D Vector)
Let's look at the 4D addition from our lecture:
3. The Geometric Interpretation: Addition
Geometrically, to add two vectors, we employ the Head-to-Tail Rule:
- Draw the first vector in its standard position (tail anchored at the origin).
- Translate (slide) the second vector so that its tail sits exactly at the head of the first vector. (Recall that translation preserves the vector's length and direction).
- Draw the resulting sum vector from the tail of the first vector (the origin) to the head of the translated second vector.
Example A: Adding Positive Coordinates
Adding .

Example B: Adding Negative Coordinates
Adding .

4. The Geometric Interpretation: Subtraction
Vector subtraction possesses two equivalent and highly useful geometric interpretations:
Method A: Flip and Add (Scalar Multiplication by $-1$)
You can treat subtraction as adding a scaled vector: .
- Multiplying a vector by $-1$ scales each of its elements by $-1$.
- Geometrically, this has the effect of rotating the vector by (flipping its direction) while keeping its length unchanged.
- Perform standard head-to-tail addition by sliding this flipped vector to the head of the first vector.
Method B: Head-to-Head (Tail-to-Tail Connection)
- Place both vectors and in their standard position (both tails anchored at the origin).
- Draw the difference vector from the head of the subtracted vector (, the one with the negative sign) to the head of the positive vector ().
- If desired, you can then translate this resulting vector back to the standard position.

5. Python Implementation
Here is how to implement vector addition and subtraction using NumPy and plot the head-to-tail visual summation in Matplotlib:
import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
# Two vectors in R2
v1 = np.array([ 3, -1 ])
v2 = np.array([ 2, 4 ])
# Algebraic addition
v3 = v1 + v2
# Plot them geometrically
plt.plot([0, v1[0]],[0, v1[1]],'b',linewidth=3,label='v1')
plt.plot([0, v2[0]]+v1[0],[0, v2[1]]+v1[1],'r',linewidth=3,label='v2 (translated)')
plt.plot([0, v3[0]],[0, v3[1]],'k',linewidth=3,label='v1+v2')
plt.legend()
plt.axis('square')
plt.axis((-6, 6, -6, 6 ))
plt.grid()
plt.show()
Key Takeaways
- Dimensionality Agreement: Vectors must share the exact same shape for addition and subtraction to be valid.
- Vector Translation: Translating a vector's starting location does not alter its algebraic value. This translation property is what powers the geometric Head-to-Tail addition rule.
- Direction Flipping: Subtracting a vector is equivalent to reversing its direction (scaling by $-1$) and adding it head-to-tail.