Basis of a vector I am struggling with this question about basis vectors and would love your help.
The question is: Let W be the solution space to $Ax=0$ for the matrix
$$
       A=\begin{bmatrix}
       1 & -2 & 0 & 4 & -7 \\
       0 & 0 & 1 & 0 & 1\\
       \end{bmatrix}
$$
Our task is to see if set $B$ and $C$ are the basis for $W$.
$$
    B=\begin{bmatrix}
    1 & 2 & 1 \\
    -1 & 1 & -2 \\
    2 & 0 & 0 \\
    0 & -1 & 0\\
    0 & 0 & 1
    \end{bmatrix}
$$
$$
    C=\begin{bmatrix}
    2 & 0 & 0 & 1 & -4 \\
    1 & 2 & -7 & -1 & 0  \\
    0 & 0 & -2 & -1 & 0 \\
    0 & 1 & 0 & 1 & 1 \\
    0 & 0 & 2 & 1 & 0\\
    \end{bmatrix}
$$
My approach: To be a basis the set has to span $W$ and be linearly independent. I found that $C$ is linearly dependent so that set is not a basis. But I am confused with set $B$. This set is linearly independent and since $W$ is $3$-dimensional and $B$ has 5-dimensional vectors, it should also span $W$. However, my teacher says that this is not true because none of the vectors in $B$ are in $W$? What does she mean by this? I thought linearly independence and span was the only necessary condition to have a basis vector.
 A: Call $b_1 = (1, -1, 2, 0, 0)^T$ the first column vector of $B$. I've written this as a row vector, but we know it is a column vector. Then we can compute that
$Ab_1 = (3, 2)^T$.
This isn't $0$, and thus $b_1$ is not in the kernel of $A$. This means that $B$ is not a basis for the kernel, as it is not contained within the kernel of $A$.
A: The solution space $W$ of $Ax = 0$ (also called the null space of $A$) consists of all the vectors $x \in \mathbb{R}^5$ that satisfy that equation. It is a vector subspace of $\mathbb{R}^5$, which turns out to be $3$-dimensional (although you can't necessary determine that immediately). That means that a basis for the space will be a linearly independent set of $3$ different vectors in $\mathbb{R}^5$.
Let's look at your question(s) about the matrices $B$ and $C$. First of all, a basis is a set of vectors, which you seem to be representing as the columns of a matrix. The columns of $B$ are indeed linearly independent, so they span some $3$-dimensional subspace of $\mathbb{R}^5$. They do not however span $W$, which is easy to verify by checking with, say, the first column. Call it $y$. A direct calculation shows that $Ay \neq 0$, so $y \not\in W$, so it cannot be part of a basis for $W$.
For the matrix $C$ and the basis that it describes (by its columns), we have a different sort of issue. Although all of these vectors are in $W$, so their span is also in $W$, they are not linearly independent. In fact, once you know that $W$ is $3$-dimensional (shown below), there's no way that $5$ vectors could span the subspace and be linearly independent.

Here's the standard way to find a basis for $W$ (which also shows that it's $3$-dimensional). Name the components:
$$
x = \begin{bmatrix} x_1 \\ x_2 \\ x_3 \\ x_4 \\ x_5 \end{bmatrix}.
$$
The equation $Ax = 0$ means that the linear combination of the columns of $A$ with weights given by the components of $x$ is $0 \in \mathbb{R}^2$:
$$
Ax = 
x_1 \begin{bmatrix}  1 \\ 0 \end{bmatrix} + 
x_2 \begin{bmatrix} -2 \\ 0 \end{bmatrix} + 
x_3 \begin{bmatrix}  0 \\ 1 \end{bmatrix} + 
x_4 \begin{bmatrix}  4 \\ 0 \end{bmatrix} + 
x_5 \begin{bmatrix} -7 \\ 1 \end{bmatrix} 
= \begin{bmatrix} 0 \\ 0 \end{bmatrix} 
$$
This is a system of $2$ equations (two rows of $A$) in $5$ unknowns (five components of $x$):
$$
\left\{ 
\begin{align*}
1x_1 - 2x_2 + 0x_3 + 4x_4 - 7x_5 &= 0 \\
0x_1 + 0x_2 + 1x_3 + 0x_4 + 1x_5 &= 0
\end{align*}
\right.
$$
In other words, the pivot variables (variables with only zeroes in all other entries in their column) $x_1$ and $x_3$ can be expressed as a linear combination of the other variables, namely,
$$
\left\{ 
\begin{align*}
x_1 &= 2x_2 - 4x_4 + 7x_5 \\ 
x_3 &= -x_5
\end{align*} 
\right. 
$$
Now, we can write $x$ explicitly in terms of the free variables $x_2$, $x_4$, and $x_5$:
$$
\def\ph{\phantom{-}}
\begin{align*}
x = \begin{bmatrix} x_1 \\ x_2 \\ x_3 \\ x_4 \\ x_5 \end{bmatrix} 
= \begin{bmatrix} 2x_2 - 4x_4 + 7x_5 \\ 
\ph x_2 \\ -x_5 \\ \ph x_4 \\ \ph x_5 \end{bmatrix}
&= \begin{bmatrix} 2x_2 \\ x_2 \\ 0 \\ 0 \\ 0 \end{bmatrix} 
+ \begin{bmatrix} -4x_4 \\ 0 \\ 0 \\ x_4 \\ 0 \end{bmatrix} 
+ \begin{bmatrix} 7x_5 \\ 0 \\ -x_5 \\ 0 \\ x_5 \end{bmatrix} \\ & \\
&= x_2 \begin{bmatrix} 2 \\ 1 \\ 0 \\ 0 \\ 0 \end{bmatrix} 
+ x_4 \begin{bmatrix} -4 \\ 0 \\ 0 \\ 1 \\ 0 \end{bmatrix} 
+ x_5 \begin{bmatrix} 7 \\ 0 \\ -1 \\ 0 \\ 1 \end{bmatrix} 
.
\end{align*} 
$$
Call those three vectors $b_1$, $b_2$, and $b_3$. Then any $x \in W$ is a linear combination of $\{b_1, b_2, b_3\}$, i.e.
$$
x = c_1 b_1 + c_2 b_2 + c_3 b_3
\qquad
\text{for some }
c_1, c_2, c_3 \in \mathbb{R}, 
$$
Thus, $\{b_1, b_2, b_3\}$ forms a basis of $W$.

Returning to your matrix $C$, each of its columns can be expressed as a linear combination of the basis for $W$ that we have found here:
$$
\begin{bmatrix} 2 \\ 1 \\ 0 \\ 0 \\ 0 \end{bmatrix} = b_1, 
\qquad 
\begin{bmatrix} 0 \\ 2 \\ 0 \\ 1 \\ 0 \end{bmatrix} = 2b_1 + b_2, 
\qquad
\text{etc.}
$$
