Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place. Commercial Alternative to JupyterHub.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place. Commercial Alternative to JupyterHub.
Path: blob/master/notebooks/Chapter 8 - Vector Space and Subspace.ipynb
Views: 449
Vector Space
A vector space, as its name indicates, is the space for vectors, which defines two operations, addition and multiplication by scalars, subject to axioms below.
The sum of and , denoted by is in
There is a zero vector in such that
For each in , there is a vector in such that
The scalar multiple of by denoted by is in
Though axioms seem quite apparent and superfluous, simply remember this: addition and multiplication are closed in vector space.
All axioms are self-explanatory without proof, we can visualize axiom with visualization.
Try different vectors.
However the vector space has more general meaning than containing vectors, the functions and polynomials can also be in the vector space as we have show in the section of linear dependence.
The difference is that the functions has infinite number of elements (continuous functions) in contrast to vectors.
We can demonstrate in the vector space for functions by plotting two trigonometric functions: and (stem plot), their addition in vector space is the pink shaded plot.
So we can say that is in the same vector space of and .
Subspace
A subspace is one of the most important concept in linear algebra.
A subspace resides in a vector space , we can denoted it as . Only two properties needs to be demonstrated:
has zero vector.
Closed under vector addition and scalar multiplication.
To help you understand subspace:
Any line passes through in is a subspace of .
Any plane passes through in is a subspace of .
Next we will visualize the subspace.
Visualization of Subspace of
Visualization of Subspace of
Consider a span of two vectors and . The span of is a subspace of , where and are the scalars of the vectors.
We also plot a plan which is not a subspace by adding onto the third equation, i.e. .
Remember matplotlib does not have 3D engine, we have to pan to a proper angle to show the layout.
As you can see the plane contains is a subspace, but the other plane is not.
Span
We have mentioned span quite a few times before; now we provide a formal definition of a span. Use to denote the span of a subset , which is a linear combination in vector space .
The span of two vectors in is a plane which is also a subspace of , and any two vectors span a plane. For example, given two vectors and , any linear combination is a span, i.e., .
For a more general span, a basic fact of matrix multiplication can assist us in demonstrating:
where is the spanning set of vectors, and is a vector of weights for the linear combination. We can generate a random matrix to form various linear combinations to visually verify if they are all contained in the spanned plane.
We define:
Pan around the plot, we confirm that all the vectors are in the .
Span of
Reproduce the code above, but we have three vectors: , , . Again we create a random coefficent matrix to form different linear combinations.
The vectors are pointing every possible directions in , and all of them bounded in the span of those three vectors.