This is an old revision of the document!
Warning: Undefined array key "do" in /home/levene/public_html/w/mst10030/lib/plugins/revealjs/syntax/header.php on line 56
Warning: Undefined array key "do" in /home/levene/public_html/w/mst10030/lib/plugins/revealjs/syntax/header.php on line 56
Warning: Undefined array key "do" in /home/levene/public_html/w/mst10030/lib/plugins/revealjs/syntax/header.php on line 56
Warning: Undefined array key "do" in /home/levene/public_html/w/mst10030/lib/plugins/revealjs/syntax/header.php on line 56
Warning: Undefined array key "do" in /home/levene/public_html/w/mst10030/lib/plugins/revealjs/syntax/header.php on line 56
Warning: Undefined array key "do" in /home/levene/public_html/w/mst10030/lib/plugins/revealjs/syntax/header.php on line 56
Warning: Undefined array key "do" in /home/levene/public_html/w/mst10030/lib/plugins/revealjs/syntax/header.php on line 56
Warning: Undefined array key "do" in /home/levene/public_html/w/mst10030/lib/plugins/revealjs/syntax/header.php on line 56
Warning: Undefined array key "do" in /home/levene/public_html/w/mst10030/lib/plugins/revealjs/syntax/header.php on line 56
Warning: Undefined array key "do" in /home/levene/public_html/w/mst10030/lib/plugins/revealjs/syntax/header.php on line 56
Warning: Undefined array key "do" in /home/levene/public_html/w/mst10030/lib/plugins/revealjs/syntax/header.php on line 56
Warning: Undefined array key "do" in /home/levene/public_html/w/mst10030/lib/plugins/revealjs/syntax/header.php on line 56
Warning: Undefined array key "do" in /home/levene/public_html/w/mst10030/lib/plugins/revealjs/syntax/header.php on line 56
Warning: Undefined array key "do" in /home/levene/public_html/w/mst10030/lib/plugins/revealjs/syntax/header.php on line 56
Warning: Undefined array key "do" in /home/levene/public_html/w/mst10030/lib/plugins/revealjs/action.php on line 14
Table of Contents
Matrix multiplication
- Let $A,B$ be matrices, with sizes
- $A$: $n\times m$
- $B$: $m\times k$
- The product $AB$ is: the $n\times k$ matrix whose $(i,j)$ entry is \[ (AB)_{i,j} = \text{row}_i(A)\cdot \text{col}_j(B)\]
- So the entries of $AB$ are all possible row-column products of a row of $A$ with a column of $B$
"Compatible" sizes for $AB$ to be defined
- We need the sizes of $A$ and $B$ to be “compatible” for $AB$ to be defined
- Need $A$: $n\times m$ and $B$: $m\times k$ (same numbers “in the middle”)
- If $A,B$ are matrices, with sizes
- $A$: $n\times m$
- $B$: $\ell\times k$ with $\ell\ne m$,
- then the matrix product $AB$ is undefined.
Example 1
If $\newcommand{\mat}[1]{\left[\begin{smallmatrix}#1\end{smallmatrix}\right]} A=\mat{1&0&5\\2&-1&3}$ and $B=\mat{1&2\\3&4\\5&6}$,
- $AB=\mat{26&32\\14&18}$
- $BA=\mat{5&-2&11\\11&-4&27\\17&-6&43}$.
- Note that $AB$ and $BA$ are both defined, but $AB\ne BA$
- $AB$ and $BA$ don't even have the same size.
Example 2
If $A=\mat{1&2\\3&4\\5&6}$, $B=\mat{2&1&1\\1&2&0\\1&0&2\\1&0&2\\2&2&1}$ and $C=\mat{1&3&0&7\\0&4&6&8}$,
- $A$ is $3\times 2$, $B$ is $4\times 3$ and $C$ is $2\times 4$, so
- $AB$, $CA$ and $BC$ don't exist (undefined);
- $AC$ exists and is $3\times 4$;
- $BA$ exists and is $4\times 2$; and
- $CB$ exists and is $2\times 2$.
- In particular, $AB\ne BA$ and $AC\ne CA$ and $BC\ne CB$ (undefined vs defined!)
Example 3
If $A=\mat{0&1\\0&0}$ and $B=\mat{0&0\\1&0}$, then
- $AB=\mat{1&0\\0&0}$
- $BA=\mat{0&0\\0&1}$.
- So $AB$ and $BA$ are both defined and have the same size, but they are not equal matrices: $AB\ne BA$.
Example 4
If $A=0_{n\times n}$ is the $n\times n$ zero matrix and $B$ is any $n\times n$ matrix, then
- $AB=0_{n\times n}$, and
- $BA=0_{n\times n}$.
- So in this case, we do have $AB=BA$.
Example 5
If $A=\mat{1&2\\3&4}$ and $B=\mat{7&10\\15&22}$, then
- $AB=\mat{37&54\\81&118}$
- $BA=\mat{37&54\\81&118}$
- So $AB=BA$ for these particular matrices $A$ and $B$.
Example 6
If $A=\mat{1&2\\3&4}$ and $B=\mat{6&10\\15&22}$, then
- $AB=\mat{36&54\\78&118}$
- $BA= \mat{36&52\\81&118}$
- So $AB\ne BA$.
Commuting matrices I
We say that matrices $A$ and $B$ commute if $AB=BA$.
- Because it's not true in general that $AB=BA$, we say that matrix multiplication is not commutative.
Commuting matrices II
- What can we say about commuting matrices?
- Suppose $AB=BA$ and think about sizes.
- $A$: $n\times m$
- $B$: $\ell\times k$
- $AB$ is defined, so $m=\ell$.
- $BA$ is defined, so $k=n$.
- $AB$ is $n\times k$ and $BA$ is $\ell\times m$, so $n=\ell$ and $k=m$. So $n=\ell=m=k$!
- $A$ and $B$ must both be $n\times n$: they're square matrices of the same size.
Commuting matrices III
- If $A$ and $B$ commute, they must be square matrices of the same size.
- Some square matrices $A$ and $B$ of the same size commute…
- ….but not all!
- See examples above.
The $n\times n$ identity matrix
The $n\times n$ identity matrix is the $n\times n$ matrix $I_n$ with $1$s in every diagonal entry (that is, in the $(i,i)$ entry for every $i$ between $1$ and $n$), and $0$s in every other entry. So \[ I_n=\begin{bmatrix} 1&0&0&\dots&0\\0&1&0&\dots&0\\0&0&1&\dots&0\\\vdots & & &\ddots & \vdots\\0&0&0&\dots&1\end{bmatrix}.\]
Examples
- $I_1=[1]$
- $I_2=\mat{1&0\\0&1}$
- $I_3=\mat{1&0&0\\0&1&0\\0&0&1}$
- $I_4=\mat{1&0&0&0\\0&1&0&0\\0&0&1&0\\0&0&0&1}$, and so on!
Properties of $I_n$
- $I_nA=A$ for any $n\times m$ matrix $A$;
- $AI_m=A$ for any $n\times m$ matrix $A$; and
- $I_nB=B=BI_n$ for any $n\times n$ matrix $B$.
- In particular, $I_n$ commutes with every other square $n\times n$ matrix $B$.
