# Test vectors for linear independence

Checks whether vectors are linearly independent by the rank of the matrix with the vectors as columns, in exact fractions, and gives a dependence relation when they are not.

- Page: https://www.acalculator.org/math/linear-independence-calculator
- JSON spec: https://www.acalculator.org/math/linear-independence-calculator.json
- Version: 964ab03a3e98

## Default answer

Example with the default inputs (Vectors (one per row) [1, 2, 3; 4, 5, 6; 7, 8, 9]): Linearly dependent (rank 2 < 3 vectors).

## Inputs

| Key | Label | Description |
| --- | --- | --- |
| v | Vectors (one per row) | The vectors v₁, v₂, …, one per row: 1 to 10 vectors with 1 to 10 entries each. |

## Outputs

| Key | Label | Description |
| --- | --- | --- |
| result | Independent or dependent | Whether the vectors are linearly independent, with the rank and the number of vectors. |
| relation | Dependence relation | For dependent vectors: the first vector that is a combination of the vectors before it. |
| rank | Rank | The number of pivots: how many of the vectors are independent. |
| count | Number of vectors | How many vectors you typed. |
| pivots | Independent vectors | The vectors whose columns hold a pivot: they are independent and span the same space as all the vectors. |
| rref | RREF of the matrix [v₁ v₂ …] | The reduced row echelon form of the matrix with the vectors as columns, rows separated by semicolons. |

## Method

Put the vectors in the columns of a matrix and reduce it to RREF. They are independent exactly when every column has a pivot (rank = number of vectors). Otherwise the first column without a pivot, j, gives v_j = Σ R[row][j] × v_p over the earlier pivot columns p.

## Assumptions

- Every entry is read as an exact fraction: a decimal such as 0.1 is 1/10, so there is no rounding.
- There are 1 to 10 vectors, all with the same number of entries, from 1 to 10.

## Worked examples

1. v = 1 or 2 or 4 or 5 gives result = Linearly dependent (rank 2 < 3 vectors), relation = v₃ = −v₁ + 2v₂, rank = 2, pivots = v₁, v₂. Source: Dan Margalit and Joseph Rabinoff, Interactive Linear Algebra (Georgia Institute of Technology), §2.5 Linear Independence (a set is linearly independent when x₁v₁ + … + x_kv_k = 0 has only the trivial solution; this holds exactly when the matrix with the vectors as columns has a pivot in every column; a wide matrix has dependent columns; a nonzero solution of Ax = 0 gives a dependence relation), https://textbooks.math.gatech.edu/ila/linear-independence.html (retrieved 2026-10-19); MIT OpenCourseWare 18.06 Linear Algebra (Gilbert Strang), Lecture 7: Solving Ax = 0: pivot variables, special solutions (counting the pivots gives the rank), https://ocw.mit.edu/courses/18-06-linear-algebra-spring-2010/resources/lecture-7-solving-ax-0-pivot-variables-special-solutions/ (retrieved 2026-10-19).
2. v = 1 or 0 or 1 or 1 gives result = Linearly independent (rank 3 = 3 vectors), rank = 3, rref = [1, 0, 0; 0, 1, 0; 0, 0, 1]. Source: Dan Margalit and Joseph Rabinoff, Interactive Linear Algebra (Georgia Institute of Technology), §2.5 Linear Independence (a set is linearly independent when x₁v₁ + … + x_kv_k = 0 has only the trivial solution; this holds exactly when the matrix with the vectors as columns has a pivot in every column; a wide matrix has dependent columns; a nonzero solution of Ax = 0 gives a dependence relation), https://textbooks.math.gatech.edu/ila/linear-independence.html (retrieved 2026-10-19).
3. v = 1 or 2 or 3 or 4 gives result = Linearly dependent (rank 2 < 3 vectors), relation = v₃ = −v₁ + 2v₂. Source: Dan Margalit and Joseph Rabinoff, Interactive Linear Algebra (Georgia Institute of Technology), §2.5 Linear Independence (a set is linearly independent when x₁v₁ + … + x_kv_k = 0 has only the trivial solution; this holds exactly when the matrix with the vectors as columns has a pivot in every column; a wide matrix has dependent columns; a nonzero solution of Ax = 0 gives a dependence relation), https://textbooks.math.gatech.edu/ila/linear-independence.html (retrieved 2026-10-19).
4. v = 2 or 4 or 1 or 2 gives result = Linearly dependent (rank 1 < 2 vectors), relation = v₂ = (1/2)v₁. Source: Dan Margalit and Joseph Rabinoff, Interactive Linear Algebra (Georgia Institute of Technology), §2.5 Linear Independence (a set is linearly independent when x₁v₁ + … + x_kv_k = 0 has only the trivial solution; this holds exactly when the matrix with the vectors as columns has a pivot in every column; a wide matrix has dependent columns; a nonzero solution of Ax = 0 gives a dependence relation), https://textbooks.math.gatech.edu/ila/linear-independence.html (retrieved 2026-10-19).
5. v = 1 or 2 or 0 or 0 gives result = Linearly dependent (rank 1 < 2 vectors), relation = v₂ = 0. Source: Dan Margalit and Joseph Rabinoff, Interactive Linear Algebra (Georgia Institute of Technology), §2.5 Linear Independence (a set is linearly independent when x₁v₁ + … + x_kv_k = 0 has only the trivial solution; this holds exactly when the matrix with the vectors as columns has a pivot in every column; a wide matrix has dependent columns; a nonzero solution of Ax = 0 gives a dependence relation), https://textbooks.math.gatech.edu/ila/linear-independence.html (retrieved 2026-10-19).
6. v = 3 or -1 or undefined gives result = Linearly independent (rank 1 = 1 vector). Source: Dan Margalit and Joseph Rabinoff, Interactive Linear Algebra (Georgia Institute of Technology), §2.5 Linear Independence (a set is linearly independent when x₁v₁ + … + x_kv_k = 0 has only the trivial solution; this holds exactly when the matrix with the vectors as columns has a pivot in every column; a wide matrix has dependent columns; a nonzero solution of Ax = 0 gives a dependence relation), https://textbooks.math.gatech.edu/ila/linear-independence.html (retrieved 2026-10-19).

