Visual Tools
Calculators
Tables
Mathematical Keyboard
Converters
Other Tools


Span and Membership


Is w a combination of v₁ … vₖ? Row reduce V to size the span, then [V | w] to decide and to read the coordinates.

Preset?The span of v₁ … vₖ is the set of all combinations c₁v₁ + … + cₖvₖ — a line, a plane, or a higher subspace through the origin. A vector w is in the span exactly when the system V c = w, with the vᵢ as the columns of V, has a solution; row reducing [V | w] decides it, and the solution c is the coordinate vector of w. The rank of V is the dimension of the span, and the vᵢ are a basis of it when the rank equals k.
Space and count
R3vectors2
Vectors and w
v₁
v₂
|
w
V = [v₁ … vₖ]3×2
1
0
0
1
1
1
c =
w
2
3
5
Step 1 / 5

Step explanations

1Is w in span{v₁, v₂}?
v₁ = (1, 0, 1), v₂ = (0, 1, 1), and the test vector w = (2, 3, 5), all in R³. The span is every combination c₁v₁ + … + c₂v₂, and w is in it exactly when some coefficients c make V c = w with the vᵢ as the columns of V. So the question is whether a linear system is consistent, and row reduction answers it — after first finding how big the span is.
The span is the column space of V; membership is solvability of V c = w. Learn more about the setup · what span means








Key Terms

Span — the set of all linear combinations c1v1++ckvkc_1\mathbf{v}_1 + \cdots + c_k\mathbf{v}_k; the smallest subspace containing the vectors.

Membershipwspan{v1,,vk}\mathbf{w} \in \operatorname{span}\{\mathbf{v}_1, \ldots, \mathbf{v}_k\} exactly when Vc=wV\mathbf{c} = \mathbf{w} has a solution, where VV has the vi\mathbf{v}_i as columns.

Coordinates — the solution c\mathbf{c}; unique when the vi\mathbf{v}_i are independent, in which case c\mathbf{c} is the coordinate vector of w\mathbf{w} in the basis {vi}\{\mathbf{v}_i\}.

Dimension of the span — the rank of VV; the number of pivot columns.

Linear independence — rank equal to kk; no vector is a combination of the others.

Dependency — a relation vf=civi\mathbf{v}_f = \sum c_i\mathbf{v}_i read from a free column of the reduced form.

Basis of the span — the pivot vectors; the dependent ones can be dropped without shrinking the span.

Augmented matrix[Vw][V \mid \mathbf{w}], whose reduction decides consistency.

Getting Started with the Visualizer

Enter spanning vectors and a test vector, then watch two row reductions answer three questions.

• Use the Preset pills for seven problems: a vector in a plane, a vector off that plane, a vector on a line, a dependent spanning set, a basis of R3\mathbb{R}^3, a plane in R4\mathbb{R}^4, and the zero vector
• Use the space stepper for R2\mathbb{R}^2 to R4\mathbb{R}^4 and the vectors stepper for one to four spanning vectors; Shuffle gives random vectors with w\mathbf{w} usually in the span
• Edit any entry of the vectors or of w\mathbf{w} directly; w\mathbf{w} is the amber column
• Hover the ? icon for a reminder of how membership becomes a linear system
• Press play or step manually; the step log on the right keeps every stage

The three questions are: how big is the span, is w\mathbf{w} in it, and if so what are its coordinates. The answers come from the rank of VV, the consistency of [Vw][V \mid \mathbf{w}], and its solution.

The Scenes in Order

The visualizer follows the textbook procedure exactly.

Setup — the vectors as the columns of VV and the test vector w\mathbf{w}; the question Vc=wV\mathbf{c} = \mathbf{w}
RankVV row reduced; the rank is the dimension of the span, and each free column gives a dependency vf=civi\mathbf{v}_f = \sum c_i\mathbf{v}_i read from the reduced form
Membership[Vw][V \mid \mathbf{w}] row reduced; a pivot in the last column means w\mathbf{w} is not in the span, and the rank of the enlarged set has gone up by one
Not in the span — the run stops with the enlarged rank and a pointer to the projection
Coordinates — the coefficients read from the reduced form, free ones set to zero, checked by multiplying VcV\mathbf{c}; the dependency vectors are listed when the coordinates are not unique
Done — the summary: dimension, basis, membership and coordinates

Sizing the Span

The frozen picture below shows VV for the default preset reduced: two pivots, rank 22. The span of (1,0,1)(1, 0, 1) and (0,1,1)(0, 1, 1) is a plane in R3\mathbb{R}^3, and the two vectors are independent.

The rank is the dimension, and independence means every column is a pivot column.
V = [v₁ … vₖ]3×2100111rref(V)3×2100100
Rank of V, frozen

