Basis Calculator

Find a basis for a set of vectors using matrix row reduction. Enter your vectors to identify the independent vectors, calculate the dimension of their span, and see the reduced row-echelon form used to obtain the result.

The calculator selects basis vectors from your original input. You can also enter a target vector to check whether it belongs to the span and find one linear combination that represents it.

Enter your vectors

Enter one vector per line. All vectors must have the same number of components.

Example: (1, 2, 3). Separate components with commas, spaces, or semicolons. Fractions and scientific notation are accepted.
Check whether this vector belongs to the span of the input vectors. Leave blank to skip this test.

What is a basis in linear algebra?

A basis is a set of vectors that satisfies two conditions: the vectors are linearly independent, and they span the vector space or subspace being considered.

Linear independence means that no vector in the set can be expressed as a linear combination of the other vectors. Spanning means that every vector in the space can be expressed as a linear combination of the basis vectors.

A basis must be:
1. Linearly independent
2. Spanning the required vector space

A basis is a minimal generating set: removing any vector from it means that the remaining vectors no longer span the same space.

How to find a basis using matrix row reduction

Suppose you are given vectors v₁, v₂, ..., vₖ. Place them as columns of a matrix A. Then reduce A to reduced row-echelon form.

  1. Enter each vector as one column of a matrix.
  2. Apply elementary row operations to reduce the matrix.
  3. Identify the pivot columns in the reduced matrix.
  4. Return to the original matrix and select the same column positions.
  5. The selected original vectors form a basis for the span.
Important:
Use the pivot-column positions from RREF, but take the basis vectors from the original matrix.

Row operations preserve the relationships needed to determine the pivot positions, but the columns of the RREF are generally not the original vectors. Selecting original columns ensures that the resulting basis is made from the supplied vectors.

Example 1: Finding a basis from three vectors in R³

Consider the following vectors:

v₁ = (1, 0, 0)
v₂ = (0, 1, 0)
v₃ = (1, 1, 0)

The third vector is the sum of the first two:

v₃ = v₁ + v₂

Therefore, the three vectors are linearly dependent. The third vector does not contribute a new direction. A basis is:

Basis = {(1, 0, 0), (0, 1, 0)}

The dimension of their span is 2. They generate the xy-plane in R³.

Example 2: The standard basis of R³

The standard basis vectors are:

e₁ = (1, 0, 0)
e₂ = (0, 1, 0)
e₃ = (0, 0, 1)

These three vectors are linearly independent and span all of R³. They form a basis for R³, and the dimension of the space is 3.

Example 3: A basis from dependent vectors

Consider these vectors in R²:

v₁ = (1, 2)
v₂ = (2, 4)
v₃ = (3, 6)

The second vector is twice the first, and the third is three times the first. All three vectors lie on the same line through the origin.

v₂ = 2v₁
v₃ = 3v₁

A basis for their span contains only one vector:

Basis = {(1, 2)}

The dimension of the span is 1.

Basis, span, rank, and dimension

Basis

A basis is a linearly independent set that generates the entire space or subspace. It contains exactly as many vectors as the dimension of that space.

Span

The span is the set of all possible linear combinations of the input vectors. A basis is one way of representing that span without redundant vectors.

Rank

The rank of a matrix is the number of pivot columns. When vectors are arranged as columns, their matrix rank equals the dimension of their span.

Dimension

The dimension is the number of vectors in a basis. Every basis of the same finite-dimensional vector space has the same number of vectors.

Frequently asked questions

1. What is a basis in linear algebra?

A basis is a set of linearly independent vectors that spans a vector space or subspace. Every vector in that space can be written as a linear combination of the basis vectors.

2. How do I find a basis from a set of vectors?

Arrange the vectors as columns of a matrix and reduce it to row-echelon form. Find the pivot columns, then select those same columns from the original matrix. They form a basis for the span.

3. What is the difference between a basis and a span?

The span is the collection of all linear combinations of a set of vectors. A basis is a linearly independent set that generates that collection.

4. Can a basis contain the zero vector?

No. Any set containing the zero vector is linearly dependent, so it cannot be a basis.

5. How many vectors are in a basis?

A basis has exactly as many vectors as the dimension of the space. For example, every basis of R³ contains three vectors.

6. Can a set with four vectors form a basis for R³?

No. Four vectors in R³ must be linearly dependent. A basis for R³ has exactly three linearly independent vectors.

7. Are basis vectors unique?

No. A vector space can have many different bases. However, all bases of the same finite-dimensional space contain the same number of vectors.

8. Does this calculator select vectors from my original input?

Yes. It identifies pivot-column positions through row reduction and selects the corresponding original input vectors. This produces a basis using vectors from your supplied set.

9. What if all input vectors are zero?

Their span contains only the zero vector and has dimension zero. The basis is the empty set because no nonzero independent vectors are available.

10. How do I check whether a vector belongs to the span?

Solve the equation A c = b, where A contains the input vectors as columns and b is the target vector. If the system is consistent, the target belongs to the span. You can use the optional target-vector field above.

Related matrix and vector calculators