Skip to main content

Span: everything you can reach

Fix a few vectors and let their weights run over all numbers. The set of points you can reach is their span. See why one vector spans a line, why two usually span a plane, what happens in three dimensions, and when adding a vector adds nothing at all.
M02.2.2L1 Core25 minIn review

Before this lesson

M02.2.1 Linear combinations

After this lesson you can

  • Define the span of a set of vectors as the set of all their linear combinations.
  • Describe the span of one vector, and of two vectors in the plane, and say when two vectors fail to span the plane.
  • Describe the possible spans in three dimensions: a point, a line, a plane, or all of space.
  • Test whether a given vector lies in a span by solving for the weights entry by entry.
  • Explain why adding a vector that is already in a span leaves the span unchanged.

In review. The maths and code on this page are checked by automated tests on every change, but an independent reader has not signed it off yet. Spot a mistake or a confusing step? Tell us.

The question

A linear model with two features makes its predictions by combining two columns of numbers. With three houses, each column has three entries, and so does the list of prices you want to match. Can the two weights always be tuned to hit all three prices exactly? The answer depends on a set: everything that the two columns can reach.

From the last lesson

1. What is a linear combination of \(\vect{u}\) and \(\vect{v}\)?

Show answer

A vector of the form \({a\,\vect{u}} + {b\,\vect{v}}\), where the numbers \(a\) and \(b\) are called the weights: scale each vector, then add.

2. Which number must not be zero for the formula to give the weights?

Show answer

\(D = u_1 v_2 - u_2 v_1\). When \(D \neq 0\), every target has exactly one pair of weights.

Intuition

In the last lesson the weights were fixed and the answer was one point. Now fix the vectors and let the weights run over every real number. Each choice of weights gives a point. Collect all of those points into one set. That set is the span of the vectors: everything you can reach by scaling them and adding.

Two square panels. Left panel, titled One vector: a line, shows a unit grid with the blue arrow u pointing down and to the right, and a thick pale vermillion line through the origin along u. Vermillion dots on the line are labelled minus 2u, minus 1u and 2u. A hollow grey dot at the point (2, 1), away from the line, is labelled off the line: out of reach. A note reads the span of one vector. Right panel, titled Two vectors: the whole plane, has its whole area tinted pale vermillion and covered by the slanted grid of the two blue arrows u and v. The same point (2, 1) is now a solid vermillion dot labelled 1u plus 1v, with a dashed path from the origin along u and then along v. A note reads the span of two vectors.
M02.2.2-F1

The span of one vector is a line through the origin. Add a second vector that points off that line and the span becomes the whole plane: the point \((2, 1)\), out of reach on the left, is \({1\,\vect{u}} + {1\,\vect{v}}\) on the right.

The running pair is the same as before, \(\vect{u} = (1, -1)\) and \(\vect{v} = (1, 2)\).

Build it up

Step 1. One vector spans a line. The combinations of a single vector \(\vect{u}\) are its multiples \({c\,\vect{u}}\). As \(c\) runs over all numbers the tip traces a straight line. The line passes through the origin, because \(c = 0\) is allowed, and it runs both ways, because \(c\) may be negative. One exception: if \(\vect{u}\) is the zero vector, every multiple is zero and the span is just the origin.

Step 2. A second vector off the line sweeps the plane. Take \({a\,\vect{u}} + {b\,\vect{v}}\) and hold \(b\) still. As \(a\) varies, the points form a copy of the line of \(\vect{u}\), moved over by \({b\,\vect{v}}\). Now change \(b\): the copy slides along \(\vect{v}\). If \(\vect{v}\) points off the line, the sliding copies sweep across the whole plane.

