Learning Objectives
By the end of this section, you will:
- Understand the three ways to think about vectors: as arrows in space (physics), as ordered lists of numbers (computer science), and as abstract objects obeying axioms (mathematics)
- See how these perspectives are not competing but complementary, and why fluency in both the arrow picture and the list picture is essential for mastering linear algebra
- Grasp the central role of basis vectors as the bridge between geometric arrows and numerical coordinates
- Understand linear combinations as the single most fundamental operation in all of linear algebra
- Explore span: the set of all points reachable by linear combinations of a set of vectors
- See how changing the basis changes the coordinates but never the vector itself, building the deep intuition that coordinates are a choice, not a fact
- Recognize how vectors appear in physics, engineering, computer graphics, data science, and machine learning
Why This Matters
The Big Picture: Three Perspectives on Vectors
Ask three people what a vector is, and you may get three different answers. A physics student will say it is an arrow with direction and magnitude. A computer science student will say it is an ordered list of numbers. A mathematician will say it is any object that can be added together and scaled according to certain rules. All three are correct. Understanding their relationship is the first great insight of linear algebra.
The Physics Student's Vector
In physics, a vector is an arrow in space. It has two properties: a direction (which way it points) and a magnitude (how long it is). A force is a vector. A velocity is a vector. An electric field at a point is a vector.
In this picture, a vector is defined by where it points and how far it reaches, not by where it starts. Two arrows with the same direction and length represent the same vector, even if they are drawn in different places. However, in linear algebra we adopt a convention: every vector starts at the origin. This small restriction gives us a fixed reference point and makes the connection to coordinates possible.
Key insight: In the arrow picture, a vector exists independent of any coordinate system. It is a geometric object, as real as a line or a circle. Coordinates are how we describe it, not what it is.
The Computer Scientist's Vector
In computer science, a vector is an ordered list of numbers. A 2D vector is a pair . A 3D vector is a triple . A vector in dimensions is a list of numbers.
This is the view that computers use. In NumPy, a vector is a 1D array. In a database, a feature vector is a row of numbers. In a neural network, an embedding is a list of floating-point values. The list picture is powerful because it is directly computable: you can store vectors in memory, loop over their entries, and perform arithmetic entry by entry.
The list picture makes some things obvious that the arrow picture obscures. For example, a vector can have 768 dimensions (like a word embedding in a language model), which is impossible to visualize as an arrow but perfectly natural as a list of 768 numbers.
The Mathematician's Vector
A mathematician defines a vector as any object that lives in a vector space: a set of objects that can be added together and multiplied by scalars, where these operations satisfy certain axioms (closure, associativity, commutativity of addition, existence of a zero vector, and so on).
Under this definition, arrows in the plane are vectors. Lists of numbers are vectors. But so are polynomials, functions, matrices, and even random variables. This abstraction is what gives linear algebra its universal power: any system that obeys the axioms of a vector space can be analyzed with the same tools.
The Three Perspectives Work Together
The Arrow Picture: Vectors in Space
Let us begin with the arrow picture and develop it carefully. Imagine standing at the origin of a 2D coordinate system. A vector is an arrow from the origin to some point in the plane. The arrow encodes two pieces of information simultaneously:
- Direction: The angle the arrow makes with the positive x-axis, measured counterclockwise. A vector pointing straight right has direction ; a vector pointing straight up has direction .
- Magnitude: The length of the arrow, written . For a vector , the magnitude is by the Pythagorean theorem.
Explore two vectors on a coordinate grid. Drag the arrow tips or use the sliders to change the yellow vector and cyan vector . Watch how the bracket notation updates as you move them:
Drag the circle at each arrow tip or use the sliders · dashed red = î component · dashed green = ĵ component
The interactive visualization below lets you explore this duality. Drag the arrow tip or use the sliders, and watch how the geometric properties (direction, magnitude) and the algebraic properties (the list of numbers) update in lockstep. Toggle the decomposition to see how the vector breaks into its x-component (horizontal) and y-component (vertical).
Interactive: The Dual Nature of Vectors
Drag the arrow tip to move the vector. The arrow and the list of numbers are two faces of the same object.
The green arrow and the red/blue numbers describe the same object. The arrow gives direction and magnitude; the list gives precise coordinates. Neither view is more "real" — they are two languages for the same idea.
Notice something profound: the -component (how far right) and the -component (how far up) completely determine the arrow. Given these two numbers, you can reconstruct the arrow exactly. And given the arrow, you can read off the two numbers. The arrow and the pair of numbers carry exactly the same information.
The List Picture: Vectors as Coordinates
Now let us look at the list picture more carefully. A vector in is an ordered -tuple of real numbers:
Each entry is called a component of the vector. In 2D, we write or equivalently as a column. In 3D, .
But here is the key question: what do these numbers actually mean? The number means "go 3 units in the first direction." The number means "go 2 units in the second direction." But what are these "directions"? They are the basis vectors, and this brings us to the most important idea in this entire section.
The Bridge: Basis Vectors and Coordinates
The connection between arrows and lists is not arbitrary. It is built on a choice: the choice of basis vectors. Basis vectors are the rulers against which everything is measured. They are the "units" of your coordinate system.
Meet and
In 2D, the standard basis consists of two special vectors:
- : a unit vector pointing to the right along the x-axis
- : a unit vector pointing upward along the y-axis
These two vectors, often written and , are perpendicular and each has length 1. Together, they define what "right" and "up" mean in our coordinate system.
Coordinates as Instructions
Here is the central insight, the one that 3Blue1Brown calls the most important idea in linear algebra:
The Fundamental Interpretation of Coordinates
This is a linear combination of the basis vectors. The numbers 3 and 2 are the scalars (or coefficients) that tell you how much of each basis vector to use. The result is the vector.
In general, any vector in 2D can be written as:
The list is just shorthand for the linear combination . The list is the instructions; the arrow is the result of following those instructions.
Different Basis, Different Numbers
Here is where things get deep. The numbers in the list depend on which basis you chose. If you pick different basis vectors, the same arrow in space will have different coordinates.
Suppose instead of and , you use basis vectors and . The same geometric arrow that was in the standard basis will have different coordinates in this new basis. The arrow hasn't moved. Only the numbers describing it have changed, because the rulers changed.
The interactive demo below shows this vividly. The green arrow is the same vector in both views. But the coordinates differ because the basis vectors differ.
Interactive: Same Vector, Different Coordinates
The green arrow is the same vector in both views. Only the coordinates change when you change the basis.
The vector (the arrow in space) never changes. Only the numbers we use to describe it change when we pick a different basis. Coordinates are not intrinsic to the vector — they depend on the language (basis) we choose.
Why This Matters for AI
Vector Operations in Both Pictures
Two operations define the structure of vectors: addition and scalar multiplication. Both have clean geometric and algebraic descriptions.
Addition: Geometric and Algebraic
Geometrically, vector addition follows the tip-to-tail rule: place the tail of at the tip of , and the sum is the arrow from the origin of to the tip of . Equivalently, the sum is the diagonal of the parallelogram formed by the two vectors.
Algebraically, vector addition is component-wise. Each component of the sum is the sum of the corresponding components:
Why do these two pictures agree? Because . The algebra mirrors the geometry exactly.
Scalar Multiplication: Geometric and Algebraic
Geometrically, multiplying a vector by a scalar stretches (or compresses) the arrow by a factor of . If , the direction stays the same. If , the arrow flips to point in the opposite direction. If , the arrow collapses to a point at the origin (the zero vector).
Algebraically, scalar multiplication multiplies every component:
Explore both operations interactively. Toggle between addition mode and scalar multiplication mode to see each operation in both pictures at once:
Interactive: Vector Operations
The green arrow is the sum v₁ + v₂, reached by placing vectors tip-to-tail. The dashed lines show the parallelogram law.
| Operation | Arrow Picture | List Picture |
|---|---|---|
| Addition | Tip-to-tail or parallelogram diagonal | Add corresponding components |
| Scalar mult. | Stretch/shrink/flip the arrow | Multiply every component by the scalar |
| Zero vector | A point at the origin (no direction, no length) | A list of all zeros: (0, 0, ..., 0) |
| Negation | Flip the arrow 180° | Negate every component: (-v₁, -v₂) |
Linear Combinations: The Fundamental Operation
We now arrive at the single most important operation in linear algebra. Given vectors and scalars , their linear combination is:
Every concept in linear algebra can be described in terms of linear combinations:
- A vector is a linear combination of the basis vectors:
- A matrix-vector product is a linear combination of the columns of , with the entries of as scalars
- A system of equations asks: can we write a given vector as a linear combination of other vectors?
- Linear dependence means one vector can be written as a linear combination of the others
Consider a concrete example: where and . The dashed arrows show the scaled contributions that add tip-to-tail to produce the result:
The interactive explorer below lets you experiment freely. You have two basis vectors and and two scalar sliders and . The result vector is . By adjusting the scalars, you can reach any point in the plane. Try different basis vectors to see how the "grid" reshapes itself.
Interactive: Linear Combinations
Every vector in the plane is a linear combination of the basis vectors. Adjust the scalars to reach any point.
The green result vector is always c₁ · b₁ + c₂ · b₂. Try different bases to see how the same point can be reached with different combinations.
The Core Insight
Span: What Linear Combinations Can Reach
Given a set of vectors, the span is the set of all vectors that can be expressed as their linear combinations. Formally:
The span tells us the reach of our vectors. What can we build from them? The answer depends on whether the vectors point in genuinely different directions:
- If and point in different directions (they are linearly independent), their span is the entire plane . Every point is reachable.
- If they point in the same (or opposite) direction (they are collinear or linearly dependent), their span is just a line through the origin. You cannot escape that line no matter what scalars you choose.
- If both are the zero vector, the span is just the origin, a single point.
Compare two cases side by side. On the left, independent vectors span the full plane. On the right, collinear vectors only span a line:
Independent: span = entire plane
Dependent: span = a line
Explore this interactively in the visualization below. Start with two independent vectors (span = plane), then make them collinear and watch the span collapse to a line. The determinant indicator tells you whether the vectors are independent.
Interactive: Span of Two Vectors
The span is the set of all points reachable by linear combinations of the two vectors. Make them collinear to see the span collapse to a line.
The purple region shows the span. When vectors point in independent directions, the span is the full plane. When they are collinear (one is a scalar multiple of the other), the span collapses to a single line.
The concept of span generalizes naturally to higher dimensions. In :
- The span of one nonzero vector is a line (1D)
- The span of two independent vectors is a plane through the origin (2D)
- The span of three independent vectors is all of (3D)
Span and Solvability
Higher Dimensions: Beyond What We Can See
Everything we have discussed in 2D extends naturally to dimensions. A vector in is a list of numbers, or equivalently, a linear combination of standard basis vectors :
We lose the ability to visualize these vectors as arrows when , but the algebra works identically. Addition is still component-wise. Scalar multiplication still multiplies every component. Linear combinations still combine vectors with scalar coefficients. This is the power of the list picture: it works perfectly in any number of dimensions.
| Dimension | What a Vector Represents | Example |
|---|---|---|
| 2 | A point in the plane | Position on a map: (lat, lon) |
| 3 | A point in space | RGB color: (255, 128, 0) |
| 4 | Beyond spatial visualization | Spacetime event: (x, y, z, t) |
| 100 | A feature vector in ML | Movie ratings by 100 critics |
| 768 | A word embedding | BERT representation of a word |
| 12,288 | A token embedding in GPT-4 | Every word, encoded as 12K numbers |
Each component represents one degree of freedom, one independent axis along which the vector can vary. A 768-dimensional embedding vector has 768 independent "dials" that can be tuned to represent different meanings. You cannot draw this as an arrow, but the linear algebra is exactly the same as in 2D.
Before we lose the ability to visualize, let us explore 3D thoroughly. The interactive 3D explorer below lets you rotate the view freely and see vectors, linear combinations, and span in three dimensions. Switch between modes to see how a single scaled vector traces a line, how three vectors combine tip-to-tail in 3D, and how the span of three independent vectors fills all of while dependent vectors only span a plane or line.
Now try manipulating individual 3D vectors directly. The interactive grid below works just like the 2D version you used earlier, but with an added -axis. Each vector decomposes into three basis components: (red, along ), (green, along ), and (blue, along ). Drag to orbit the scene and use the sliders to adjust each component.
Drag tips to move · red dashed = î · green dashed = ĵ · blue dashed = k̂
3D Intuition for Higher Dimensions
Real-World Examples Across Fields
Vectors are not abstract curiosities. They are the natural language for representing structured information in virtually every quantitative field.
Physics: Forces and Equilibrium
In physics, forces are vectors. When multiple forces act on an object, the net force is their vector sum. An object is in equilibrium when the sum of all force vectors is zero: . This is a linear combination set equal to zero, one of the most basic setups in linear algebra.
Computer Graphics: Position, Color, and Motion
In 3D graphics, everything is a vector. Vertex positions are vectors in . Colors are vectors in (RGB) or (RGBA). Surface normals, light directions, and camera orientations are all vectors. Animation is the art of interpolating between vector-valued keyframes, which is itself a linear combination.
Economics: Price Vectors and Resource Allocation
In economics, a price vector lists the prices of goods. A consumption bundle lists quantities consumed. The total cost is the dot product , connecting vectors directly to economic value.
Signal Processing: Sound as Vectors
A digitized audio signal is a vector in where is the number of samples. At 44.1 kHz, one second of audio is a vector with 44,100 components. Noise reduction, compression, and equalization are all linear operations on these vectors.
Data Science: Feature Vectors
In data science, each data point is a feature vector. A house might be described by the vector . A dataset with 10,000 houses and 4 features is a collection of 10,000 vectors in . Machine learning algorithms operate on these vectors: measuring distances between them, projecting them, clustering them, and transforming them.
Vectors in Modern Machine Learning
In modern ML, vectors are not just a convenience; they are the fundamental unit of information. Understanding how vectors work gives you direct insight into how AI systems represent and process knowledge.
Word Embeddings: Meaning as Geometry
Modern NLP represents words as vectors in high-dimensional space. The famous Word2Vec and GloVe models discovered that semantic relationships become geometric relationships. The vector arithmetic works because the "gender direction" is approximately a consistent vector that can be added or subtracted. This is vector addition in a 300-dimensional space.
Neural Network Layers: Linear Combinations of Features
Each neuron in a neural network computes a linear combination of its inputs: . This is exactly , a dot product (a special linear combination) plus a bias. A layer with neurons computes linear combinations simultaneously, which is a matrix-vector product .
Feature Spaces and Representations
Deep learning works by transforming input vectors through successive layers, each producing a new vector in a different representation space. An image starts as a vector of pixel values (say, in for a 28×28 image). The first layer might map it to , the next to , and so on. Each transformation is (approximately) a linear combination of the previous features, followed by a nonlinearity.
Similarity as Geometry
In recommendation systems and search engines, similarity between items is measured by the geometric relationship between their vectors. The cosine similarity between two vectors measures the cosine of the angle between them, which is a direct consequence of the arrow picture of vectors. Two vectors pointing in the same direction (cosine near 1) represent similar items; perpendicular vectors (cosine near 0) are unrelated.
The Computational View
Let us see vectors in action with Python and NumPy. This code demonstrates the duality between the arrow picture and the list picture, and explores linear combinations and span:
Summary and Road Ahead
Let us consolidate the key ideas from this section:
- Three perspectives on vectors: arrows in space (geometry), lists of numbers (computation), and abstract objects in vector spaces (universal theory). All three are correct and complementary.
- Basis vectors are the bridge between the arrow and list pictures. Coordinates are instructions for how to combine basis vectors: .
- Coordinates depend on the basis. The same arrow has different numbers in different coordinate systems. Coordinates are a choice, not an intrinsic property of the vector.
- Linear combinations are the fundamental operation: scale vectors and add them. Every major concept in linear algebra (matrix products, systems of equations, eigenvalue decompositions) is a variation on this theme.
- Span is the set of all vectors reachable by linear combinations. Independent vectors span the full space; dependent vectors span only a lower-dimensional subspace.
- Higher dimensions work identically to 2D and 3D algebraically, even though we can no longer visualize them. This is the power of the list picture: it scales to any dimension.
- Vectors are everywhere: in physics (forces), graphics (positions, colors), economics (prices), signal processing (audio), data science (features), and AI (embeddings, layer outputs, attention).
In the next section, we will explore the power of linearity: why the constraint that operations preserve addition and scaling is not a limitation but rather the source of linear algebra's extraordinary power. We will see how linearity enables decomposition, superposition, and the representation of complex transformations as simple matrices.
The key takeaway: A vector is simultaneously a geometric object (an arrow) and an algebraic object (a list of numbers). Neither description is more real than the other. The bridge between them is the choice of basis. Learning to think fluently in both pictures, switching between them depending on what question you are asking, is the first and most important skill in linear algebra.