\documentclass[a4paper]{article}
\usepackage{amsmath}

\hbadness=99999
\voffset=-1in
\oddsidemargin=5pt
\textwidth=450pt
\textheight=700pt

\title{Linear Algebra: Week 2 Notes and Exercises}
\author{Christopher Aytona}

\begin{document}
\begin{center}
\Huge{Week 2 Notes and Exercises}
\end{center}

\section{Notes}
\textbf{Matrix operations}\\

Calculate $A+B$ and $A-B$ or state why you can't.\\

a) \[ A=
\begin{bmatrix}
1&0&4\\
-1&2&2\\
0&-2&-3
\end{bmatrix},
B=
\begin{bmatrix}
-1&3&5\\
2&2&-3\\
2&-3&0
\end{bmatrix}
\]
\[ A+B=
\begin{bmatrix}
0&3&9\\
1&4&-1\\
2&-5&-3
\end{bmatrix},
A-B=
\begin{bmatrix}
2&-3&-1\\
-3&0&5\\
-2&1&-3
\end{bmatrix}
\]\\

b) \[ A=
\begin{bmatrix}
-1&0&5&6\\
-4&-3&5&-2
\end{bmatrix},
B=
\begin{bmatrix}
-3&9&-3&4\\
0&-2&-1&2
\end{bmatrix}
\]
\[ A+B=
\begin{bmatrix}
-4&9&2&10\\
-4&-5&4&0
\end{bmatrix}
\]\\

Exercises find $AB$ or state why it doesn't exist.\\

a) \[A=
\begin{bmatrix}
1&0&1\\
0&-1&-1\\
-1&1&0
\end{bmatrix},
B=
\begin{bmatrix}
0&1&-1\\
1&-1&0\\
-1&0&1
\end{bmatrix}
\]

b) \[A=
\begin{bmatrix}
4&-3\\
3&-1\\
0&-2\\
-1&5
\end{bmatrix},
B=
\begin{bmatrix}
-1&3&2&2\\
0&-1&4&3
\end{bmatrix}
\]\\

\section{Exercise 2.1}
Questions 1,2,3,7,8,9,10,12\\

In Exercise 1 and 2, compute each matrix sum or product if it is defined. If an expression is undefined, explain why. Let
$A=
\begin{bmatrix}
2&0&-1\\
4&-5&2
\end{bmatrix},
B=
\begin{bmatrix}
7&-5&1\\
1&-4&-3
\end{bmatrix},
C=
\begin{bmatrix}
1&2\\
-2&1
\end{bmatrix},
D=
\begin{bmatrix}
3&5\\
-1&4
\end{bmatrix},
E=
\begin{bmatrix}
-5\\
3
\end{bmatrix}
$.\\

\textbf{Sum}\\
\[A+B =
\begin{bmatrix}
2+7&0+(-5)&-1+1\\
4+1&-5+(-4)&2+(-3)
\end{bmatrix}=
\begin{bmatrix}
9&-5&0\\
5&-9&-1
\end{bmatrix}
\]

\[C+D =
\begin{bmatrix}
1+3&2+5\\
-2+(-1)&1+4
\end{bmatrix}=
\begin{bmatrix}
4&2\\
-3&5
\end{bmatrix}
\]
Rest of matrices can't be added together since they don't have the same dimensions.\\

\textbf{Product}\\
\[C_{2\times2} \cdot A_{2\times3}=
\begin{bmatrix}
1\cdot2+2\cdot4&1\cdot 0+2\cdot-5&1\cdot-1+2\cdot2\\
-2\cdot2+1\cdot4&-2\cdot0+1\cdot-5&-2\cdot-1+1\cdot2
\end{bmatrix}=
\begin{bmatrix}
10&-10&3\\
0&-5&4
\end{bmatrix}
\]

