### Instruction: Find the $3 \times 3$ matrix $\mathbf{M}$ such that for a $3 \times 3$ matrix $\mathbf{N},$ $\mathbf{M} \mathbf{N}$ is the result of swapping the first row and second row of $\mathbf{N},$ and doubling the third row of $\mathbf{N}.$  In other words,
\[\mathbf{M} \begin{pmatrix} a & b & c \\ d & e & f \\ g & h & i \end{pmatrix} = \begin{pmatrix} d & e & f \\ a & b & c \\ 2g & 2h & 2i \end{pmatrix}.\].### Response: I recall that when multiplying matrices, the entries of the product matrix are the dot products of the corresponding rows and columns of the factors.
So, to find $\mathbf{M},$ I need to find three rows that, when dotted with the columns of $\mathbf{N},$ give me the desired entries of the product matrix.
To get the first row of the product matrix, which is the second row of $\mathbf{N},$ I need a row that has a 1 in the second position and 0s elsewhere.
Similarly, to get the second row of the product matrix, which is the first row of $\mathbf{N},$ I need a row that has a 1 in the first position and 0s elsewhere.
To get the third row of the product matrix, which is twice the third row of $\mathbf{N},$ I need a row that has a 2 in the third position and 0s elsewhere.
Therefore, the matrix $\mathbf{M}$ that satisfies the given condition is
\[\mathbf{M} = \begin{pmatrix} 0 & 1 & 0 \\ 1 & 0 & 0 \\ 0 & 0 & 2 \end{pmatrix}.\]