Two square panels. Left panel, titled Off the line: the copies sweep, shows the blue arrows u and v from the origin and five parallel pale vermillion lines, all in the direction of u. They pass through the points minus v, minus half of v, the origin, half of v and v, and carry the orange labels b equals minus 1, b equals minus 0.5, b equals 0, b equals 0.5 and b equals 1. Together the lines march across the plane. Right panel, titled On the line: nothing moves, shows u and a second blue arrow labelled v equals minus 2u, pointing the opposite way along the same line. There is only one pale vermillion line, with dots sliding along it. Notes read every copy is the same line and nothing new is reached.
M02.2.2-F2

Each value of \(b\) gives a copy of the line of \(\vect{u}\), moved by \({b\,\vect{v}}\). Left: when \(\vect{v}\) points off the line, the copies sweep the plane. Right: when \(\vect{v}\) lies on the line, every copy is the line itself.

Step 3. A second vector on the line adds nothing. Suppose \(\vect{v}\) is a multiple of \(\vect{u}\), say \(\vect{v} = {k\,\vect{u}}\). Then

\[ \begin{aligned} a\,\vect{u} + b\,\vect{v} &= a\,\vect{u} + bk\,\vect{u} \\ &= (a + bk)\,\vect{u}, \end{aligned} \]

which is still a multiple of \(\vect{u}\). Sliding the line along itself goes nowhere. Two vectors, but still only a line.

Step 4. The same story in space. In three dimensions one vector still spans a line. Two vectors that do not share a line span a flat sheet through the origin: a plane sitting inside space. For \(\vect{u} = (1, 0, 1)\) and \(\vect{v} = (0, 1, 1)\),

\[ a\,\vect{u} + b\,\vect{v} = (a,\; b,\; a + b), \]

so the sheet is exactly the set of points whose third entry is the sum of the first two.

Two three-dimensional drawings with axes x, y and z. Left panel, titled Two vectors: a sheet, shows two blue arrows u and v rising from the origin and a pale vermillion tilted sheet with grid lines that contains both of them and passes through the origin. A lighter blue arrow labelled u plus v also lies in the sheet, with the note on the sheet: adds nothing. Right panel, titled Off the sheet: all of space, shows u, v and a third blue arrow w pointing straight up out of the sheet. Three copies of a smaller piece of the sheet are stacked along w, one below the origin, one through it and one above, with the notes copies of the sheet, moved along w and together they fill space.
M02.2.2-F3

Left: two vectors in space span a sheet through the origin, and a third vector that lies in the sheet adds nothing. Right: a third vector that points off the sheet slides it through space, and the copies fill everything.

The vector \(\vect{w} = (0, 0, 1)\) is off the sheet, since \(0 + 0 \neq 1\). With it, \({a\,\vect{u}} + {b\,\vect{v}} + {c\,\vect{w}} = (a,\; b,\; a + b + c)\), and any target \((t_1, t_2, t_3)\) is reached by \(a = t_1\), \(b = t_2\) and \(c = t_3 - t_1 - t_2\). The three vectors span all of space.

Step 5. Each new vector either adds a direction or adds nothing. A new vector that is already in the span changes nothing. A new vector outside the span makes the span larger: here a line became a plane, and a sheet became all of space.

The formal statement

NoteDefinition: span

The span of the vectors \(\vect{v}_1, \dots, \vect{v}_k\) in \(\R^n\) is the set of all their linear combinations:

\[ \begin{aligned} &\operatorname{span}\{\vect{v}_1, \dots, \vect{v}_k\} \\ &\;= \{\, c_1\vect{v}_1 + \cdots + c_k\vect{v}_k \;:\; \text{all } c_i \in \R \,\}. \end{aligned} \]

The vectors span a set \(V\) if their span is all of \(V\).

Three facts follow from the definition. Each is used again later in this module.

Fact 1: every span contains the origin. Choose every weight to be zero: \({0\,\vect{v}_1} + \cdots + {0\,\vect{v}_k} = \vect{0}\). So a line or a plane that misses the origin is never a span.

Fact 2: a span is closed. Adding two vectors of the span, or scaling one, never leaves it. Take \(\vect{x} = a_1\vect{v}_1 + \cdots + a_k\vect{v}_k\) and \(\vect{y} = b_1\vect{v}_1 + \cdots + b_k\vect{v}_k\), and any number \(c\). Collecting the terms of each \(\vect{v}_i\),