\[C_{2\times2} \cdot B_{2\times3}=
\begin{bmatrix}
1\cdot7+2\cdot1&1\cdot-5+2\cdot-4&1\cdot1+2\cdot-3\\
-2\cdot7+1\cdot1&-2\cdot-5+1\cdot-4&-2\cdot1+1\cdot-3
\end{bmatrix}=
\begin{bmatrix}
9&-13&-5\\
-13&6&-5
\end{bmatrix}
\]

\[C_{2\times2} \cdot D_{2\times2}=
\begin{bmatrix}
1\cdot3+2\cdot5&1\cdot5+2\cdot4\\
-2\cdot3+1\cdot-1&-2\cdot5+1\cdot4
\end{bmatrix}=
\begin{bmatrix}
13&13\\
-7&-5
\end{bmatrix}
\]

\[C_{2\times2} \cdot E_{2\times1}=
\begin{bmatrix}
1\cdot-5+2\cdot3\\
-2\cdot-5+1\cdot3
\end{bmatrix}=
\begin{bmatrix}
1\\
13
\end{bmatrix}
\]

\[D_{2\times2} \cdot A_{2\times3}=
\begin{bmatrix}
3\cdot2+5\cdot4&3\cdot0+5\cdot-5&3\cdot-1+5\cdot2\\
-1\cdot2+4\cdot4&-1\cdot0+4\cdot-5&-1\cdot-1+4\cdot2
\end{bmatrix}=
\begin{bmatrix}
26&-25&7\\
6&-20&9
\end{bmatrix}
\]

\[D_{2\times2} \cdot B_{2\times3}=
\begin{bmatrix}
3\cdot7+5\cdot1&3\cdot-5+5\cdot-4&3\cdot1+5\cdot-3\\
-1\cdot7+4\cdot1&-1\cdot-5+4\cdot-4&-1\cdot1+4\cdot-3
\end{bmatrix}=
\begin{bmatrix}
26&-35&-12\\
-3&-11&-13
\end{bmatrix}
\]

\[D_{2\times2} \cdot E_{2\times1}=
\begin{bmatrix}
3\cdot-5+5\cdot3\\
-1\cdot-5+4\cdot3
\end{bmatrix}=
\begin{bmatrix}
0\\
17
\end{bmatrix}
\]
Rest of matrices can't have a dot product since they don't have the required dimensions.\\

1) \\
\[-2A = 2\cdot
\begin{bmatrix}
2&0&-1\\
4&-5&2
\end{bmatrix}=
\begin{bmatrix}
2\cdot2&2\cdot0&2\cdot-1\\
2\cdot4&2\cdot-5&2\cdot2
\end{bmatrix}=
\begin{bmatrix}
4&0&-2\\
8&-10&2
\end{bmatrix}
\]

\[B - 2A=
\begin{bmatrix}
7&-5&1\\
1&-4&-3
\end{bmatrix}+
\begin{bmatrix}
4&0&-2\\
8&-10&2
\end{bmatrix}=
\begin{bmatrix}
11&-5&-1\\
9&-14&-1
\end{bmatrix}
\]\\
$A_{2\times3} \cdot C_{2\times2}$ can't have a dot product because they don't have the proper dimensions.\\
\[C D=
\begin{bmatrix}
1\cdot3+2\cdot5&1\cdot5+2\cdot4\\
-2\cdot3+1\cdot-1&-2\cdot5+1\cdot4
\end{bmatrix}=
\begin{bmatrix}
13&13\\
-7&-5
\end{bmatrix}
\]\\

2) \\

\[A +2B=
\begin{bmatrix}
2&0&-1\\
4&-5&2
\end{bmatrix}+2
\begin{bmatrix}
7&-5&1\\
1&-4&-3
\end{bmatrix}=
\begin{bmatrix}
2&0&-1\\
4&-5&2
\end{bmatrix}+
\begin{bmatrix}
14&-10&2\\
2&-8&-6
\end{bmatrix}=
\begin{bmatrix}
16&-10&1\\
6&-13&-4
\end{bmatrix}
\]

