Compute AB and BA, which ever exists when \mathrm{A}=\left[\begin{array}{rrr} 0 & 1 & -5 \\ 2 & 4 & 0 \end{array}\right] \text { and } \mathrm{B}=\left[\begin{array}{cc} 1 & 3 \\ -1 & 0 \\ 0 & 5 \end{array}\right]
Compute AB and BA, which ever exists when \mathrm{A}=\left[\begin{array}{rrr} 0 & 1 & -5 \\ 2 & 4 & 0 \end{array}\right] \text { and } \mathrm{B}=\left[\begin{array}{cc} 1 & 3 \\ -1 & 0 \\ 0 & 5 \end{array}\right]

Solution:

We have \boldsymbol{A}=\left(\begin{array}{ccc}\mathbf{0} & \mathbf{1} & -\mathbf{5} \\ \mathbf{2} & \mathbf{4} & \mathbf{0}\end{array}\right) and \boldsymbol{B}=\left(\begin{array}{cc}\mathbf{1} & \mathbf{3} \\ -\mathbf{1} & \mathbf{0} \\ \mathbf{0} & \mathbf{5}\end{array}\right).
Now if number of columns in left matrix is equals to the number of rows in right matrix, multiplication of two matrices is possible.

Now discuss the order of the matrices which are given. The order of matrix \boldsymbol{A} is \mathbf{2} \times \mathbf{3} and matrix \boldsymbol{B} is \mathbf{3} \times \mathbf{2}.
Hence the multiplications we can proceed as

(i) The multiplication \boldsymbol{B A} is possible.
\begin{aligned} B A=\left(\begin{array}{cc} 1 & 3 \\ -1 & 0 \\ 0 & 5 \end{array}\right)\left(\begin{array}{ccc} 0 & 1 & -5 \\ 2 & 4 & 0 \end{array}\right) \\ =\left(\begin{array}{cc} 0(1)+1(-1)-5(0) & 0(3)+1(0)-5(5) \\ 2(1)+4(-1)+0(0) & 2(3)+4(0)+0(5) \end{array}\right) \\ =\left(\begin{array}{cc} -1 & -25 \\ -2 & 6 \end{array}\right) \end{aligned}

(ii) The multiplication \boldsymbol{A B} is possible.
\begin{array}{l} A B=\left(\begin{array}{ccc} 0 & 1 & -5 \\ 2 & 4 & 0 \end{array}\right)\left(\begin{array}{cc} 1 & 3 \\ -1 & 0 \\ 0 & 5 \end{array}\right) \\ =\left(\begin{array}{ccc} \mathbf{1}(\mathbf{0})+\mathbf{3}(\mathbf{2}) & \mathbf{1}(\mathbf{1})+\mathbf{3}(\mathbf{4}) & \mathbf{1}(-\mathbf{5})+\mathbf{3}(\mathbf{0}) \\ \mathbf{- 1}(\mathbf{0})+\mathbf{0}(\mathbf{2}) & \mathbf{- 1}(\mathbf{1})+\mathbf{0}(\mathbf{4}) & \mathbf{- 1}(-\mathbf{5})+\mathbf{0}(\mathbf{0}) \\ \mathbf{0}(\mathbf{0})+\mathbf{5}(\mathbf{2}) & \mathbf{0}(\mathbf{1})+\mathbf{5}(\mathbf{4}) & \mathbf{0}(-\mathbf{5})+\mathbf{5}(\mathbf{0}) \end{array}\right) \end{array}
=\left(\begin{array}{ccc}6 & 13 & -5 \\ 0 & -1 & 5 \\ 10 & 20 & 0\end{array}\right)