TITLE: Find whether vector w belongs in the span
QUESTION [5 upvotes]: $$v_1=[1,0,1,2]$$
$$v_2 = [0,1,1,3]$$
$$v_3 = [2,1,3,7]$$
$$w = [1,2,3,4]$$
We are supposed to determine if $w$ is in $\operatorname{span}(v_1,v_2,v_3)$.

REPLY [3 votes]: Let us take the vectors $v_1$, $v_2$ and $v_3$ and perform elementary row operations until we get reduced row echelon form.
$$
\begin{pmatrix}
  1 & 0 & 1 & 2 \\
  0 & 1 & 1 & 3 \\
  2 & 1 & 3 & 7
\end{pmatrix}\sim
\begin{pmatrix}
  1 & 0 & 1 & 2 \\
  0 & 1 & 1 & 3 \\
  0 & 1 & 1 & 3
\end{pmatrix}\sim
\begin{pmatrix}
  \boxed{1} & 0 & 1 & 2 \\
  0 & \boxed{1} & 1 & 3 \\
  0 & 0 & 0 & 0
\end{pmatrix}$$
Since elementary row operations do not change the row space, the non-zero rows of the last matrix span the same subspace. So now we have a rather simple basis consisting of the vectors $u_1=[1,0,1,2]$ and $u_2=[0,1,1,3]$ and we are asking whether $w\in\operatorname{span}(u_1,u_2)$.
Now it suffices to look at the numbers in the first and second position in the vector $w$, since this is where the pivots are in the rref.
So $w$ can only be a linear combination of $u_1$ and $u_2$ if it is equal to
$$u_1+2u_2=[1,2,3,8].$$
Therefore we see that $w\notin \operatorname{span} (u_1,u_2)= \operatorname{span}(v_1,v_2,v_3)$.
See also this similar question: Finding whether a vector is in the span of a set of vectors