\[ \begin{aligned} &\vect{x} + \vect{y} \\ &= (a_1 + b_1)\vect{v}_1 + \cdots + (a_k + b_k)\vect{v}_k, \\[4pt] &c\,\vect{x} = (c a_1)\vect{v}_1 + \cdots + (c a_k)\vect{v}_k . \end{aligned} \]

Both are again combinations of \(\vect{v}_1, \dots, \vect{v}_k\). A set with this property is called a subspace, a word that module M02.7 uses heavily.

Fact 3: when adding a vector adds nothing. Write \(S\) for \(\operatorname{span}\{\vect{v}_1, \dots, \vect{v}_k\}\). For any vector \(\vect{w}\),

\[ \begin{gathered} \operatorname{span}\{\vect{v}_1, \dots, \vect{v}_k, \vect{w}\} = S \\ \text{exactly when}\quad \vect{w} \in S . \end{gathered} \]

Why. The larger set of vectors always spans at least as much, since \(\vect{w}\) can be given the weight zero. Suppose first that \(\vect{w}\) is in the smaller span, say \(\vect{w} = d_1\vect{v}_1 + \cdots + d_k\vect{v}_k\). Then any combination that uses \(\vect{w}\) can be rewritten without it:

\[ \begin{aligned} &c_1\vect{v}_1 + \cdots + c_k\vect{v}_k + c\,\vect{w} \\ &= (c_1 + c d_1)\vect{v}_1 + \cdots \\ &\quad + (c_k + c d_k)\vect{v}_k . \end{aligned} \]

So the two spans are equal. In the other direction, suppose the spans are equal. The vector \(\vect{w} = {0\,\vect{v}_1} + \cdots + {0\,\vect{v}_k} + {1\,\vect{w}}\) is in the larger span, so it is in the smaller one too.

Two vectors in the plane. Let \(D = u_1 v_2 - u_2 v_1\), the number from the last lesson.

  • If \(D \neq 0\), every target has weights (lesson M02.2.1), so the span is the whole plane.
  • If \(D = 0\), the span is a line through the origin, or only the origin.

Why the second case. If \(\vect{u} = \vect{0}\), the span is the set of multiples of \(\vect{v}\) alone. Otherwise one entry of \(\vect{u}\) is not zero. Say \(u_1 \neq 0\) and put \(k = v_1 / u_1\), so that \(v_1 = k u_1\). Then \(D = 0\) reads \(u_1 v_2 = u_2 v_1\), and dividing by \(u_1\) gives

\[ v_2 = \frac{u_2 v_1}{u_1} = k\,u_2 . \]

Both entries agree, so \(\vect{v} = {k\,\vect{u}}\). (If instead \(u_1 = 0\), then \(u_2 \neq 0\); put \(k = v_2 / u_2\), and \(D = 0\) reads \(0 = u_2 v_1\), so \(v_1 = 0 = k u_1\) and again \(\vect{v} = {k\,\vect{u}}\).) By Step 3 every combination is then a multiple of \(\vect{u}\), and the span is the line of \(\vect{u}\).

The converse is one line: if \(\vect{v} = {k\,\vect{u}}\) then \(D = u_1 (k u_2) - u_2 (k u_1) = 0\), and the same happens if \(\vect{u}\) is a multiple of \(\vect{v}\).

So two vectors span the plane exactly when \(D \neq 0\), which is exactly when neither is a multiple of the other.

Go deeper: why a line can never be the whole plane

The picture makes this obvious, but it can also be proved. Let the line be all multiples of a vector \(\vect{d} = (d_1, d_2) \neq \vect{0}\). We show that the point \((-d_2, d_1)\) is not on it.

Suppose it were: \((-d_2, d_1) = {c\,(d_1, d_2)}\) for some number \(c\). Then \(-d_2 = {c\,d_1}\) and \(d_1 = {c\,d_2}\). Put the first into the second:

