Extending basis for span of 3 vectors into basis for $R^4$ So I have been reading countless posts on extending a matrix basis, however I still am unable to grasp it and apply what I've read to my problem.
w1 = [1,0,-2,3] w2 = [1,-2,3,-1] w3 = [1,-8,4,0]
W = sp(w1, w2, w3)
With the above provided, I was asked to find a basis for W, which I solved to be:
{$[1,0,-2,3]^T$, $[1,-2,3,-1]^T$, $[1,-8,4,0]^T$}
I got this answer by reducing the matrix formed by w1, w2, and w3, and checking for linear independence, then selecting the pivot columns.
Anyways, the question I am stuck on is how do I now extend this basis for $R^4$? As I mentioned previously, I have read multiple previous questions on extending a basis. However I am still confused and unable to apply what I read previously to this question.
Any help is appreciated!
 A: There's an algorithmic way to do this. Start by putting your vectors into the columns of a matrix
$$
\left[\begin{array}{rrr}
1 & 1 & 1 \\
0 & -2 & -8 \\
-2 & 3 & 4 \\
3 & -1 & 0
\end{array}\right]
$$
Then augment this matrix with the $4\times 4$ identity matrix
$$
A=
\left[\begin{array}{rrr|rrrr}
1 & 1 & 1 & 1 & 0 & 0 & 0 \\
0 & -2 & -8 & 0 & 1 & 0 & 0 \\
-2 & 3 & 4 & 0 & 0 & 1 & 0 \\
3 & -1 & 0 & 0 & 0 & 0 & 1
\end{array}\right]
$$
Now, row reduce this matrix to find its reduced row-echelon form. In our case we have
$$
\DeclareMathOperator{rref}{rref}\rref A=
\left[\begin{array}{rrr|rrrr}
1 & 0 & 0 & 0 & \frac{1}{8} & \frac{1}{4} & \frac{1}{2} \\
0 & 1 & 0 & 0 & \frac{3}{8} & \frac{3}{4} & \frac{1}{2} \\
0 & 0 & 1 & 0 & -\frac{7}{32} & -\frac{3}{16} & -\frac{1}{8} \\
0 & 0 & 0 & 1 & -\frac{9}{32} & -\frac{13}{16} & -\frac{7}{8}
\end{array}\right]
$$
The pivot columns are the first four columns. This implies that the first four columns of $A$ form a basis for $\Bbb R^4$. Of course, the first three of these columns are your vectors by design.
A: An alternative way to Brian's is to determine the solution space to $W$, i.e. solve for some vector $\mathbf{x}$
$$
 \left(\begin{array}{ccc|c}
 \vdots & \vdots & \vdots & \vdots \\
 \mathbf{w}_1 & \mathbf{w}_2 & \mathbf{w}_3 & \mathbf{x}\\
 \vdots & \vdots & \vdots & \vdots \\ 
 \end{array}\right)
$$
for which at least the bottom row in the w-matrix will be zero on the LHS, and non-zero on the RHS. If solution exists, then the RHS of this zero row must equal to zero, so you will get a (or more) linear equation(s) in terms of $x$'s. All vectors in $W$ must satisfy these equations (try with the $\mathbf{w}$'s). So pick a vector $\mathbf{u}$, which does not satisfy it $\implies \mathbf{u} \notin W$, which is obviously linearly independent of the others.
