Give examples of matrices
(i) A and B such that AB ≠ BA
(ii) A and B such that AB = O but A ≠ 0, B ≠ 0.
(iii) A and B such that AB = O but BA ≠ O.
(iv) A, B and C such that AB = AC but B ≠ C, A ≠ 0.
(i) Let $A=\left[\begin{array}{cc}1 & -2 \\ 3 & 2\end{array}\right]$ and $B=\left[\begin{array}{cc}2 & 3 \\ -1 & 2\end{array}\right]$
$A B=\left[\begin{array}{cc}1 & -2 \\ 3 & 2\end{array}\right]\left[\begin{array}{cc}2 & 3 \\ -1 & 2\end{array}\right]$
$\Rightarrow A B=\left[\begin{array}{ll}2+2 & 3-4 \\ 6-2 & 9+4\end{array}\right]$
$\Rightarrow A B=\left[\begin{array}{cc}4 & -1 \\ 4 & 13\end{array}\right]$
Now,
$B A=\left[\begin{array}{cc}2 & 3 \\ -1 & 2\end{array}\right]\left[\begin{array}{cc}1 & -2 \\ 3 & 2\end{array}\right]$
$\Rightarrow B A=\left[\begin{array}{cc}2+9 & -4+6 \\ -1+6 & 2+4\end{array}\right]$
$\Rightarrow B A=\left[\begin{array}{cc}11 & 2 \\ 5 & 6\end{array}\right]$
Thus, AB ≠ BA.
(ii) Let $A=\left[\begin{array}{ll}0 & 2 \\ 0 & 0\end{array}\right]$ and $B=\left[\begin{array}{ll}1 & 0 \\ 0 & 0\end{array}\right]$
$\therefore A B=\left[\begin{array}{ll}0+0 & 0+0 \\ 0+0 & 0+0\end{array}\right]=\left[\begin{array}{ll}0 & 0 \\ 0 & 0\end{array}\right]=O$
Thus, $A B=O$ while $A \neq 0$ and $B \neq 0$.
(iii) Let $A=\left[\begin{array}{ll}0 & 1 \\ 0 & 0\end{array}\right]$ and $B=\left[\begin{array}{ll}1 & 0 \\ 0 & 0\end{array}\right]$
$\therefore A B=O$
and $B A=\left[\begin{array}{ll}1 & 0 \\ 0 & 0\end{array}\right]\left[\begin{array}{ll}0 & 1 \\ 0 & 0\end{array}\right]$
$\Rightarrow B A=\left[\begin{array}{ll}0+0 & 1+0 \\ 0+0 & 0+0\end{array}\right]$
$\Rightarrow B A=\left[\begin{array}{ll}0 & 1 \\ 0 & 0\end{array}\right]$
Thus, $A B=O$ but $B A \neq O$.
(iv) Let $A=\left[\begin{array}{ll}1 & 0 \\ 0 & 0\end{array}\right], B=\left[\begin{array}{ll}0 & 0 \\ 0 & 1\end{array}\right]$ and $C=\left[\begin{array}{ll}0 & 0 \\ 0 & 2\end{array}\right]$
$\therefore A B=\left[\begin{array}{ll}1 & 0 \\ 0 & 0\end{array}\right]\left[\begin{array}{ll}0 & 0 \\ 0 & 1\end{array}\right]$
$\Rightarrow A B=\left[\begin{array}{ll}0+0 & 0+0 \\ 0+0 & 0+0\end{array}\right]=\left[\begin{array}{ll}0 & 0 \\ 0 & 0\end{array}\right]$
and $A C=\left[\begin{array}{ll}1 & 0 \\ 0 & 0\end{array}\right]\left[\begin{array}{ll}0 & 0 \\ 0 & 2\end{array}\right]$
$\Rightarrow A C=\left[\begin{array}{ll}0+0 & 0+0 \\ 0+0 & 0+0\end{array}\right]=\left[\begin{array}{ll}0 & 0 \\ 0 & 0\end{array}\right]$
Thus,
$A B=A C$
But $B \neq C$ and $A \neq 0$.