Linear Algebra · 14 min

What is a vector, really?

Physicists see arrows. Programmers see lists. It's the same object wearing two costumes, and switching between them is a skill you build once.

0 / 0

Two kinds of people

A vector, to a physicist, is an arrow with a length and a direction, floating in space.

A vector, to a programmer, is a list of numbers.

A vector, to a mathematician, is anything you can add together and scale, which is both and neither.

For this whole module, pick either side of that first sentence. Both are right. We switch between them constantly.

(Tinker writes vectors as row tuples like [3,2][3, 2] throughout, which matches NumPy / PyTorch / JAX, where data rows are vectors and matrices apply on the right with x @ W. It saves a year of mysterious transposes.)

Coordinates are just addresses

When you write v=[3,2]\mathbf{v} = [3, 2], you’re saying: “3 steps right, 2 steps up.” Right and up, specifically, are the directions of two implicit basis arrows:

ı^=[1,0],ȷ^=[0,1].\hat{\imath} = [1, 0], \qquad \hat{\jmath} = [0, 1].

So [3,2][3, 2] is really 3ı^+2ȷ^3\hat{\imath} + 2\hat{\jmath}. The list of numbers is an address in a coordinate system that nobody drew for you. Later, when we change the basis, the same arrow gets a different list. The arrow stays put; only the address changes.

Read the arrow

An arrow runs from the origin to the point (1,4)(-1, 4). If you write it as a coordinate list, what’s the yy-component?

Adding arrows, head to tail

[2,1]+[1,3][2, 1] + [-1, 3] componentwise is [1,4][1, 4]. That’s the programmer’s rule.

Geometrically, it’s head-to-tail: place the tail of the second arrow at the tip of the first, and the sum is the arrow from the original origin to the final tip. Both operations give the same [1,4][1, 4]. That’s the whole point of the duality: the algebra and the geometry are two ways of computing the same move.

Drag either arrow’s tip below. The coral arrow is the sum, computed both ways at once.

-4-224-2-11234
a (2.00, 1.00) |2.24|
b (1.00, 2.00) |2.24|
a + b (3.00, 3.00) |4.24|

drag either arrow's dot; the sum follows

The dashed parallelogram lines aren’t decoration; they’re the head-to-tail recipe drawn twice. Either path gets you to the sum.

Add and read one component

Compute [2,1]+[1,3][2, 1] + [-1, 3] and give the xx-component (first component) of the result.

Scaling

Multiplying a vector by a number scales it. 2[3,2]=[6,4]2 \cdot [3, 2] = [6, 4]: same direction, twice as long. 1[3,2]=[3,2]-1 \cdot [3, 2] = [-3, -2]: same length, flipped.

Every operation in linear algebra is some combination of adding vectors and scaling them. Master those two moves and the rest is choreography.

Linear combinations: the fundamental operation

A linear combination of two vectors u\mathbf{u} and v\mathbf{v} is any expression of the form

au+bva\,\mathbf{u} \,+\, b\,\mathbf{v}

for two scalars a,ba, b. Sweep (a,b)(a, b) through all possible values and the set of results traces out something geometric. That set is called the span of u\mathbf{u} and v\mathbf{v}.

  • If u\mathbf{u} and v\mathbf{v} point in different directions, their span is a plane: you can reach every point in 2D by some combination of them.
  • If they point in the same (or opposite) direction, their span is just a line: no combination of parallel arrows can get you off that line.
  • If both are the zero arrow, the span is just the origin.

“Span” is the first conceptual word of linear algebra that isn’t a scalar operation. Keep it. It’ll come back when we ask what a matrix can and cannot reach.

When two vectors are secretly one

Two vectors are linearly dependent when one is a scalar multiple of the other (i.e., they lie on the same line through the origin).

[2,4][2, 4] and [1,2][1, 2] are dependent: the first is 2×2\times the second. Their span is a line.

[1,0][1, 0] and [0,1][0, 1] are independent: neither is a multiple of the other. Their span is the full plane.

This distinction (are my vectors independent, or are they wasting my budget?) becomes the question “is my matrix singular?” a few lessons from now. Same idea wearing a new name.

Lesson complete

Nice tinkering.