This is an old revision of the document!
Warning: Undefined array key "do" in /home/levene/public_html/w/mst10030/lib/plugins/revealjs/syntax/theme.php on line 50
Warning: Undefined array key "do" in /home/levene/public_html/w/mst10030/lib/plugins/revealjs/action.php on line 14
Table of Contents
Operations on matrices
- Some (useful) ways of taking two matrices and making a new matrix.
- $1\times 1$ matrices are the same as numbers….
- ….we'll define some operations on matrices which generalise operations on numbers, like addition and multiplication
Matrix addition and subtraction
If $A$ and $B$ are matrices of the same size, then $A+B$ is defined to be the matrix with the same size as $A$ and $B$ so that the $(i,j)$ entry of $A+B$ is $a_{ij}+b_{ij}$, for every $i,j$.
If $A$ and $B$ are matrices of different sizes, then $A+B$ is undefined.
Examples
- $ \left[\begin{smallmatrix}1&2&-2\\3&0&5\end{smallmatrix}\right]+\left[\begin{smallmatrix}-2&2&0\\1&1&1\end{smallmatrix}\right]=\left[\begin{smallmatrix}-1&4&-2\\4&1&6\end{smallmatrix}\right].$
- $\left[\begin{smallmatrix}1&2&-2\\3&0&5\end{smallmatrix}\right]+\left[\begin{smallmatrix}-2&2\\1&1\end{smallmatrix}\right]\text{ is undefined.}$
Remarks
- For any matrices $A$ and $B$ with the same size: $A+B=B+A$. We say that matrix addition is commutative.
- For any matrices $A$, $B$ and $C$ with the same size: $(A+B)+C=A+(B+C)$. We say that matrix addition is associative.
The zero matrix
The $n\times m$ zero matrix is the $n\times m$ matrix so that every entry is $0$. We write this as $0_{n\times m}$. So \[ 0_{n\times m}=\begin{bmatrix} 0&0&\dots&0\\ 0&0&\dots&0\\ \vdots&\vdots&&\vdots\\ 0&0&\dots&0\end{bmatrix}\] where this matrix has $n$ rows and $m$ columns.
Exercise
Show that if $A$ is any $n\times m$ matrix, then \[ 0_{n\times m}+A=A=A+0_{n\times m}.\]
- Remember that when checking that matrices are equal, you have to check that they have the same size, and that all the entries are the same.
Definition of matrix subtraction
If $A$ and $B$ are matrices of the same size, then $A-B$ is defined to be the matrix with the same size as $A$ and $B$ so that the $(i,j)$ entry of $A-B$ is $a_{ij}-b_{ij}$, for every $i,j$.
If $A$ and $B$ are matrices of different sizes, then $A-B$ is undefined.
Examples
- $ \left[\begin{smallmatrix}1&2&-2\\3&0&5\end{smallmatrix}\right]-\left[\begin{smallmatrix}-2&2&0\\1&1&1\end{smallmatrix}\right]=\left[\begin{smallmatrix}3&0&-2\\2&-1&4\end{smallmatrix}\right].$
- $ \left[\begin{smallmatrix}1&2&-2\\3&0&5\end{smallmatrix}\right]-\left[\begin{smallmatrix}-2&2\\1&1\end{smallmatrix}\right]\text{ is undefined.}$
Scalars
- a scalar is just a fancy name for a number
- (in this course: a real number)
- Why use this strange-looking name?
- numbers are often used for scaling things up or down
- e.g. the scalar 3 is used to scale things up by a factor of 3 (by multiplying by 3).
Scalar multiplication of matrices
If $c$ is a real number and $A$ is an $n\times m$ matrix, then we define the matrix $cA$ to be the $n\times m$ matrix given by multiplying every entry of $A$ by $c$. In other words, the $(i,j)$ entry of $cA$ is $ca_{i,j}$.
Example
- If $A=\left[\begin{smallmatrix}1&0&-3\\3&-4&1\end{smallmatrix}\right]$, then $3A=\left[\begin{smallmatrix}3&0&-9\\9&-12&3\end{smallmatrix}\right]$.
- In other words, $ 3\left[\begin{smallmatrix}1&0&-3\\3&-4&1\end{smallmatrix}\right]=\left[\begin{smallmatrix}3&0&-9\\9&-12&3\end{smallmatrix}\right].$
The negative of a matrix
We write $-A$ as a shorthand for $-1A$; so the $(i,j)$ entry of $-A$ is $-a_{ij}$. For example, \[ -\begin{bmatrix}-1&0&3\\3&-4&1\end{bmatrix}=\begin{bmatrix}1&0&-3\\-3&4&-1\end{bmatrix}.\]
Exercise
Prove that $A-B=A+(-B)$ for any matrices $A$ and $B$ of the same size.
Row-column multiplication
- Let $a=[\begin{smallmatrix}a_1&a_2&\dots&a_n\end{smallmatrix}]$ be a $1\times n$ row vector and $b=\left[\begin{smallmatrix}b_1\\b_2\\\vdots\\b_n\end{smallmatrix}\right]$, an $n\times 1$ column vector.
- The row-column product of $a$ and $b$ is defined by \[\!\!\!\!\!\!\!\!\!\!ab=[\begin{smallmatrix}a_1&a_2&\dots&a_n\end{smallmatrix}]\left[\begin{smallmatrix}b_1\\b_2\\\vdots\\b_n\end{smallmatrix}\right]=a_1b_1+a_2b_2+\dots+a_nb_n.\]
- Sometimes we write $a\cdot b$ instead of $ab$.
- If $a$ and $b$ have a different number of entries, $ab$ is undefined.
Examples
- $\left[\begin{smallmatrix}1&2\end{smallmatrix}\right]\left[\begin{smallmatrix}3\\-1\end{smallmatrix}\right]=1\cdot 3+2\cdot(-1)=3+(-2)=1$.
- $\left[\begin{smallmatrix}1&2&7\end{smallmatrix}\right]\left[\begin{smallmatrix}3\\-1\end{smallmatrix}\right]$ is not defined.
- $\left[\begin{smallmatrix}2&3&5\end{smallmatrix}\right]\left[\begin{smallmatrix}x\\y\\z\end{smallmatrix}\right]=2x+3y+5z$.
- If $a=\left[\begin{smallmatrix}a_1&a_2&\dots&a_m\end{smallmatrix}\right]$ and $x=\left[\begin{smallmatrix}x_1\\x_2\\\vdots\\x_m\end{smallmatrix}\right]$, then $ax=a_1x_1+a_2x_2+\dots+a_mx_m$.
- So we can write any linear equation as a shorter matrix equation: $ax=b$.
Matrix multiplication
- We want to define $AB$ where $A$ and $B$ are matrices of “compatible” sizes
- This will generalise row-column multiplication
- Idea is to build the new matrix $AB$ from all possible row-column products
- Here's an example:\[ \def\r{\left[\begin{smallmatrix}1&0&5\end{smallmatrix}\right]}\def\rr{\left[\begin{smallmatrix}2&-1&3\end{smallmatrix}\right]}\left[\begin{smallmatrix}1&0&5\\2&-1&3\end{smallmatrix}\right]\left[\begin{smallmatrix} 1&2\\3&4\\5&6\end{smallmatrix}\right]\def\s{\left[\begin{smallmatrix}1\\3\\5\end{smallmatrix}\right]}\def\ss{\left[\begin{smallmatrix}2\\4\\6\end{smallmatrix}\right]}=\left[\begin{smallmatrix}{\r\s}&{\r\ss}\\{\rr\s}&{\rr\ss}\end{smallmatrix}\right]=\left[\begin{smallmatrix}26&32\\14&18\end{smallmatrix}\right].\]