\[ \begin{gathered} \begin{aligned} d_1 &= c\,d_2 = c\,(-c\,d_1) \\ &= -c^2 d_1 , \end{aligned} \\ \text{so}\quad (1 + c^2)\,d_1 = 0 . \end{gathered} \]

Since \(1 + c^2\) is at least 1, this forces \(d_1 = 0\), and then \(d_2 = -{c\,d_1} = 0\) as well. That contradicts \(\vect{d} \neq \vect{0}\). So the point \((-d_2, d_1)\) is off the line, and the line is not the whole plane.

Worked example

Let \(\vect{u} = (1, 0, 1)\) and \(\vect{v} = (0, 1, 1)\). Are \(\vect{p} = (1, 2, 3)\) and \(\vect{q} = (1, 2, 2)\) in their span?

Two panels. Left panel, titled The test, entry by entry, is a column of boxes joined by green arrows. First box: a u plus b v equals (a, b, a plus b). Second box: first two entries: a equals 1, b equals 2. Third box: so the third must be 1 plus 2 equals 3. Two arrows lead down to a green box reading (1, 2, 3), third is 3, labelled in the span, and a purple box reading (1, 2, 2), third is 2, labelled not in the span. Right panel, titled The same test in space, is a three-dimensional drawing of the tilted vermillion sheet spanned by u and v. A blue path, 1u and then plus 2v, runs along the sheet to a green dot labelled (1, 2, 3). A dashed vertical line drops from that dot to the floor, passing through a purple dot labelled (1, 2, 2), with the note one unit below the sheet.
M02.2.2-F4

A vector is in the span exactly when weights exist. The first two entries fix the weights, and the third entry tests them. \(\vect{p}\) passes and \(\vect{q}\) fails: it hangs one unit below the sheet.

Every combination has the form \({a\,\vect{u}} + {b\,\vect{v}} = (a, b, a + b)\). Match it to \(\vect{p} = (1, 2, 3)\) one entry at a time.

  • First entry: \(a = 1\).
  • Second entry: \(b = 2\).
  • Third entry: \(a + b\) must equal 3, and \(1 + 2 = 3\). It does.

All three equations hold, so \(\vect{p} = {1\,\vect{u}} + {2\,\vect{v}}\) is in the span.

Now \(\vect{q} = (1, 2, 2)\). The first two entries force the same weights, \(a = 1\) and \(b = 2\). The third entry would then have to be \(1 + 2 = 3\), but it is 2. Three equations, two unknowns, and no solution: \(\vect{q}\) is not in the span.

By Fact 3, adding \(\vect{p}\) to the set changes nothing: \(\vect{u}, \vect{v}, \vect{p}\) still span only the sheet. Adding \(\vect{q}\) does change it. Exercise 3 shows that \(\vect{u}, \vect{v}, \vect{q}\) span all of space.

Back to the houses. The feature columns are \(\vect{s} = (50, 80, 120)\) and \(\vect{r} = (1, 2, 4)\). The prices \((170, 280, 440)\) are in their span, with weights 3 and 20 (lesson M02.2.1). Change the last price to 450 and test again. The first two entries give \(50a + b = 170\) and \(80a + 2b = 280\). From the first, \(b = 170 - 50a\). Put it into the second: \(80a + 340 - 100a = 280\), so \(a = 3\) and \(b = 20\). The third entry is then \({120 \cdot 3} + {4 \cdot 20} = 440\), not 450. The prices \((170, 280, 450)\) are not in the span, and no choice of weights fits all three houses exactly.

This is the normal situation in machine learning. Two columns in \(\R^3\) span only a sheet, and real targets almost never lie exactly on it. Fitting a model means finding the point of the span that is closest to the target, an idea that starts in lesson M02.3.4.

Code

From scratch, for two vectors of any length: solve for the weights using the first two entries (the formula of lesson M02.2.1), then test every entry.

