Matrix Multiplication
Matrix multiplication is an operation where two matrices are multiplied to produce a new matrix. Unlike addition and subtraction, matrix multiplication follows specific rules and is not performed element-wise.
For two matrices
- The number of columns in the first matrix
must be equal to the number of rows in the second matrix . - If
is of size and is of size , then their product will be of size . - The element at position
in the resulting matrix is computed as the dot product of the row of and the column of .
Mathematically, matrix multiplication is expressed as:
Example 1: Multiplying a 2×3 Matrix with a 3×2 Matrix
Consider the following matrices:
Matrix
The result
Step 1: Compute (First Row, First Column)
The element
Step 2: Compute (First Row, Second Column)
The element
Step 3: Compute (Second Row, First Column)
The element
Step 4: Compute (Second Row, Second Column)
The element
Final Result
Thus, the product of
Example 2: Multiplication of Two 2×2 Matrices
Consider the two 2×2 matrices:
Since
Step 1: Compute (First Row, First Column)
The element
– Multiply the first element of row 1 of
– Multiply the second element of row 1 of
– Add these values:
Step 2: Compute (First Row, Second Column)
The element
– Multiply the first element of row 1 of
– Multiply the second element of row 1 of
– Add these values:
Step 3: Compute (Second Row, First Column)
The element
– Multiply the first element of row 2 of
– Multiply the second element of row 2 of
– Add these values:
Step 4: Compute (Second Row, Second Column)
The element
– Multiply the first element of row 2 of
– Multiply the second element of row 2 of
– Add these values:
Final Result
The resulting 2×2 matrix is:
Example 3: Multiplication of Two 3×3 Matrices
Consider the two 3×3 matrices:
The result
Step 1: Compute First Row
Step 2: Compute Second Row
Step 3: Compute Third Row
Final Result
The resulting 3×3 matrix is:
Conclusion
Matrix multiplication is a fundamental operation in linear algebra used in various applications such as computer graphics, machine learning, and engineering. The key points to remember are:
- Matrix multiplication is not commutative (
in general). - The number of columns in the first matrix must match the number of rows in the second matrix.
- Each element of the resulting matrix is computed as the dot product of a row from the first matrix and a column from the second matrix.
By following these principles, you can confidently perform matrix multiplication step by step.