$3C-E$ can't have a sum because they don't have the same dimensions.\\

\[C \cdot B=
\begin{bmatrix}
1\cdot7+2\cdot1&1\cdot-5+2\cdot-4&1\cdot1+2\cdot-3\\
-2\cdot7+1\cdot1&-2\cdot-5+1\cdot-4&-2\cdot1+1\cdot-3
\end{bmatrix}=
\begin{bmatrix}
9&-13&-5\\
-13&6&-5
\end{bmatrix}
\]

$EB$ can't have a dot product because they don't have the proper dimensions.\\

3) Let $A = \begin{bmatrix}
4&-1\\
5&-2
\end{bmatrix}$. Compute $3I_2 - A$ and $(3I_2)A$.

\[3I_2-A=3\cdot
\begin{bmatrix}
1&0\\
0&1
\end{bmatrix}-
\begin{bmatrix}
4&-1\\
5&-2
\end{bmatrix}=
\begin{bmatrix}
3&0\\
0&3
\end{bmatrix}-
\begin{bmatrix}
4&-1\\
5&-2
\end{bmatrix}=
\begin{bmatrix}
-1&0\\
-5&5
\end{bmatrix}
\]

\[(3I_2)A =
\begin{bmatrix}
3&0\\
0&3
\end{bmatrix}\cdot
\begin{bmatrix}
4&-1\\
5&-2
\end{bmatrix}=
\begin{bmatrix}
3\cdot4+0\cdot5&3\cdot-1+0\cdot-2\\
0\cdot4+3\cdot5&0\cdot-1+3\cdot-2
\end{bmatrix}=
\begin{bmatrix}
12&-3\\
15&-6
\end{bmatrix}
\]\\

7) If a matrix $A$ is $5\times3$ and the product $AB$ is $5\times7$, what is the size of $B$?\\
$A_{5\times3} \cdot B_{x \times y}=AB_{5\times7}$. To be able to multiply $AB$, the column number of $A$ has to be the same as the row number of $B$. Since $AB$ has a size of $5\times3$, the row size came from the row size of $A$ and the column size came from the column size $B$. Therefore, $B_{3\times7}$.\\

8) How many rows does $B$ have if $BC$ is a $3\times4$ matrix?\\
$B = 3$ rows.\\

9) Let $A = \begin{bmatrix}
2&5\\
-3&1
\end{bmatrix}, B = \begin{bmatrix}
4&-5\\
3&k
\end{bmatrix}$. What value(s) of $k$, if any, will make $AB = BA$?\\

\[A \cdot B=
\begin{bmatrix}
2\cdot4+5\cdot3&2\cdot-5+5\cdot k\\
-3\cdot4+1\cdot3&-3\cdot-5+1\cdot k
\end{bmatrix}=
\begin{bmatrix}
23&5k-10\\
-9&k+15
\end{bmatrix}
\]
\[B \cdot A=
\begin{bmatrix}
4\cdot2+(-5)\cdot-3&4\cdot5+(-5)\cdot1\\
3\cdot2+k\cdot-3&3\cdot5+k\cdot1
\end{bmatrix}=
\begin{bmatrix}
23&15\\
-3k+6&k+15
\end{bmatrix}
\]
\[if
\begin{bmatrix}
23&5k-10\\
-9&k+15
\end{bmatrix}=
\begin{bmatrix}
23&15\\
-3k+6&k+15
\end{bmatrix}, then
\begin{bmatrix}
23&5k-10\\
-9&k+15
\end{bmatrix} -
\begin{bmatrix}
23&15\\
-3k+6&k+15
\end{bmatrix} =
\begin{bmatrix}
0&0\\
0&0
\end{bmatrix}
\]
\[AB - BA =
\begin{bmatrix}
23-(23)&5k-10-(15)\\
-9-(-3k+6)&k+15-(k+15)
\end{bmatrix}=
\begin{bmatrix}
0&5k-25\\
3k-15&0
\end{bmatrix}
\]
$$5k-25=0, 5k=25, k=5$$
$$3k-15=0, 3k=15, k=5$$\\