def in_span(u, v, t, tol=1e-9):
    """Is t a combination of u and v? Returns (answer, weights found from entries 0 and 1)."""
    D = u[0] * v[1] - u[1] * v[0]
    if D == 0:
        raise ValueError("entries 0 and 1 do not fix the weights: use another pair of entries")
    a = (t[0] * v[1] - t[1] * v[0]) / D
    b = (u[0] * t[1] - u[1] * t[0]) / D
    fits = all(abs(a * u[k] + b * v[k] - t[k]) < tol for k in range(len(t)))
    return fits, (a, b)

u, v = (1, 0, 1), (0, 1, 1)
print("p = (1, 2, 3):", in_span(u, v, (1, 2, 3)))
print("q = (1, 2, 2):", in_span(u, v, (1, 2, 2)))

size, bedrooms = (50, 80, 120), (1, 2, 4)
print("prices (170, 280, 440):", in_span(size, bedrooms, (170, 280, 440)))
print("prices (170, 280, 450):", in_span(size, bedrooms, (170, 280, 450)))
p = (1, 2, 3): (True, (1.0, 2.0))
q = (1, 2, 2): (False, (1.0, 2.0))
prices (170, 280, 440): (True, (3.0, 20.0))
prices (170, 280, 450): (False, (3.0, 20.0))

With NumPy, np.linalg.lstsq finds the weights whose combination comes closest to the target. If the closest point is the target itself, the target is in the span.

import numpy as np

def closest_in_span(vectors, t):
    """The weights that bring the combination nearest to t, and the point they reach."""
    columns = np.column_stack(vectors)
    target = np.asarray(t, dtype=float)
    weights = np.linalg.lstsq(columns, target, rcond=None)[0]
    return weights, columns @ weights

for t in [(1, 2, 3), (1, 2, 2)]:
    weights, reached = closest_in_span([u, v], t)
    print(t, "weights", weights.round(3), "reached", reached.round(3), "in span:", np.allclose(reached, t))

weights, reached = closest_in_span([size, bedrooms], (170, 280, 450))
print("houses: weights", weights.round(2), "predictions", reached.round(1))
(1, 2, 3) weights [1. 2.] reached [1. 2. 3.] in span: True
(1, 2, 2) weights [0.667 1.667] reached [0.667 1.667 2.333] in span: False
houses: weights [ 2.82 27.88] predictions [168.8 281.2 449.7]

For \(\vect{q}\) the nearest point of the sheet is \((0.667, 1.667, 2.333)\), not \(\vect{q}\) itself. For the houses the best weights miss every price a little. That small miss, made as small as possible, is what “fitting a linear model” means.

Explore

M02.2-X1

Span explorer

Drag the tips of \(\vect{u}\) and \(\vect{v}\), or use their sliders. The shaded region is their span. Move the two weight sliders to walk the combination around, and drag the target \(\vect{t}\) to ask whether it can be reached.

A static picture in place of the interactive. On the left, one blue arrow u and the thick line through the origin that it spans, with a point off the line marked out of reach. On the right, two blue arrows u and v, the whole plane tinted because their span is everything, and the same point now reached as 1u plus 1v.

Things to try:

  1. Press Parallel. The shading collapses to a line. Move the weights: the combination cannot leave the line, and the read-out says the target is out of reach.
  2. Press Module’s pair, then Jump to the target. The weights become 3 and 2, the answer to the worked example of lesson M02.2.1.
  3. Press Nearly parallel and read the weights needed for the target. They are large and of opposite sign. Lesson M02.2.3 returns to this.
  4. Make \(\vect{v}\) the zero vector. What is the span now?

Pitfalls

