User Tools

Site Tools


Plugin installed incorrectly. Rename plugin directory '_include' to 'include'.
Plugin installed incorrectly. Rename plugin directory '__include' to 'include'.
lecture_8

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
lecture_8 [2015/02/12 10:52] – [Row-column multiplication] rupertlecture_8 [2016/02/18 10:20] (current) rupert
Line 1: Line 1:
-===== Operations on matrices =====+=== Definition of matrix multiplication ===
  
-We want to define operations on matrices: some (useful) ways of taking two matrices and making a new matrix.+{{page>matrix multiplication}} 
 +=== Examples ===
  
-Before we begin, a remark about $1\times 1$ matrices. These are of the form $[a_{11}]where $a_{11}$ is just a numberThe square brackets $[\,]$ don'really matter here; they just keep the inside of a matrix in one placeSo really: a $1\times 1$ matrix is just a numberThis means that special cases of the operations we define will be operations on ordinary numbersYou should check that in the special case when all the matrices involved are $1\times 1$ matrices, the operations become the ordinary operations on numbersso we are //generalising// the familiar operations (additionsubtractionmultiplication and so on) from numbers to matrices.+  - If $\newcommand{\mat}[1]{\begin{bmatrix}#1\end{bmatrix}} A=\mat{1&0&5\\2&-1&3}and  $B=\mat{1&2\\3&4\\5&6}$, then $AB=\mat{26&32\\14&18}$ and $BA=\mat{5&-2&11\\11&-4&27\\17&-6&43}$. Note that $AB$ and $BA$ are both definedbut $AB\ne BA$ since $AB$ and $BA$ don'even have the [[same size]]. 
 +  - If $A=\mat{1&2\\3&4\\5&6}$, $B=\mat{2&1&1\\1&2&0\\1&0&2\\2&2&1}$ and $C=\mat{1&3&0&7\\0&4&6&8}$, then $A$ is $3\times 2$, $B$ is $4\times 3$ and $C$ is $2\times 4$, so  
 +    * $AB$, $CA$ and $BC$ don't exist (i.e., they are 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$, since in each case one of the matrices doesn't exist. 
 +  - If $A=\mat{0&1\\0&0}$ and $B=\mat{0&0\\1&0}$, then $AB=\mat{1&0\\0&0}$ and $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$. 
 +  - If $A=\mat{1&0\\0&0}$ and $B=\mat{0&0\\0&1}$, then $AB=\mat{0&0\\0&0}$ and $BA=\mat{0&0\\0&0}$. So $AB=BA$ in this case. 
 +  - If $A=0_{n\times n}$ is the $n\times n$ zero matrix and $B$ is any $n\times n$ matrixthen $AB=0_{n\times n}$ and $BA=0_{n\times n}$. So in this casewe do have $AB=BA$. 
 +  - If $A=\mat{1&2\\3&4}$ and $B=\mat{7&10\\15&22}$, then $AB=\mat{37&54\\81&118}=BA$, so $AB=BA$ for these particular matrices $A$ and $B$. 
 +  - If $A=\mat{1&2\\3&4}$ and $B=\mat{6&10\\15&22}$, then $AB=\mat{36&54\\78&118}$ and $BA= \mat{36&52\\81&118}$, so $AB\ne BA$.
  
-==== Matrix addition and subtraction ====+=== Commuting matrices ===
  
-=== Definition of matrix addition ===+{{page>commute}}
  
-{{page>matrix addition}}+Which matrices commute? Suppose $A$ is an $n\times m$ matrix and $B$ is an $\ell\times k$ matrix, and $A$ and $B$ commute, i.e., $AB=BA$.
  
-=== Example === +  * $AB$ must be defined, so $m=\ell$ 
-\\begin{bmatrix}1&2&-2\\3&0&5\end{bmatrix}+\begin{bmatrix}-2&2&0\\1&1&1\end{bmatrix}=\begin{bmatrix}-1&4&-2\\4&1&6\end{bmatrix}.\]+  * $BA$ must be defined, so $k=n$ 
 +  * $AB$ is an $n\times k$ matrix and $BA$ is an $\ell\times n$ matrix. Since $AB$ has the same size as $BA$, we must have $n=\ell$ and $k=m$. 
 +Putting this together: we see that if $A$ and $B$ commute, then $A$ and $B$ must both be $n\times n$ matrices for some number $n$. In other words, they must be //square matrices of the same size//.
  
-=== Example === +Examples 4 and above show that for some square matrices $A$ and $B$ of the same size, it is true that $A$ and $B$ commute. On the other hand, examples 3 and 6 show that it's not true that square matrices of the same size must always commute.
-\[ \begin{bmatrix}1&2&-2\\3&0&5\end{bmatrix}+\begin{bmatrix}-2&2\\1&1\end{bmatrix}\text{ is undefined.}\]+
  
-=== Remarks ===+Because it's not true in general that $AB=BA$, we say that **matrix multiplication is not commutative**.
  