10) Let $A =
\begin{bmatrix}
2&-3\\
-4&6
\end{bmatrix},
B = 
\begin{bmatrix}
8&4\\
5&5
\end{bmatrix},
C =
\begin{bmatrix}
5&-2\\
3&1
\end{bmatrix}$. Verify that $AB = AC$ and yet $B \neq C$.\\

The cancellation laws do not hold for matrix multiplication. Such that $$AB=AC$$ $$\frac{A}{A}B = C$$ $$I_AB = C$$ $$B = C$$\\
\[A \cdot B =
\begin{bmatrix}
2\cdot8+(-3)\cdot5&2\cdot4+(-3)\cdot5\\
-4\cdot8+6\cdot5&-4\cdot4+6\cdot5
\end{bmatrix} =
\begin{bmatrix}
1&-7\\
-2&14
\end{bmatrix}
\]

\[A \cdot C =
\begin{bmatrix}
2\cdot5+(-3)\cdot3&2\cdot-2+(-3)\cdot1\\
-4\cdot5+6\cdot3&-4\cdot-2+6\cdot1
\end{bmatrix} =
\begin{bmatrix}
1&-7\\
-2&14
\end{bmatrix}
\]

\[
\begin{bmatrix}
1&-7\\
-2&14
\end{bmatrix} =
\begin{bmatrix}
1&-7\\
-2&-2
\end{bmatrix}
\]\\

12) Let $A = 
\begin{bmatrix}
3&-6\\
-1&2
\end{bmatrix}$. Construct a $2\times2$ matrix $B$ such that $AB$ is the zero matrix. Use two different non-zero columns for $B$.\\

Consider $B = \begin{bmatrix}
b_1&b_2\\
b_3&b_4
\end{bmatrix}$, then $Ab_1 = 0$ and $Ab_2 = 0$ or $Ab_3 = 0$ and $Ab_4 = 0$.

\[B = 
\begin{bmatrix}
2&2\\
1&1
\end{bmatrix}
\]

\[A \cdot B =
\begin{bmatrix}
3\cdot2+(-6)\cdot1&3\cdot2+(-6)\cdot1\\
-1\cdot2+2\cdot1&-1\cdot2+2\cdot1
\end{bmatrix} =
\begin{bmatrix}
0&0\\
0&0
\end{bmatrix}
\]\\

\section{Exercise 2.2}
Questions 1,2,3,4,5,6,7a,8,29-32\\

Find the inverse of the matrices in Exercise 1-4.\\

1) $\begin{bmatrix}
8&6\\
5&4
\end{bmatrix}$

\[A^{-1} = 
\begin{bmatrix}
8&6&|&1&0\\
5&4&|&0&1
\end{bmatrix} = \frac{1}{8}R_1 , -\frac{1}{5}R_2
\begin{bmatrix}
\frac{1}{8}(8)&\frac{1}{8}(6)&|&\frac{1}{8}(1)&\frac{1}{8}(0)\\
-\frac{1}{5}(5)&-\frac{1}{5}(4)&|&-\frac{1}{5}(0)&-\frac{1}{5}(1)
\end{bmatrix}\]
\[
\begin{bmatrix}
1&\frac{3}{4}&|&\frac{1}{8}&0\\
-1&-\frac{4}{5}&|&0&-\frac{1}{5}
\end{bmatrix} = R_2+R_1
\begin{bmatrix}
1&\frac{3}{4}&|&\frac{1}{8}&0\\
-1+1&-\frac{4}{5}+\frac{3}{4}&|&0+\frac{1}{8}&-\frac{1}{5}+0
\end{bmatrix}
\]
\[
\begin{bmatrix}
1&\frac{3}{4}&|&\frac{1}{8}&0\\
0&-\frac{1}{20}&|&\frac{1}{8}&-\frac{1}{5}
\end{bmatrix} =R_2\times20
\begin{bmatrix}
1&\frac{3}{4}&|&\frac{1}{8}&0\\
0\times-20&-\frac{1}{20}\times-20&|&\frac{1}{8}\times-20&-\frac{1}{5}\times-20
\end{bmatrix}
\]
\[
\begin{bmatrix}
1&\frac{3}{4}&|&\frac{1}{8}&0\\
0&1&|&-2\frac{1}{2}&4
\end{bmatrix} = R_1-\frac{3}{4}R_2
\begin{bmatrix}
1-\frac{3}{4}(0)&\frac{3}{4}-\frac{3}{4}(1)&|&\frac{1}{8}-\frac{3}{4}(-\frac{5}{2})&0-\frac{3}{4}(4)\\
0&1&|&-2\frac{1}{2}&4
\end{bmatrix}
\]
\[A^{-1} =
\begin{bmatrix}
1&0&|&2&-3\\
0&1&|&-2\frac{1}{2}&4
\end{bmatrix}
\]\\