## FAQ

### How do you check if vectors are linearly independent?

Put them in the columns of a matrix and row reduce it. The vectors are linearly independent exactly when every column has a pivot, that is when the rank equals the number of vectors (Interactive Linear Algebra §2.5).

### What does linearly dependent mean?

At least one vector is a combination of the others: some weights, not all 0, give x₁v₁ + x₂v₂ + … = 0. For [1, 2, 3], [4, 5, 6] and [7, 8, 9], [7, 8, 9] = −[1, 2, 3] + 2 × [4, 5, 6].

### Can 4 vectors in R³ be linearly independent?

No. A matrix with more columns than rows cannot have a pivot in every column, so more vectors than entries are always dependent. Three vectors in the plane are dependent for the same reason.

### Is a set with the zero vector independent?

No. The zero vector is 0 times any other vector, so a set that holds it is always dependent. The page shows the relation as v_j = 0.

### How do I find the relation between dependent vectors?

In the RREF, the first column without a pivot belongs to a vector that is a combination of the earlier pivot vectors, and that column holds the weights. The page writes it as v_j = a v_p + b v_q + ….

### What is the difference between rank and linear independence?

The rank is how many of the vectors are independent: the number of pivots. The vectors are independent when the rank equals their number; the pivot vectors are a largest independent set among them.

## Sources

- Dan Margalit and Joseph Rabinoff, Interactive Linear Algebra (Georgia Institute of Technology), §2.5 Linear Independence: a set of vectors is linearly independent when x₁v₁ + … + x_kv_k = 0 has only the trivial solution; this holds exactly when the matrix with those columns has a pivot in every column; a wide matrix has linearly dependent columns; solving Ax = 0 with nonzero free variables gives a linear dependence relation, retrieved 2026-10-19. https://textbooks.math.gatech.edu/ila/linear-independence.html
- MIT OpenCourseWare 18.06 Linear Algebra (Gilbert Strang), Lecture 7: Solving Ax = 0: pivot variables, special solutions (counting the pivots gives the rank), retrieved 2026-10-19. https://ocw.mit.edu/courses/18-06-linear-algebra-spring-2010/resources/lecture-7-solving-ax-0-pivot-variables-special-solutions/
