Matrix Multiplication

Matrix Multiplication

Matrix multiplication is a fundamental operation in linear algebra where two matrices are combined to produce a third matrix. The process involves multiplying rows of the first matrix by columns of the second matrix and summing the results. Here’s a detailed explanation:

Preconditions for Matrix Multiplication

Matrix multiplication is only defined when the number of columns in the first matrix equals the number of rows in the second matrix.

  • If matrix ( A ) is of size ( m \times n ) (with ( m ) rows and ( n ) columns) and matrix ( B ) is of size ( n \times p ) (with ( n ) rows and ( p ) columns), then their product ( AB ) will be a matrix ( C ) of size ( m \times p ).

How to Multiply Matrices

Given matrices ( A ) and ( B ):

[A = \begin{pmatrix}a_{11} & a_{12} & \dots & a_{1n} \a_{21} & a_{22} & \dots & a_{2n} \\vdots & \vdots & \ddots & \vdots \a_{m1} & a_{m2} & \dots & a_{mn}\end{pmatrix}, \quadB = \begin{pmatrix}b_{11} & b_{12} & \dots & b_{1p} \b_{21} & b_{22} & \dots & b_{2p} \\vdots & \vdots & \ddots & \vdots \b_{n1} & b_{n2} & \dots & b_{np}\end{pmatrix}]

The product matrix ( C = AB ) is defined as:

C=​c11​c21​⋮cm1​​c12​c22​⋮cm2​​……⋱…​c1p​c2p​⋮cmp​​​

Where each element ( c_{ij} ) of the resulting matrix ( C ) is calculated as:

[c_{ij} = \sum_{k=1}^{n} a_{ik} b_{kj}]

This means that the element ( c_{ij} ) is the dot product of the ( i )-th row of matrix ( A ) and the ( j )-th column of matrix ( B ).

Example of Matrix Multiplication

Let’s multiply two matrices:

[A = \begin{pmatrix}1 & 2 & 3 \4 & 5 & 6\end{pmatrix}, \quadB = \begin{pmatrix}7 & 8 \9 & 10 \11 & 12\end{pmatrix}]

Here, ( A ) is a ( 2 \times 3 ) matrix, and ( B ) is a ( 3 \times 2 ) matrix. The resulting matrix ( C = AB ) will be a ( 2 \times 2 ) matrix.

Let’s calculate each element of matrix ( C ):

  • ( c_{11} ) (first row, first column):
    [c_{11} = (1 \times 7) + (2 \times 9) + (3 \times 11) = 7 + 18 + 33 = 58]
  • [( c_{12} ) (first row, second column)]:
    [c_{12} = (1 \times 8) + (2 \times 10) + (3 \times 12) = 8 + 20 + 36 = 64]
  • ( c_{21} ) (second row, first column):
    [c_{21} = (4 \times 7) + (5 \times 9) + (6 \times 11) = 28 + 45 + 66 = 139]
  • ( c_{22} ) (second row, second column):
    [c_{22} = (4 \times 8) + (5 \times 10) + (6 \times 12) = 32 + 50 + 72 = 154]

So, the resulting matrix ( C ) is:

[C = \begin{pmatrix}58 & 64 \139 & 154\end{pmatrix}]

Properties of Matrix Multiplication

  1. Non-commutative: In general, ( AB \neq BA ). The order in which matrices are multiplied matters.
  2. Associative: Matrix multiplication is associative, meaning ( A(BC) = (AB)C ).
  3. Distributive: Matrix multiplication is distributive over addition, so ( A(B + C) = AB + AC ) and ( (A + B)C = AC + BC ).
  4. Identity Matrix: Multiplying any matrix by the identity matrix ( I ) (where ( I ) is a square matrix with 1’s on the diagonal and 0’s elsewhere) leaves the matrix unchanged: ( AI = IA = A ).
  5. Zero Matrix: Multiplying any matrix by a zero matrix results in a zero matrix.

Matrix multiplication is widely used in various fields, including computer graphics, physics, engineering, economics, and more. It forms the backbone of many algorithms and systems in linear algebra.


Discover more from Science blog by awjunaid

Subscribe to get the latest posts sent to your email.

Leave a Reply