If A and B are two matrices, then AB $\neq $ BA i.e. matrix multiplication is not commutative.
Proof: To prove non-commutativity of multiplication of matrices, lets take
A
2x3 = $\begin{bmatrix}
2 &-1 &-3 \\
-4 &2 &-5
\end{bmatrix}$ and B
3x2 = $\begin{bmatrix}
3 & -2 \\
-1 & 1 \\
0 &1
\end{bmatrix}$
Here, A is 2x3 order matrix and B is 3x2 order matrix. Hence, AB and BA both are defined.
AB = $\begin{bmatrix}
2 &-1 &-3 \\
-4 &2 &-5
\end{bmatrix}$ . $\begin{bmatrix}
3 & -2 \\
-1 & 1 \\
0 &1
\end{bmatrix}$ = $\begin{bmatrix}
7 &-8\\
-14 &5
\end{bmatrix}$
Now,
BA = $\begin{bmatrix}
3 & -2 \\
-1 & 1 \\
0 &1
\end{bmatrix}$ . $\begin{bmatrix}
2 &-1 &-3 \\
-4 &2 &-5
\end{bmatrix}$ = $\begin{bmatrix}
14 &-7 &1 \\
-6 &3 &-2\\
-4 &2&-5
\end{bmatrix}$
Clearly,
AB $\neq $ BAHere, both AB and BA are of different order. Perhaps, AB = BA if they are of the same order. But, its not always true. Lets have a look at an example, where AB and BA are of the same order but AB $\neq$ BA.
Let
A2x2 = $\begin{bmatrix}
2 &0\\
0 &-2
\end{bmatrix}$ and
B2x2 = $\begin{bmatrix}
0&2\\
2&0
\end{bmatrix}$
Then,
AB = $\begin{bmatrix}
0&4\\
-4 &0
\end{bmatrix}$ and
BA = $\begin{bmatrix}
0 &-4\\
4 &0
\end{bmatrix}$.
In the above example,order of AB and BA are the same. But, AB $\neq$ BA. Thus, matrix multiplication is not commutative.
For matrix multiplication,
- Number of columns of first matrix = Number of rows of second matrix.
- Multiply each element of the rows of first matrix with the corresponding elements of the columns of second matrix and then add.
- Matrix multiplication is not commutative