2) $\begin{bmatrix}
3&2\\
7&4
\end{bmatrix}$

\[A^{-1} =
\begin{bmatrix}
3&2&|&1&0\\
7&4&|&0&1
\end{bmatrix} = R_1-\frac{1}{2}R_2
\begin{bmatrix}
3-\frac{1}{2}(7)&2-\frac{1}{2}(4)&|&1-\frac{1}{2}(0)&0-\frac{1}{2}(1)\\
7&4&|&0&1
\end{bmatrix}
\]
\[
\begin{bmatrix}
-\frac{1}{2}&0&|&1&-\frac{1}{2}\\
7&4&|&0&1
\end{bmatrix} = R_1\times-2
\begin{bmatrix}
-\frac{1}{2}\times-2&0\times-2&|&1\times-2&-\frac{1}{2}\times-2\\
7&4&|&0&1
\end{bmatrix}
\]
\[
\begin{bmatrix}
1&0&|&-2&1\\
7&4&|&0&1
\end{bmatrix} = R_2-7(R_1)
\begin{bmatrix}
1&0&|&-2&1\\
7-7(1)&4-7(0)&|&0-7(-2)&1-7(1)
\end{bmatrix}
\]
\[
\begin{bmatrix}
1&0&|&-2&1\\
0&4&|&14&-6
\end{bmatrix}= \frac{1}{4}R_2
\begin{bmatrix}
1&0&|&-2&1\\
\frac{1}{4}(0)&\frac{1}{4}(4)&|&\frac{1}{4}(14)&\frac{1}{4}(-6)
\end{bmatrix}
\]
\[A^{-1} =
\begin{bmatrix}
1&0&|&-2&1\\
0&1&|&3\frac{1}{2}&-1\frac{1}{2}
\end{bmatrix}
\]\\

3) $\begin{bmatrix}
8&5\\
-7&-5
\end{bmatrix}
$

\[A^{-1} =
\frac{1}{-40-(-35)}
\begin{bmatrix}
8&5\\
-7&-5
\end{bmatrix} =
-\frac{1}{5}
\begin{bmatrix}
8&5\\
-7&-5
\end{bmatrix} =
\begin{bmatrix}
-\frac{8}{5}&-1\\
\frac{7}{5}&1
\end{bmatrix}
\]\\

4) $\begin{bmatrix}
3&-4\\
7&-8
\end{bmatrix}$

\[A^{-1} =
\frac{1}{-24-(28)}
\begin{bmatrix}
3&-4\\
7&-8
\end{bmatrix} =
\frac{1}{4}
\begin{bmatrix}
3&-4\\
7&-8
\end{bmatrix} =
\begin{bmatrix}
\frac{3}{4}&-1\\
\frac{7}{4}&-2
\end{bmatrix}
\]
\end{document}