\r\n In this lesson, we will explore how to multiply two matrices together.\r\n
\r\n\r\n Unlike matrix addition, matrix multiplication does not require that the\r\n matrices are the same size. In order to multiply matrices together, the\r\n number of columns of the left hand side matrix must match the number of\r\n rows of the right hand side matrix. The resulting matrix has the number\r\n of rows of the left hand side matrix and the number of columns of the\r\n right hand side matrix.\r\n
\r\n\r\n If the multiplication is allowed, it proceeds as follows:\r\n
\r\n Unlike multiplication with regular numbers,\r\n swapping the order of the operands changes the result during matrix\r\n multiplication, and in fact the answer may not even exist for some\r\n combinations!\r\n
\r\n\r\n Another difference is that the multiplication symbol isn't used between\r\n the matrices to be multiplied -- instead they are just placed close\r\n together.\r\n
\r\n\r\n Let's look at a pair of example matrices.\r\n \\(\\mathbf{A}\\), is a matrix\r\n containing 2 rows and 2 columns.\r\n $$\r\n \\mathbf{A} =\r\n \\begin{bmatrix}\r\n 0 & 1 \\\\\r\n 8 & 4 \\\\\r\n \\end{bmatrix}\r\n $$\r\n \\(\\mathbf{B}\\) is a matrix containing 3 rows and 2 columns.\r\n $$\r\n \\mathbf{B} = \\begin{bmatrix}\r\n 1 & 4 \\\\\r\n -1 & 1 \\\\\r\n 3 & 8 \\\\\r\n \\end{bmatrix}\r\n $$\r\n
\r\n\r\n We'll try to compute \\(\\mathbf{M} = \\mathbf{AB}\\).\r\n Since \\(\\mathbf{A}\\) has 2 columns and \\(\\mathbf{B}\\) has 3 rows, they cannot be multiplied in this order.\r\n
\r\n\r\n Instead let's try \\(\\mathbf{P} = \\mathbf{BA}\\).\r\n The left hand side is now \\(\\mathbf{B}\\) with 2 columns and the right\r\n hand side \\(\\mathbf{A}\\) has 2 rows, so this is allowed. We expect the\r\n result to have 3 rows (from \\(\\mathbf{B}\\)) and 2 columns (from\r\n \\(\\mathbf{A}\\)). The answer is then given by:\r\n $$\r\n \\begin{align}\r\n \\mathbf{M} = \\mathbf{BA} &= \\begin{bmatrix}\r\n 1 & 4 \\\\\r\n -1 & 1 \\\\\r\n 3 & 8 \\\\\r\n \\end{bmatrix}\r\n\r\n \\begin{bmatrix}\r\n 0 & 1 \\\\\r\n 8 & 4 \\\\\r\n \\end{bmatrix}\r\n \\\\\r\n &=\r\n \\begin{bmatrix}\r\n 1 \\cdot 0 + 4 \\cdot 8 & 1 \\cdot 1 + 4 \\cdot 4 \\\\\r\n -1 \\cdot 0 + 1 \\cdot 8 & -1 \\cdot 1 + 1 \\cdot 4 \\\\\r\n 3 \\cdot 0 + 8 \\cdot 8 & 3 \\cdot 1 + 8 \\cdot 4 \\\\\r\n \\end{bmatrix}\r\n \\\\\r\n &=\r\n \\begin{bmatrix}\r\n 32 & 17 \\\\\r\n 8 & 3 \\\\\r\n 64 & 35 \\\\\r\n \\end{bmatrix}\r\n \\end{align}\r\n $$\r\n
\r\n\r\n This MagicGraph offers interactive practice problems for understanding matrix multiplication.\r\n
\r\n\r\n You are given a matrix \\(\\textbf{M}\\) which is the result of multiplying two matrices \\(\\mathbf{A}\\) and \\(\\mathbf{B}\\).\r\n Hover over the components of the matrix to see how it was formed from the inputs.\r\n
\r\nTap on the shuffle button to create different variations of the matrix \\(\\textbf{M}\\) and practice.
\r\n\r\n This MagicGraph offers interactive practice problems to test your knowledge.\r\n
\r\n\n You are given a matrix \\(\\textbf{M}\\).\r\n Hover over the components of the matrix to see its location (i.e. its row and column) and indices.\r\n
\r\nTap on the shuffle button to create different variations of the matrix \\(\\textbf{M}\\) and practice.
\r\n