v₁ = (1, 0, 1) and v₂ = (0, 1, 1) as columns, reduced to two pivots: rank 2, a plane, independent vectors. The plane is x + y = z.

Reducing VV first is not strictly needed for the membership question, but it tells you what to expect. Rank equal to the number of vectors means unique coordinates; rank less means some vectors are redundant and the reduced form names them. Rank equal to the dimension of the space means the span is everything, and any w\mathbf{w} will be in it.

The plane here can be described either way: as the span, all (c1,c2,c1+c2)(c_1, c_2, c_1 + c_2), or by the equation x+y=zx + y = z. The membership test is the bridge between the two descriptions.

The Membership Test

The frozen picture below shows [Vw][V \mid \mathbf{w}] for w=(2,3,5)\mathbf{w} = (2, 3, 5) reduced: the last row becomes all zeros, no pivot in the amber column. w\mathbf{w} is in the span.

The rank of the enlarged set is still 22; w\mathbf{w} added no new direction.
[V | w]3×3102013115rref3×3102013000
Membership test, frozen

[V | w] for w = (2, 3, 5): the last row reduces to zeros, no pivot in the amber column. w is in the plane; indeed 2 + 3 = 5.

The test is the consistency test for linear systems, applied to Vc=wV\mathbf{c} = \mathbf{w}. Row operations preserve solutions, and in the reduced form a row of the shape (0,,0b)(0, \ldots, 0 \mid b) with b0b \neq 0 is an equation 0=b0 = b with no solution; its absence means a solution exists.

Equivalently, w\mathbf{w} is in the span exactly when rank[Vw]=rankV\operatorname{rank}[V \mid \mathbf{w}] = \operatorname{rank} V. Adding a vector to a spanning set either changes nothing or raises the rank by one, and the augmented reduction shows which.

Reading the Coordinates

The frozen picture below shows the coordinates for the default preset: c=(2,3)\mathbf{c} = (2, 3), and the check Vc=2(1,0,1)+3(0,1,1)=(2,3,5)=wV\mathbf{c} = 2(1, 0, 1) + 3(0, 1, 1) = (2, 3, 5) = \mathbf{w}.

Because the vectors are independent, these are the only coordinates.
V = [v₁ … vₖ]3×2100111c23=w235
Coordinates, frozen

c = (2, 3), and V c = 2(1, 0, 1) + 3(0, 1, 1) = (2, 3, 5) = w. Unique, because the two vectors are independent.

The coordinate vector is the solution of the system, read from the reduced augmented matrix: each pivot row gives one coefficient. When the reduced form of VV is the identity on top, as here, the coefficients are simply the entries of the reduced w\mathbf{w} column.

Coordinates relative to a basis are what make a basis useful. Once {v1,v2}\{\mathbf{v}_1, \mathbf{v}_2\} is chosen for the plane, every vector in it is a pair of numbers, and the plane behaves exactly like R2\mathbb{R}^2. Changing to a different basis of the same plane is solving the same kind of system with different columns.

Not in the Span

For w=(1,1,1)\mathbf{w} = (1, 1, 1) the frozen picture below shows the reduction of [Vw][V \mid \mathbf{w}] ending with a pivot in the last column: the third row reads 0=10 = -1.

The vector is off the plane, since 1+111 + 1 \neq 1, and adding it to the set raises the rank to 33.
[V | w]3×3101011111rref3×3100010001
Not in the span, frozen

[V | w] for w = (1, 1, 1): a pivot lands in the amber column, the row 0 = −1. Off the plane, since 1 + 1 ≠ 1; the enlarged set has rank 3.

A vector outside the span cannot be written as a combination, no matter what coefficients are tried, and the failed row is the proof. The enlarged set {v1,v2,w}\{\mathbf{v}_1, \mathbf{v}_2, \mathbf{w}\} is then independent and, here, a basis of all of R3\mathbb{R}^3.

What can be done with such a w\mathbf{w} is to find the point of the span nearest to it, its orthogonal projection, which is the least-squares problem. The difference between w\mathbf{w} and its projection is perpendicular to the span and measures how far outside the vector lies.

A Dependent Spanning Set

The dependent preset adds v3=(1,2,1)\mathbf{v}_3 = (1, 2, 1) to the plane's two vectors. The frozen picture below shows VV reduced: still rank 22, with the third column free and the relation v3=v1+v2\mathbf{v}_3 = \mathbf{v}_1 + \mathbf{v}_2 read from its entries.

The span has not grown, and the coordinates of any vector in it are no longer unique.
V = [v₁ … vₖ]3×3101112011rref(V)3×3101011000
A dependent set, frozen

With v₃ = (1, 2, 1) added, V still has rank 2; the third column is free and reads v₃ = v₁ + v₂. The span is the same plane, and coordinates are no longer unique.

