Writing columns of a matrix as linear combinations of other columns Let A be the matrix: $$\begin{pmatrix} 1&2&3&2&1&0\\2&4&5&3&3&1\\1&2&2&1&2&1 \end{pmatrix}$$
What is the best way to write the fifth and sixth columns of the matrix as linear combinations of the first and third columns? 
 A: First consider column 5
We can think of it as
\begin{align}a\begin{pmatrix}1\\2\\1\end{pmatrix}+b\begin{pmatrix}3\\5\\2\end{pmatrix}&=\begin{pmatrix}1\\3\\2\end{pmatrix}\\
&\Downarrow \\
a+3b&=1\\
2a+5b&=3\\
a+2b&=2
\end{align}
So $a=1-3b$
Therefore \begin{align}2(1-3b)+5b&=3\\
2-6b+5b&=3\\
2-3&=b\\
b&=-1
\end{align}
And so $a=1-(3\times-1)=4$
So we have \begin{align}4\begin{pmatrix}1\\2\\1\end{pmatrix}-\begin{pmatrix}3\\5\\2\end{pmatrix}&=\begin{pmatrix}4\\8\\4\end{pmatrix}-\begin{pmatrix}3\\5\\2\end{pmatrix}\\
&=\begin{pmatrix}1\\3\\2\end{pmatrix}
\end{align}

We can then do this again for column 6
\begin{align}c\begin{pmatrix}1\\2\\1\end{pmatrix}+d\begin{pmatrix}3\\5\\2\end{pmatrix}&=\begin{pmatrix}0\\1\\1\end{pmatrix}\\
&\Downarrow \\
c+3d&=0\\
2c+5d&=1\\
c+2d&=1\end{align}
So we have $c=-3d$
Therefore we have \begin{align}2(-3d)+5d&=1\\
-6d+5d&=1\\
-d&=1\\
d&=-1
\end{align}
And so $c=-3d= -3\times -1 = 3$
And so we have \begin{align}3\begin{pmatrix}1\\2\\1\end{pmatrix}-\begin{pmatrix}3\\5\\2\end{pmatrix}&=\begin{pmatrix}3\\6\\3\end{pmatrix}-\begin{pmatrix}3\\5\\2\end{pmatrix}\\
&=\begin{pmatrix}0\\1\\1\end{pmatrix}
\end{align}
A: In principle, you need to solve a series of linear equations, as described in detail in lioness99a’s answer. It’s possible to do this “in bulk.” Recall that one way to solve such an equation is to create an augmented matrix and row-reduce it. You can in fact package all of the vectors into a single matrix and solve all of the equations at once via row-reduction.  
In this case, we’d put the first and third columns on the left-hand side, and the fifth and sixth on the right: $$\left(\begin{array}{cc|cc}1&3 & 1&0 \\ 2&5 & 3&1 \\ 1&2 & 2&1\end{array}\right)$$ and row-reduce to get $$\left(\begin{array}{cc|rr}1&0 & 4&3 \\ 0&1 & -1&-1 \\ 0&0 & 0&0\end{array}\right).$$ The required coefficients appear in the first two rows of the columns on the right. If a column can’t be written as a linear combination of the ones on the left, then the corresponding column of the reduced matrix will have a non-zero entry in at least one of the other rows. This also gives you a way to check that the first and third columns are in fact linearly independent. If not, there won’t be a pivot in the second column of the reduced matrix.