Two square panels showing the same blue arrows u and v. Left panel, marked with a cross and titled Between the arrows, shades only the parallelogram with corners at the origin, u, u plus v and v, with the note only weights from 0 to 1. A hollow grey dot at the point (minus 2, minus 1), behind both arrows, is labelled left out? Right panel, marked with a tick and titled The whole plane, tints the entire panel green and draws the slanted grid across it. The same point is a solid green dot labelled minus 1u minus 1v, reached by a dashed path that goes backwards along u and then backwards along v. A note reads weights of any size and sign.
M02.2.2-F5

Wrong beside right. The span is not the patch between the arrows. Weights may be negative or large, so the span of this pair is the whole plane.

“The span is the region between the two arrows.”

That region uses only weights between 0 and 1. The definition allows every real weight. Negative weights reach behind the arrows, and large weights reach far beyond their tips. The point \((-2, -1)\) is \({-1\,\vect{u}} - {1\,\vect{v}}\).

“More vectors always means a bigger span.”

Only a vector outside the current span enlarges it (Fact 3). In a dataset, a feature column that is a combination of other columns, such as a price in pounds beside the same price in pence, adds nothing to what a linear model can predict.

“Any line or plane is the span of something.”

Every span contains the origin (Fact 1). The line of points \((x,\, x + 1)\) misses the origin, so it is not a span. It is a span that has been shifted, which is what the bias term of a model does.

“Two vectors span a plane, and three vectors span space.”

Only usually. Two vectors on one line span just that line. Three vectors in one sheet, such as \(\vect{u}\), \(\vect{v}\) and \(\vect{u} + \vect{v}\), span just that sheet. Counting vectors is not enough. The next lesson says what must be checked.

Check yourself

Recall

1. What is the span of a set of vectors?

Show answer

The set of all their linear combinations: everything you can reach by scaling them and adding.

2. What is the span of one non-zero vector?

Show answer

The line through the origin along that vector: all of its multiples.

3. When do two vectors in the plane fail to span the plane?

Show answer

When one is a multiple of the other, so that both lie on one line through the origin. In coordinates, when \(D = u_1 v_2 - u_2 v_1 = 0\).

4. For \(\vect{u} = (1, 0, 1)\) and \(\vect{v} = (0, 1, 1)\), what rule do the points of the span obey?

Show answer

Every combination is \((a, b, a + b)\), so the third entry is the sum of the first two.

5. When does adding a vector \(\vect{w}\) to a set leave its span unchanged?

Show answer

Exactly when \(\vect{w}\) is already in the span of the set.

Exercises

1. ★ Describe the span of each set in words: (a) \(\{(2, 1)\}\) (b) \(\{(2, 1), (4, 2)\}\) (c) \(\{(2, 1), (1, 3)\}\) (d) \(\{(0, 0)\}\).

Show solution

(a) The line through the origin and the point \((2, 1)\).

(b) The same line, because \((4, 2) = {2\,(2, 1)}\) adds nothing. Check: \(D = {2 \cdot 2} - {1 \cdot 4} = 0\).

(c) The whole plane, because \(D = {2 \cdot 3} - {1 \cdot 1} = 5 \neq 0\).

(d) Only the origin: every multiple of the zero vector is the zero vector.

2. ★★ Let \(\vect{u} = (1, 0, 1)\) and \(\vect{v} = (0, 1, 1)\). Is \((3, 1, 4)\) in their span? Is \((2, -1, 2)\)?

Show solution

Every combination is \((a, b, a + b)\).

For \((3, 1, 4)\): \(a = 3\), \(b = 1\), and the third entry must be \(3 + 1 = 4\). It is. So \((3, 1, 4) = {3\,\vect{u}} + {1\,\vect{v}}\) is in the span.

For \((2, -1, 2)\): \(a = 2\), \(b = -1\), and the third entry must be \(2 - 1 = 1\). It is 2. So \((2, -1, 2)\) is not in the span.

3. ★★★ Show that \(\vect{u} = (1, 0, 1)\), \(\vect{v} = (0, 1, 1)\) and \(\vect{q} = (1, 2, 2)\) span all of \(\R^3\), by finding weights that reach an arbitrary target \((t_1, t_2, t_3)\).