A free column in the reduced form of VV is a vector that the pivot vectors already produce, and its column of the reduced form lists the coefficients. Dropping every such vector leaves a basis of the same span; keeping them costs uniqueness, since any dependency can be added to a coordinate vector without changing the combination.

For w=(2,3,1)\mathbf{w} = (2, 3, 1) the tool reports 2v1+v22\mathbf{v}_1 + \mathbf{v}_2 with the free coefficient set to zero, and notes that adding multiples of (1,1,1)(-1, -1, 1), the dependency, gives the others.

Reading the Scene Player

Each scene shows the matrices for one step with the reasoning in the caption.

• Each spanning vector keeps its own colour as a column of VV and as an entry of the coefficient vector c\mathbf{c}
w\mathbf{w} is amber throughout, in the matrices and in the input grid
• In the reduced form of VV the pivots are accent and the free columns muted, since those columns are the dependent vectors
• In the reduced form of [Vw][V \mid \mathbf{w}] a pivot in the last column is muted: it is the mark of inconsistency
• The check VcV\mathbf{c} is drawn as the target, matching w\mathbf{w}
• Coefficients come out as fractions when they are not integers

Choosing a Problem

The seven presets each make a different point.

In a planev1=(1,0,1)\mathbf{v}_1 = (1, 0, 1), v2=(0,1,1)\mathbf{v}_2 = (0, 1, 1) and w=(2,3,5)=2v1+3v2\mathbf{w} = (2, 3, 5) = 2\mathbf{v}_1 + 3\mathbf{v}_2; unique coordinates (2,3)(2, 3)
Off the plane — the same vectors and w=(1,1,1)\mathbf{w} = (1, 1, 1), which does not satisfy the plane's equation x+y=zx + y = z
On a line — a single vector and a multiple of it; the span is a line and the coordinate is the multiple
Dependent setv3=v1+v2\mathbf{v}_3 = \mathbf{v}_1 + \mathbf{v}_2; the span is still a plane, and w\mathbf{w} has infinitely many coordinate vectors
A basis of R3\mathbb{R}^3 — three independent vectors; every w\mathbf{w} is in the span, with unique coordinates
A plane in R4\mathbb{R}^4 — two vectors in four dimensions; the same test in a space that cannot be drawn
w=0\mathbf{w} = \mathbf{0} — always in the span, with all coefficients zero

Shuffle picks random small-integer vectors and, most of the time, a w\mathbf{w} built as a combination of them.

What Span and Membership Mean

The span of v1,,vk\mathbf{v}_1, \ldots, \mathbf{v}_k is the set of every vector that can be built from them by scaling and adding:

span{v1,,vk}={c1v1++ckvk}\operatorname{span}\{\mathbf{v}_1, \ldots, \mathbf{v}_k\} = \{c_1\mathbf{v}_1 + \cdots + c_k\mathbf{v}_k\}


It is a subspace, a line, a plane, or more, through the origin, and it is the column space of the matrix VV whose columns are the vi\mathbf{v}_i, because VcV\mathbf{c} is exactly the combination with coefficients c\mathbf{c}.

That identification turns every question about the span into a question about a linear system. A vector w\mathbf{w} is in the span if and only if Vc=wV\mathbf{c} = \mathbf{w} has a solution, which row reduction of [Vw][V \mid \mathbf{w}] decides: consistent means in, a pivot in the last column means out. When it is in, the solution c\mathbf{c} lists the coefficients, and if the vi\mathbf{v}_i are independent there is exactly one such c\mathbf{c}, the coordinate vector of w\mathbf{w} relative to the basis {vi}\{\mathbf{v}_i\}.

The size of the span is the rank of VV. If the rank is kk, the vectors are independent and form a basis of their span. If the rank is less, some columns are free, and the reduced form shows each free vector as a combination of the pivot vectors; those pivot vectors alone are a basis, and the coordinates of any w\mathbf{w} are unique only after the dependent vectors are dropped.

The whole subject of bases, dimension and coordinates is contained in this one computation. For the theory, see the span page, the linear independence page and the basis page.

Key Properties

Facts about spans and membership.

Span is a subspace: closed under addition and scaling, and it always contains 0\mathbf{0}
Span equals column space: span{vi}=C(V)\operatorname{span}\{\mathbf{v}_i\} = C(V), so membership is consistency of Vc=wV\mathbf{c} = \mathbf{w}
Dimension equals rank: the number of pivot columns of VV
Independence means rank kk; then coordinates are unique and the vi\mathbf{v}_i are a basis of the span
Dependence shows up as free columns; each gives a relation among the vectors, and the coordinates of any w\mathbf{w} form a whole family differing by null-space vectors of VV
Adding a vector to the set either leaves the span unchanged, when the vector was already in it, or raises the dimension by one
kk vectors in Rn\mathbb{R}^n with k>nk > n are always dependent; with k<nk < n they never span Rn\mathbb{R}^n; a basis needs exactly nn
Removing dependent vectors does not shrink the span
Every subspace is the span of some finite set, and every spanning set contains a basis

