[Math] Checking whether a vector is in the span of a set of vectors

linear algebramatricesvector-spaces

Suppose we have a set of vectors $S = \{u,v,w\}$ in $\mathbb{R}^3$. We want to find if some vector $x$ is in the span of $S$. From what I understand, for $x$ to be in the span of $S$, we need to come up with some linear combination of $c_1u + c_2v + c_3w = v$. This can be checked with RREF and seeing if we have some solution for $c_1$, $c_2$, $c_3$.

I also know that if $u$, $v$, $w$ are nonparallel lines, then any vector in $\mathbb{R}^3$ is a linear combination of the vectors in the set of $S$. Would it then be enough to simply check that $u$, $v$, $w$ are not multiples of each other and hence are nonparallel lines to see if $v$ is in the span of $S$? (Whether that's easier to harder than simply doing the RREF is another matter).

EDIT:

suppose $S=\{[1;0;1],[-1,1,1],[1,1,3]\}$
If we want to find whether $x=[0;5;2]$ is in the span of $S$ we can calculate the $RREF.$ The $RREF$ shows that $x$ is not in the span of $S$ as there are no solutions.

However we saw that the vectors in $S$ are nonparallel and so as previously said shouldn't $x$ be in the span of $S?$ Is $x \in \mathbb{R^{3}} \text{ or } \mathbb{R}^{2}$ due to the 0 component in row 1.

On another note if $x$ was $[1;1;-1]$ we can see that it is not in the span of $S$ by calculating the $RREF.$ Again why is that if the vectors in $S$ are non parallel? Shouldn't any $\mathbb{R}^3$ vectors be in the span of $S?$

Best Answer

Nonparallel is probably an inappropriate notion to think about: you should have in mind that three vectors could be nonparallel but still linearly dependent from each other. That is, the fact that they are pairwise nonparallel does not imply that two of them don't generate the third. This is what happens in the example of the edit with $S$: generate the third vector by summing the second to twice the first.

This shows that $S$ is not a basis, in particular it spans a subspace of dimension 2. Hence, it is possible to find vectors which are not generated by elements in $S$.

The natural question is: being nonparallel is not good but it is easy to check. Is there a way to check linear independence of vectors? And the answer is: build a matrix whose columns are the vectors you're testing for linear independence. If the determinant of the matrix is not zero, they're linearly independent. If you do this with $S$ you'll get a 0 determinant.

Clearly, your vectors being a basis is only a sufficient condition for a vector to lie in their span. If they're not a basis, you could find vectors outside their span or inside, you have to check that. And that's done as you said, finding coefficients $c_i$