Show solution

We need

\[ \begin{aligned} &a\,\vect{u} + b\,\vect{v} + c\,\vect{q} \\ &\;= (a + c,\; b + 2c,\; a + b + 2c) \\ &\;= (t_1, t_2, t_3). \end{aligned} \]

The first entry gives \(a = t_1 - c\) and the second gives \(b = t_2 - 2c\). Put both into the third:

\[ \begin{gathered} (t_1 - c) + (t_2 - 2c) + 2c = t_3 , \\ \text{so}\quad c = t_1 + t_2 - t_3 . \end{gathered} \]

Then \(a = t_1 - c = t_3 - t_2\) and \(b = t_2 - 2c = 2t_3 - 2t_1 - t_2\).

Check each entry. The last line uses \(b + 2c = t_2\) from the line before it.

\[ \begin{aligned} &a + c \\ &\;= (t_3 - t_2) + (t_1 + t_2 - t_3) \\ &\;= t_1, \\[4pt] &b + 2c \\ &\;= (2t_3 - 2t_1 - t_2) \\ &\qquad + (2t_1 + 2t_2 - 2t_3) \\ &\;= t_2, \\[4pt] &a + b + 2c \\ &\;= (t_3 - t_2) + t_2 = t_3 . \end{aligned} \]

Weights exist for every target, so the span is all of \(\R^3\). For instance the target \((0, 0, 1)\) needs \(c = -1\), \(a = 1\), \(b = 2\): indeed \((1, 0, 1) + {2\,(0, 1, 1)} - (1, 2, 2) = (0, 0, 1)\).

Summary card

The span is everything the weights can reach.

The anchor figure again: on the left one vector and the line through the origin that it spans; on the right two vectors that are not parallel and the whole plane, tinted, as their span.
M02.2.2-F1

One vector: a line. Two: usually a plane.

  • Span. \(\operatorname{span}\{\vect{v}_1, \dots, \vect{v}_k\}\) is the set of all \(c_1\vect{v}_1 + \cdots + c_k\vect{v}_k\).
  • Always through the origin, and closed under adding and scaling.
  • Two vectors in the plane span it exactly when \(D = u_1 v_2 - u_2 v_1 \neq 0\).
  • Adding \(\vect{w}\) changes nothing exactly when \(\vect{w}\) is already in the span.
  • Membership test. \(\vect{t}\) is in the span exactly when the equations for the weights have a solution.

Sources and next steps

Sources. Each was opened and checked against this lesson on 12 November 2026.

  • Sheldon Axler, Linear Algebra Done Right, 4th edition (open access). Section 2A, definition 2.4 (span, as the set of all linear combinations), result 2.6 (the span is the smallest subspace containing the vectors) and the second half of the linear dependence lemma 2.19 (removing a vector that lies in the span of the ones before it does not change the span).
  • Grant Sanderson, Linear combinations, span, and basis vectors, 3Blue1Brown, Linear Algebra, chapter 2. The span of most pairs of vectors in the plane is the whole plane, and a line when they line up; in space two vectors span a flat sheet through the origin, and a third vector on that sheet does not change the span.
  • Dan Margalit and Joseph Rabinoff, Interactive Linear Algebra, Section 2.2, Vector Equations and Spans. A vector is in the span exactly when the vector equation has a solution; two collinear vectors span a line and three coplanar vectors span a plane.
  • Marc Deisenroth, Aldo Faisal and Cheng Soon Ong, Mathematics for Machine Learning (free PDF). Section 2.6.1, definition 2.13 (generating set and span).
  • NumPy reference, numpy.linalg.lstsq: it returns the least-squares solution, the x that makes the length of b - a @ x as small as possible. Those are the weights whose combination is nearest the target.

Next. M02.2.3 Linear independence gives a name to the situation where a vector adds nothing, and a test for it.

This lesson unlocks

M02.2.3 Linear independence

Your progress is saved in this browser only. No account, no tracking.
Back to top