<s>[INST] Row Reduction of a matrix Let us consider the following matrix $$M= \left[ {\begin{array}{cc}
             1 & 1 & 2 & 1 & 5 \\
             1 & 1 & 2 & 6 & 10 \\
             1 & 2 & 5 & 2 & 7 \\
                \end{array} } \right]$$
I was able to reduce the above matrix to a row echelon matrix:
$$M'=\left[ {\begin{array}{cc}
             1 & 0 & -1 & 0 & 3 \\
             0 & 1 & 3 & 0 & 1 \\
             0 & 0 & 0 & 1 & 1 \\
                \end{array} } \right]$$
But I don't know how to express M' as a multiplication by a sequence $E_1,...,E_k$ of elementary matrices: $$M'=E_k...E_2E_1M$$
Thank you in advance
 [/INST] $M'=E_k...E_2E_1M$
From the row operations you provided, we arrive at:
$\begin{bmatrix} 1& 0& 0 \\0& 1& -1 \\ 0& 0& 1  \end{bmatrix} \begin{bmatrix} 1& 0& 0 \\ 0& 1& 0 \\ 0& 0& 1/5  \end{bmatrix}\begin{bmatrix} 1& -1& 0 \\ 0& 1& 0 \\ 0& 0& 1 \end{bmatrix}\begin{bmatrix} 1& 0& 0 \\ 0& 0& 1 \\ 0&1& 0 \end{bmatrix}\begin{bmatrix} 1& 0& 0 \\ 0& 1& 0 \\ -1& 0& 1 \end{bmatrix}\begin{bmatrix} 1& 0& 0 \\ -1& 1& 0 \\ 0& 0& 1 \end{bmatrix}\begin{bmatrix} 1 & 1 & 2 & 1 & 5 \\ 1 & 1 & 2 & 6 & 10 \\ 1 & 2 & 5 & 2 & 7 \\ \end{bmatrix} = \begin{bmatrix}1 & 0 & -1 & 0 & 3 \\0 & 1 & 3 & 0 & 1 \\ 0 & 0 & 0 & 1 & 1\end{bmatrix}$
</s>