23.2: The Basis of a Vector Space
- Page ID
- 68051
Let \(U\) be a vector space with basis \(B=\{u_1, \ldots, u_n\}\), and let \(u\) be a vector in \(U\). Because a basis “spans” the vector space, we know that there exists scalars \(a_1, \ldots, a_n\) such that:
\[ u = a_1u_1 + \dots + a_nu_n \nonumber \]
Since a basis is a linearly independent set of vectors we know the scalars \(a_1, \ldots, a_n\) are unique.
The values \(a_1, \ldots, a_n\) are called the coordinates of \(u\) relative to the basis (\(B\)) and is typically written as a column vector:
\[\begin{split} u_B =
\left[
\begin{matrix}
a_1 \\
\vdots \\
a_n
\end{matrix}
\right]
\end{split} \nonumber \]
We can create a transition matrix \(P\) using the inverse of the matrix with the basis vectors being columns.
\[P = [ u_1 \ldots u_n ]^{-1} \nonumber \]
Now we will show that matrix \(P\) will transition vector \(u\) in the standard coordinate system to the coordinates relative to the basis \(B\):
\[ u_B = Pu \nonumber \]
EXAMPLE: Consider the vector \(u = \left[ \begin{matrix} 5 \\ 3 \end{matrix} \right]\) and the basis vectors \(B=\{(1,2),(3,−1)\}\). The following code calculates the \(P\) transition matrix from \(B\) and then uses \(P\) to calculate the values of \(u_B\) (\(a_1\) and \(a_2\)):
Here we would like to view this from \(R^n\). Let \(B = [u_1 \ldots u_n]\), then the values of \(u_B\) can be found by solving the linear system \(u = Bu_{b}\). The columns of \(B\) are a basis, therefore, the matrix \(B\) is an \(n \times n\) square matrix and it has an inverse. Therefore, we can solve the linear system and obtain \(u_B = B^{-1}u = Pu\).
Let’s try to visualize this with a plot:
Notice that the blue arrow represents the first basis vector and the green arrow is the second basis vector in \(B\). The solution to \(u_B\) shows 2 units along the blue vector and 1 units along the green vector, which puts us at the point (5,3).
This is also called a change in coordinate systems.
What is the coordinate vector of \(u\) relative to the given basis \(B\) in \(R^3\)?
\[u = (9,-3,21) \nonumber \]
\[B = \{(2,0,-1), (0,1,3), (1,1,1)\} \nonumber \]
Store this coordinate in a variable ub
for checking:
Let’s look more closely into the matrix \(P\), what is the meaning of the columns of the matrix \(P\)?
We know that \(P\) is the inverse of \(B\), therefore, we have \(BP = I\). Then we can look at the first column of the \(P\), say \(p_{1}\), we have that \(Bp_{1}\) is the column vector \((1,0,0)\), which is exactly the first component from the standard basis. This is true for other columns.
It means that if we want to change an old basis \(B\) to a new basis \(B′\), we need to find out all the coordinates in the new basis for the old basis, and the transition matrix is by putting all the coordinates as columns.
Here is the matrix \(B\) again:
The first column of P should be the solution to \(Bx=\left[ \begin{matrix} 1 \\ 0 \\ 0 \end{matrix} \right]\). We can use the numpy.linalg.solve
function to find this solution:
We can find a similar answer for columns \(p_2\) and \(p_3\):
This should be basically the same answer as you got above.