BOLD IT ALL OUT!
In many machine learning algorithms, we need to represent feature vectors as a linear combination of the set of linearly independent vectors or orthogonal vectors. These vectors form a basis for the feature space. More relevance in dimensional reduction and dictionary learning algorithms.
Basis
Let be a vector space. Then a basis for is a set of linearly independent vectors in which span the vector space .
- the space is finite dimensional if it has finite basis
- a vector in basis is called a basis vector
is a basis of an n-dimensional vector space if:
- is linearly independent
- for any vector we have
Note that the zero vector can NOT be a basis vector because then the second condition would be trivial.
examples:
- if then forms the basis as we can take an arbitrary vector . Thus we can see that the basis is linearly independent (you can also check via the Gaussian elimination method, it’s trivial here), and also we can represent any vector in using the vectors in the basis. Hence we can say that it “spans” the vector space .
- now when the basis is
- generally, when , basis is
- , then forms a vector space. Here the basis would be
- forms a vector space . Here the basis would be
Dimension
The number of vectors in the basis of is called the dimension of the vector space .
We can have multiple bases for a vector space, but each would have the same number of vectors, that is the dimension.
examples:
- the dimension of the vector space is 2
- the dimension of the vector space is n
- the dimension of the vector space is m x n
- dimension of the vector space is n+1
- dimension of vector space is , where is the set of all polynomials with coefficients from .
some results:
- If be a basis of a given vector space and be a subset of vectors having more than n vectors, then is linearly dependent. It’s because if is the basis, it spans the entire vector space and every single vector in a subset can be built using a linear combination of the n vectors in .
- If is a linearly independent subset of an n-dimensional vector space where k < n, then can be extended to a basis of . This one is also simple when you think about how there can be multiple bases for a single vector space, and how all of them would have the same number of vectors.
- If is a finite dimensional vector space (finite basis), then any two bases of have the same number of vectors, the dimension. Ex. in we have and
- If is a finite dimensional vector space, and and are two subspaces of , then
example:
-
find the basis and dimension for , where is a subspace of .
- and thus
- now and hence .
-
find the basis and dimension for where is a subspace of
- which is and hence
-
find the basis and dimension for
- we have
- where we can’t have a basis like since all three are equal. Therefore the only valid element is which can NOT be a basis element (see the basis section).
- as there are no elements in the basis.
Trick (sort of): when you are trying to find the basis vector and you have an equation like just do where the letters inside brackets are nothing but the appearance of the attached letter; ex. in , appears 1, 2, and 0 times respectively. Similarly appears 0, 0, 0 times and z appears 0, 3, 1 times.