Doubt with vectorial spaces (Basis and dimension) Good night, i'm working in a problem, i need an basis and the dimension of the space.
$a_{1}=(1,0,0,-1),\:a_{2}=(2,1,1,0),\:a_{3}=(1,1,1,1),\:a_{4}=(1,2,3,4),\:a_{5}=(0,1,2,3)$
I make this:
$\left[ \begin {array}{cccc} 1&0&0&-1\\ 2&1&1&0
\\ 1&1&1&1\\ 1&2&3&4
\\ 0&1&2&3\end {array} \right]$ 
and i apply gauss for reduce the matrix:
$ \left[ \begin {array}{cccc} 1&0&0&-1\\ 0&1&0&1
\\ 0&0&1&1\\ 0&0&0&0
\\ 0&0&0&0\end {array} \right]$ 
now, i have 3 linearly independent vectors and my dimensions is 3. but, i can take any vector and they go linearly independent?  for example:
$a_{1}=(1,0,0,-1),\:a_{2}=(2,1,1,0),\:a_{3}=(1,1,1,1)$
or
$a_{3}=(1,1,1,1),\:a_{4}=(1,2,3,4),\:a_{5}=(0,1,2,3)$
and going to be linearly independent? thanks!!
 A: In this case you are finding a basis for the rowspace of the matrix you set up. The nonzero rows of your row-reduction matrix span the row space of the original matrix. Only the nonzero rows are linearly independent.
So if your calculation is right, the answer should be {(1,0,0,-1),(0,1,0,1),(0,0,1,1)}
You can take a look at this site for details: http://www.math.tamu.edu/~fnarc/psfiles/find_bases.pdf
A: Since you constructed a matrix from the set of vectors as row vectors, you are essentially looking for a basis of the row space of the matrix (the span of the row vectors), let's call this matrix $A$. 
Row operations do not change the row space of a matrix, so to construct a basis for the row space, what you must look at are the pivot rows in the reduced row-echelon form of $A$.
We can choose either the pivot rows of $\mathrm{RREF}(A)$ or the corresponding rows in $A$ as a basis for the vector space spanned by those vectors. So in this case $\left\{(1,0,0,-1), (2,1,1,0), (1,1,1,1)\right\}$ and $\left\{(1,0,0,-1), (0,1,0,1), (0,0,1,1)\right\}$ are both bases for the vector space spanned by the given vectors.
One way I prefer to do it, is construct the matrix from the vectors as columns. In this case we are trying to determine a basis for the column space of $A$:
$$A=\begin{bmatrix}1 & 2 & 1 & 1 &0 \\ 0 & 1 & 1 & 2 & 1 \\ 0 & 1 & 1 & 3 & 2 \\ -1 & 0 & 1 & 4 & 3\end{bmatrix},$$
$$\mathrm{RREF}(A)=\begin{bmatrix}1 & 0 & -1 & 0 & 1 \\ 0 & 1 & 1 & 0 & -1 \\ 0 & 0 & 0 & 1 & 1 \\ 0 & 0 & 0 & 0 & 0\end{bmatrix}.$$
What $\mathrm{RREF}(A)$ is telling us is that columns $1$, $2$, and $4$ of matrix $A$ form a basis for the column space of $A$ (because these are the pivot columns). i.e. $\left\{(1,0,0,-1), (2,1,1,0), (1, 2, 3, 4)\right\}$ is a basis for the space spanned by the given set of vectors.
What $\mathrm{RREF}(A)$ also tells us is that $\mathbf{c}_{3}=-1\mathbf{c}_{1}+1\mathbf{c}_{2}$, or
$$(1,1,1,1)=-1(1,0,0,-1)+1(2,1,1,0),$$
and also, $\mathbf{c}_{5}=1\mathbf{c}_{1}-1\mathbf{c}_{2}+1\mathbf{c}_{4}$, or
$$(0,1,2,3)=1(1,0,0,-1)-1(2,1,1,0)+1(1,2,3,4).$$
The vector which is expressed as said linear combination is of course the column in $A$ which corresponds to a non-pivot column of $\mathrm{RREF}(A)$. The vectors in the linear combination are those column vectors of $A$ which correspond to the pivot in that row, and its corresponding coefficient in the linear combination is the entry in that same row, in the current non-pivot column. It is kind of confusing to explain but hopefully you can see by the example I gave.
A: This is perhaps not what you expect but I give it anyway so you see another way to solve your problem.  Since given vector components are simple you can try to see at first sight with a little attention about linear relations among them. You have
$$a_2-a_1=a_3\\a_4-a_3=a_5$$ hence $$a_4+a_1-a_2=a_5$$ Putting now, in order to know if $a_1,a_2,a_4$ are linearly independent, 
$$\alpha a_1+\beta a_2+\gamma a_4=0\iff \begin{cases} \alpha+2\beta+\gamma=0\\\beta+2\gamma=0\\\beta+3\gamma=0\\-\alpha +4\gamma=0\end{cases}\iff \alpha=\beta=\gamma=0 $$ 
Consequently you have dimension $3$ and you can take the base $$\{a_1,a_2,a_4\}$$
