Subtraction and Scalar Multiplication

Vector addition combines matching coordinates. Two more operations complete the basic arithmetic: subtraction and scalar multiplication.

Subtraction answers:

what change takes one vector to another?

Scalar multiplication answers:

what happens if we stretch,
shrink, or flip a vector?

Subtraction

Subtract vectors coordinate by coordinate.

If:

a = [5, 6]
b = [2, 1]

then:

ab=[52,61]=[3,5]a - b = [5 - 2, 6 - 1] = [3, 5]

Read it aloud:

subtract matching entries

Subtraction is useful because it gives a difference vector. If a and b are positions, then aba - b describes how to move from bb to aa.

MATH-C02-T05-001Exercise: Subtract matching coordinates

If a=[5,6]a = [5, 6] and b=[2,1]b = [2, 1], what is aba - b?

Compute it first, then check your number.

HintCoordinate-wise subtraction

The first coordinate is 525 - 2. The second coordinate is 616 - 1.

SolutionDifference vector

Subtract matching coordinates:

[5,6][2,1]=[52,61]=[3,5][5, 6] - [2, 1] = [5 - 2, 6 - 1] = [3, 5]

If the vectors are positions, this difference describes the move from [2, 1] to [5, 6]: three units in the first coordinate and five units in the second.

Direction of the Difference

The order matters.

aba - b describes the change from bb to aa.

bab - a points the other way.

For the same vectors:

ba=[25,16]=[3,5]b - a = [2 - 5, 1 - 6] = [-3, -5]
MATH-C02-T05-002Exercise: Reverse the difference

If ab=[3,5]a - b = [3, 5], what is bab - a?

Compute it first, then check your number.

HintOpposite direction

If one direction is [3,5][3, 5], the opposite direction is [3,5][-3, -5].

SolutionOpposite difference

Reversing the order changes the sign:

ba=(ab)=[3,5]b - a = -(a - b) = [-3, -5]

The size of the change is the same, but the direction is reversed.

Scalar Multiplication

A scalar is a single number.

Multiplying a vector by a scalar multiplies every coordinate by that number.

If:

v=[2,4]v = [2, 4]

then:

3v=[3×2,3×4]=[6,12]3v = [3 \times 2, 3 \times 4] = [6, 12]

The vector keeps the same basic direction when the scalar is positive. Its length changes.

If the scalar is negative, the vector flips direction.

-6-4-2246-4-2246a = [2, 3]b = [4, 6]0
a = [2, 3] and b = [4, 6]Drag either endpoint. Drag the plane to pan.

In the diagram, b = [4, 6] is twice a = [2, 3]. It points the same way and is twice as long.

MATH-C02-T05-003Exercise: Scale a vector

If v=[3,2]v = [3, -2], what is 2v2v?

Compute it first, then check your number.

HintMultiply each coordinate

The scalar 2 multiplies both coordinates.

SolutionCoordinate-wise scaling

Multiply each coordinate by 2:

2[3,2]=[6,4]2[3, -2] = [6, -4]

A positive scalar stretches the vector without flipping its direction.

Negative Scaling

Multiplying by -1 flips a vector through the origin:

[2,4]=[2,4]-[2, 4] = [-2, -4]

The length stays the same, but the direction reverses.

MATH-C02-T05-004Exercise: Flip a vector

What is [2,4]-[2, 4]?

Compute it first, then check your number.

HintMultiply by -1

Change the sign of each coordinate.

SolutionFlipped vector

Multiplying by -1 changes the sign of every coordinate:

[2,4]=[2,4]-[2, 4] = [-2, -4]

The vector has the same length as before, but it points through the origin in the opposite direction.

Code Mirror

NumPy mirrors the formula:

import numpy as np

v = np.array([2, 4])

print(3 * v)

The output is:

[ 6 12]

Next, we multiply two vectors in a different way: the dot product.