-  - For any matrices $A$ and $B$ with the same size: $A+B=B+A$. We say that matrix addition is //commutative//+=== Definition of the $n\times nidentity matrix ===
-  - For any matrices $A$, $B$ and $C$ with the same size: $(A+B)+C=A+(B+C)$. We say that matrix addition is //associative//.+
  
-=== Definition of the zero matrix ===+{{page>identity matrix}}
  
-{{page>zero matrix}}+=== Examples ===
  
-=== Exercise ===+  - $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!
  
-Show that if $A$ is any $n\times m$ matrix, then  +=== Proposition: properties of $I_n$ === 
-\[ 0_{n\times m}+A=A=A+0_{n\times m}.\] +  - $I_nA=A$ for any $n\times m$ matrix $A$; 
-Remember that when checking that matrices are equalyou have to check that they have the same size, and that all the entries are the same.+  - $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$.
  
 +=== Proof of the proposition ===
  
-=== Definition of matrix subtraction ===+1. We want to show that $I_nA=A$ for any $n\times m$ matrix $A$. These matrices the [[same size]], since $I_n$ has size $n\times n$ and $A$ has size $n\times m$, so $I_n A$ has size $n\times m$ by the definition of [[matrix multiplication]], which is the same as the size of $A$.
  
-{{page>matrix subtraction}+ Note that $\text{row}_i(I_n)=[0~0~\dots~0~1~0~\dots~0]$, where the $1$ is in the $i$th place, by definition of the [[identity matrix]] $I_n$; and the $j$th column of $A$ is $\begin{bmatrix}a_{1j}\\a_{2j}\\\vdots\\a_{nj}\end{bmatrix}$. The (i,j) entry of $I_nA$ is  
- +$\text{row}_i(I_n)\cdot \text{col}_j(A)$, by the definition of [[matrix multiplication]], which is therefore 
-=== Example === +\begin{align*[0~0~\dots~0~1~0~\dots~0]\begin{bmatrix}a_{1j}\\a_{2j}\\\vdots\\a_{nj}\end{bmatrix} &= 0a_{1j}+0a_{2j}+\dots+0a_{i-1,j}+1a_{ij}+0a_{i+1,j}+\dots+0a_{nj} \\&= a_{ij}.\end{align*
-\[ \begin{bmatrix}1&2&-2\\3&0&5\end{bmatrix}-\begin{bmatrix}-2&2&0\\1&1&1\end{bmatrix}=\begin{bmatrix}3&0&-2\\2&-1&4\end{bmatrix}.\+So the matrices $I_nA$ and $A$ have the same size, and the same $(i,j)$ entries, for any $(i,j)$. So $I_nA=A$.
- +
-=== Example === +
-\\begin{bmatrix}1&2&-2\\3&0&5\end{bmatrix}-\begin{bmatrix}-2&2\\1&1\end{bmatrix}\text{ is undefined.}\+
- +
- +
- +
-==== Scalar multiplication ==== +
- +
-=== Definition of a scalar === +
- +
-{{page>scalar}+
- +
-=== Definition of scalar multiplication of matrices === +
- +
-{{page>scalar multiplication of matrices}} +
- +
-=== Example === +
-If $A=\begin{bmatrix}1&0&-3\\3&-4&1\end{bmatrix}$, then $3A=\begin{bmatrix}3&0&-9\\9&-12&3\end{bmatrix}$. In other words, +
-\[ 3\begin{bmatrix}1&0&-3\\3&-4&1\end{bmatrix}=\begin{bmatrix}3&0&-9\\9&-12&3\end{bmatrix}.\+
- +
-=== The negative of a matrix === +
-{{page>matrix negation}+
- +
-=== Exercise === +
-Prove that $A-B=A+(-B)$ for any matrices $Aand $Bof the same size. +
- +
-==== Row-column multiplication ==== +
- +
-=== Definition of row-column multiplication === +
-{{page>row-column multiplication}} +
- +
-=== Examples ===+
  
-  * $\begin{bmatrix}1&2\end{bmatrix}\begin{bmatrix}3\\-1\end{bmatrix}=1\cdot 3+2\cdot(-1)=3+(-2)=1$. 
-  * $\begin{bmatrix}1&2&7\end{bmatrix}\begin{bmatrix}3\\-1\end{bmatrix}$ is not defined. 
-  * $\begin{bmatrix}2&3&5\end{bmatrix}\begin{bmatrix}x\\y\\z\end{bmatrix}=2x+3y+5z$. 
-  * Generalising the previous example: if $a=\begin{bmatrix}a_1&a_2&\dots&a_n\end{bmatrix}$ and $x=\begin{bmatrix}x_1\\x_2\\\vdots\\x_n\end{bmatrix}$, then $ax=a_1x_1+a_2x_2+\dots+a_nx_n$. So we can write any [[linear equation]] $a_1x_1+a_2x_2+\dots+a_nx_n=b$ as a shorter matrix equation: $ax=b$. 
lecture_8.1423738370.txt.gz · Last modified: by rupert

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki