Skip to main content

Worksheet 1.5 Worksheet: working with span

In this worksheet, we will attempt to understand the concept of span. Recall from Section 1.4 that the span of a set of vectors \(\vv_1, \vv_2,\ldots, \vv_k\) in a vector space \(V\) is the set of all linear combinations that can be generated from those vectors.
Recall the following fact: given a matrix \(A\) and vector \(\xx\text{,}\) \(A\xx\) is a linear combination of the columns of \(A\text{.}\)
In particular, if we write \(A\) in terms of its columns as \(A = \bbm \vv_1 \amp \vv_2 \amp \cdots \amp \vv_n\ebm\) then
\begin{equation*} A\xx = x_1\vv_1+x_2\vv_2+\cdots + x_n\vv_n\text{,} \end{equation*}
where \(x_1,x_2,\ldots, x_n\) are the components of \(\xx\text{.}\)
Let’s confirm this for the matrix \(A = \bbm 2\amp 3\amp -5\amp 6\\-7\amp 20\amp -11\amp 6\\43 \amp -6\amp 31\amp 2\ebm\) and vector \(\xx = \bbm 7\\-9\\3\\14\ebm\text{.}\)
Input the matrix and vector in the cell below.
See Section B.3 for details on how to enter your matrix and vector, and how to compute the following.
Next, compute \(A\xx\text{:}\)
Finally, compute the corresponding linear combination of the columns of \(A\text{,}\) and confirm that you get the same answer.
The question “Does the vector \(\ww\) belong to the span of \(\vv_1, \vv_2,\ldots, \vv_k\text{?}\)” is equivalent to asking, “Can I write \(\ww\) as a linear combination of the \(\vv_i\text{?}\)” This, in turn, is equivalent to asking:
Do there exist scalars \(x_1,x_2,\ldots, x_k\) such that
\begin{equation*} \ww=x_1\vv_1+x_2\vv_2+\cdots +x_k\vv_k\text{?} \end{equation*}
If the above vectors are vectors in \(\R^n\text{,}\) then we just saw that the right-hand side of the above equation is \(A\xx\text{,}\) where \(\vv_1,\vv_2,\ldots, \vv_k\) are the columns of \(A\text{.}\) So the question of whether \(\ww\) is in the span of the \(\vv_i\) is equivalent to determining whether the equation \(A\xx=\ww\) has a solution.

1.

Determine whether or not the vector \(\ww=\langle 3,-1, 4, 2\rangle\) in \(\R^4\) belongs to the span of the vectors
\begin{equation*} \langle 2, 1, 4, -3\rangle, \langle 0, 2, 1, 4\rangle, \langle -1, 1, 0, 2\rangle\text{.} \end{equation*}
To assist with solving this problem, a code cell is provided below. Once you have determined the augmented matrix of your system of equations, enter the matrix, and then compute its reduced row-echelon form.
(Do you recall how to tell if a system has a solution from the RREF?)
If our vector space is not \(\R^n\text{,}\) we can still apply the above technique, but we first have to turn our span equation into a system of linear equations.

2.

Determine whether or not the polynomial \(q(x) = 4-6x-11x^2\) belongs to the span of the polynomials
\begin{equation*} p_1(x) = x-3x^2, p_2(x)=2-x, p_3(x) = -1+4x+x^2\text{.} \end{equation*}

3.

Determine whether or not the matrix \(B = \bbm 4\amp -1 \amp 7\\-5\amp 6\amp 2\ebm\) belongs to the span of the matrices
\begin{equation*} A_1 = \bbm 1\amp 2\amp 0\\-3\amp 2\amp 4\ebm, A_2 = \bbm 3\amp 2\amp -7\\0\amp 1\amp 3\ebm, A_3 = \bbm 0\amp 1\amp 3\\2\amp 0\amp -4\ebm, A_4 = \bbm -1\amp 1\amp 3\\2\amp 0\amp 1\ebm\text{.} \end{equation*}
The above problems all answer the same basic question: given a particular vector \(\ww\text{,}\) is it in the span of given vectors \(\vv_1,\vv_2,\ldots,\vv_k\text{?}\)
A more interesting problem is the following: iven the vectors \(\vv_1,\vv_2,\ldots, \vv_k\text{,}\) what are all the vectors in their span? That is, how can we describe the span of a set of vectors more directly?
We can answer this question as follows: let \(\ww\) be an arbitrary vector in \(V\text{,}\) and write it in terms of its (unknown) coefficients. For example, in question 1 above, we might let \(\ww = \langle a, b, c, d\rangle\text{.}\)

4.

For each problem above, define symbolic variables using the symobols command. For example, you can enter
a, b, c = symbols('a b c')
to create three undetermined symbols.
Then replace the last column in each augmeted matrix from the previous problems with a column of symbols, and instead of using the rref() command, use the echelon_form() command to reduce the matrix.
By looking at the reduced form of hte matrix, determine a relationship (or relationships) between the variables that must hold for the system to be consistent. You can then use this to define the set of vectors in the span.