# Order of operations of multiple Matrix Elementary Row Operations

I have two elementary row operation matrices (elimination matrices):

$E_{31} = \begin{bmatrix} 1 & 0 & 0 \\ 0 & 1 & 0 \\ 1 & 0 & 1 \\ \end{bmatrix}$ (adds row $1$ to row $3$)

$E_{13} = \begin{bmatrix} 1 & 0 & 1 \\ 0 & 1 & 0 \\ 0 & 0 & 1 \\ \end{bmatrix}$ (adds row $3$ to row $1$)

Am I correct in saying that if I first want $E_{31}$ applied and second want $E_{13}$ applied to a matrix, it is written as $E_{13}E_{31}$? I think of it as $E_{13}(E_{31}M)$.

My homework question asks what $3$ by $3$ matrix adds row $1$ to row $3$ and then adds row $3$ to row $1$:

I thought the answer was $E_{13}E_{31}$; that is, $E_{31}$ (adds row 1 to row 3) gets applied first, and then $E_{13}$ (adds row 3 to row 1) gets applied after.

You can get the book's answer by multiplying $E_{13}$ with the matrix $E_{31}$.

Why did I get the wrong answer? I have used this same logic to correctly answer previous questions involving the order of multiplying two EROs.

This question is $\#10$ in Section 2.2 of Introduction to Linear Algebra by Gilbert Strang, 4th edition. According to the answer below, the book's solution has a misprint. The matrix presented isn't wrong, but the two E matrices multiplied to make that step is wrong.

-
Yeah, something like that. I added the (adds row 1 to row 3) to point out that the subscripts are reversed. Like, $E_{xy}$ means first y and then x. – Jason Jan 24 '13 at 23:13
@RustynYazdanpour He still got the other answers right. I guess it's most likely that the book has this one wrong. – Git Gud Jan 24 '13 at 23:13
@Jason Why don't you try multiplying your matrix by an arbitrary $3\times 3$ matrix and check who's right? – Git Gud Jan 24 '13 at 23:14
You mean multiplying $E_{13}E_{31}$ (my answer) with some random 3 by 3 matrix $M$? – Jason Jan 24 '13 at 23:16
@Jason Yes, that's what I mean. – Git Gud Jan 24 '13 at 23:17

The correct answer is $E_{13}E_{31}= \begin{bmatrix} 2 & 0 & 1 \\ 0 & 1 & 0 \\ 1 & 0 & 1 \end{bmatrix}=P$ (say). You said that the book's answer is $E_{31}E_{13}=P$. If the book literally says that, then it is correct in that $P$ is the answer, but it is also wrong because $P=E_{13}E_{31}$, not $P=E_{31}E_{13}$. Since I don't have the book at hand, it's hard to say if the book is wrong or you have quoted the book wrongly.
@Jason Then as I said, it is correct that $P$ is the answer, but it is wrong that $E_{31}E_{13}=P$. As to testing on $I_3$, he means if the two elementary matrices are multiplied in the opposite order, you will get a wrong result that is easy to spot. – user1551 Jan 24 '13 at 23:47
@Jason It means "let us call this 3-by-3 matrix $P$". – user1551 Jan 24 '13 at 23:51