Vectors as Position and Direction

A vector can be read in two common ways.

It can name a position:

[2, 4] means:
the point two units right
and four units up

It can also name a direction and movement:

[2, 4] means:
move two units right
and four units up

The same coordinates can support both readings. Which reading is correct depends on the problem.

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

Drag the endpoints. The coordinates change, but the habit stays the same: connect each number to a movement along an axis.

Position

As a position, a vector points to a location.

If:

p=[2,4]p = [2, 4]

then the first coordinate says how far to move horizontally. The second coordinate says how far to move vertically.

This is useful when vectors represent points in a space.

MATH-C02-T03-001Exercise: Read a position

If p=[2,4]p = [2, 4], what is the vertical coordinate?

Compute it first, then check your number.

HintUse coordinate order

In a two-dimensional drawing, the second coordinate is vertical.

SolutionSecond coordinate

The vector is p=[2,4]p = [2, 4]. The second coordinate is 4, so the vertical coordinate is 4.

Direction

As a direction, the same vector describes a change.

If:

d=[2,4]d = [2, 4]

then applying that direction means:

move 2 along the first axis
move 4 along the second axis

This reading is useful when vectors represent steps, differences, gradients, or updates.

MATH-C02-T03-002Exercise: Read the movement

If d=[2,5]d = [-2, 5], what does the first coordinate tell you to do?

Enter -2 for two units in the negative first-axis direction.

Compute it first, then check your number.

HintRead the sign

A negative first coordinate moves in the negative direction along the first axis.

SolutionNegative horizontal movement

The first coordinate is -2, so the movement goes two units in the negative first-axis direction. In a two-dimensional drawing, that usually means two units left.

Same Numbers, Different Reading

The vector [2, 4] may be a location or a movement.

The numbers do not decide by themselves. The problem decides.

If we say "the point is [2, 4]," we are using the position reading. If we say "update the point by [2, 4]," we are using the direction reading.

MATH-C02-T03-003Exercise: Choose the reading

Enter 1 if "move by [2, 4]" is using the direction reading.

Compute it first, then check your number.

HintLook for action

Position says where something is. Direction says how something changes.

SolutionDirection reading

Enter 1. "Move by [2, 4]" means apply a change of 2 along the first axis and 4 along the second axis.

Why Both Readings Matter

Machine learning uses both ideas.

  • An embedding can be a position in representation space.
  • A training update can be a direction in parameter space.
  • A difference between two embeddings can describe a direction of change.
  • A gradient points in the direction where a function changes fastest.
MATH-C02-T03-004Exercise: Embedding reading

Enter 1 if an embedding vector can be read as a position in a learned representation space.

Compute it first, then check your number.

HintThink representation space

Similar items often have nearby positions in embedding space.

SolutionEmbedding position

Enter 1. An embedding vector can be interpreted as a position in a learned representation space. Later, distance and direction in that space will help us compare meanings.

Next, we combine movements by adding vectors.