Search Knowledge

© 2026 LIBREUNI PROJECT

Linear Algebra / Overview

Basis and Dimension

Basis and Dimension

The concepts of basis and dimension provide a way to “measure” the size and complexity of a vector space.

Linear Independence and Spanning

A set of vectors {v1,,vn}\{\mathbf{v}_1, \dots, \mathbf{v}_n\} is linearly independent if the only solution to c1v1++cnvn=0c_1\mathbf{v}_1 + \dots + c_n\mathbf{v}_n = \mathbf{0} is ci=0c_i = 0 for all ii. The span of a set is the set of all possible linear combinations.

python
1import numpy as np
2 
3def check_linear_independence(vectors):
4 matrix = np.array(vectors).T
5 rank = np.linalg.matrix_rank(matrix)
6 is_independent = rank == len(vectors)
7 return is_independent, rank
8 
9# Test linearly independent vectors
10v1 = [1, 0, 0]
11v2 = [0, 1, 0]
12print(f"Independent: {check_linear_independence([v1, v2])}")
13 
14# Test linearly dependent vectors
15v3 = [1, 1, 0]
16print(f"Independent with v3: {check_linear_independence([v1, v2, v3])}")

Definition of a Basis

A basis BB for a vector space VV is a set of vectors that:

  1. Is linearly independent.
  2. Spans VV.

How many vectors are in any basis of R^3?

Dimension

The dimension of a vector space VV, denoted dim(V)\dim(V), is the number of vectors in any basis for VV.

python
1import numpy as np
2 
3def get_dimension(matrix):
4 # The dimension of the column space is the rank
5 return np.linalg.matrix_rank(matrix)
6 
7A = [[1, 2, 3], [4, 5, 6], [7, 8, 9]]
8print(f"Rank (Dimension of Col Space) of A: {get_dimension(A)}")
9print("A rank of 2 means the vectors are coplanar in R^3.")

If a subspace of R^5 has dimension 0, what is in the subspace?

Next Module Canonical Forms