Why It Matters

Membership in a span is the basic decision problem of linear algebra.

Solvability: Ax=bA\mathbf{x} = \mathbf{b} is solvable exactly when b\mathbf{b} is in the span of the columns of AA
Coordinates and change of basis: expressing a vector in a new basis is solving Vc=wV\mathbf{c} = \mathbf{w} with the basis vectors as columns
Reachability: in control theory, whether a state can be reached is whether it lies in the span of the controllability directions
Signal representation: whether a signal can be built from a dictionary of basis functions, and with what coefficients
Dimension counting: the rank test tells how many of a set of measurements, features or constraints are genuinely different
Geometry: a point lies on a plane through the origin exactly when its position vector is in the plane's span
Foundations: the definitions of basis, dimension, subspace and linear map all rest on span and independence

Worked Example

Take the default preset: v1=(1,0,1)\mathbf{v}_1 = (1, 0, 1), v2=(0,1,1)\mathbf{v}_2 = (0, 1, 1) and w=(2,3,5)\mathbf{w} = (2, 3, 5).

Rank. V=(100111)V = \begin{pmatrix} 1 & 0 \\ 0 & 1 \\ 1 & 1 \end{pmatrix} reduces to (100100)\begin{pmatrix} 1 & 0 \\ 0 & 1 \\ 0 & 0 \end{pmatrix}: rank 22. The span is a plane in R3\mathbb{R}^3, the vectors are independent, and they form a basis of it. The plane is x+y=zx + y = z, since (c1,c2,c1+c2)(c_1, c_2, c_1 + c_2) is the general combination.

Membership. [Vw]=(102013115)[V \mid \mathbf{w}] = \begin{pmatrix} 1 & 0 & 2 \\ 0 & 1 & 3 \\ 1 & 1 & 5 \end{pmatrix}; subtracting the first two rows from the third gives (0,0,0)(0, 0, 0), so the reduced form is (102013000)\begin{pmatrix} 1 & 0 & 2 \\ 0 & 1 & 3 \\ 0 & 0 & 0 \end{pmatrix} with no pivot in the last column. Consistent: w\mathbf{w} is in the plane, as 2+3=52 + 3 = 5 confirms.

Coordinates. c1=2c_1 = 2, c2=3c_2 = 3: w=2v1+3v2=(2,0,2)+(0,3,3)=(2,3,5)\mathbf{w} = 2\mathbf{v}_1 + 3\mathbf{v}_2 = (2, 0, 2) + (0, 3, 3) = (2, 3, 5). Unique, because the vectors are independent.

Contrast. For w=(1,1,1)\mathbf{w} = (1, 1, 1) the third row of the reduction becomes (0,0,1)(0, 0, -1), a pivot in the last column: 1+111 + 1 \neq 1, the vector is off the plane, and adding it to the set raises the rank to 33.

Dependent set. With v3=(1,2,1)=v1+v2\mathbf{v}_3 = (1, 2, 1) = \mathbf{v}_1 + \mathbf{v}_2 added, VV reduces to (101011000)\begin{pmatrix} 1 & 0 & 1 \\ 0 & 1 & 1 \\ 0 & 0 & 0 \end{pmatrix}: still rank 22, third column free, and the relation v3=v1+v2\mathbf{v}_3 = \mathbf{v}_1 + \mathbf{v}_2 is read from it. Then w=(2,3,1)=2v1+v2\mathbf{w} = (2, 3, 1) = 2\mathbf{v}_1 + \mathbf{v}_2, but also v1+v3\mathbf{v}_1 + \mathbf{v}_3, and (2,1,0)+t(1,1,1)(2, 1, 0) + t(-1, -1, 1) for any tt.

Common Mistakes

A few mistakes recur.

Putting the vectors in as rows — membership of w\mathbf{w} needs the vectors as columns of VV, so that VcV\mathbf{c} is a combination of them; rows would test something else
Judging membership by eye — a vector can look "similar" to the spanning vectors and still be outside the span; only the reduction decides
Forgetting the zero vector0\mathbf{0} is in every span, with all coefficients zero; a set that does not contain 0\mathbf{0} is not a subspace
Reading coordinates from a dependent set as unique — with free columns there are infinitely many coefficient vectors; the tool sets the free ones to zero and says so
Confusing span with the set of vectors — the span of two vectors in R3\mathbb{R}^3 is a whole plane, not two arrows
Assuming kk vectors span a kk-dimensional space — only if they are independent; the dimension is the rank
Expecting three vectors in R3\mathbb{R}^3 to be a basis — they might be dependent; the rank must be 33