% Created 2020-06-18 Thu 22:56
% Intended LaTeX compiler: pdflatex
\documentclass[11pt]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{graphicx}
\usepackage{grffile}
\usepackage{longtable}
\usepackage{wrapfig}
\usepackage{rotating}
\usepackage[normalem]{ulem}
\usepackage{amsmath}
\usepackage{textcomp}
\usepackage{amssymb}
\usepackage{capt-of}
\usepackage{hyperref}
\hypersetup{colorlinks=true,linkcolor=blue}
\usepackage[margin=0.5in]{geometry}
\author{Harry Ying}
\date{}
\title{Linear Algebra Notes}
\hypersetup{
 pdfauthor={Harry Ying},
 pdftitle={Linear Algebra Notes},
 pdfkeywords={},
 pdfsubject={},
 pdfcreator={Emacs 26.3 (Org mode 9.1.9)},
 pdflang={English}}
\begin{document}

\maketitle
\tableofcontents \clearpage
\section{Chapter 1}
\label{sec:orgf2e74a8}
\subsection{\(\S\) 1}
\label{sec:orge295bc8}
\subsubsection{Notes}
\label{sec:orgdc1d6b8}
A generic vector space \(V\) is not a field because there is no definition of \(v^{-1}\) for some \(v\in V\), fulfilling not the definition of a field.\\
\begin{enumerate}
\item \textbf{Pg. 4 Proof of \((-1)v=v\)}
\label{sec:orga05d18b}
$$\begin{aligned}
(-1)v+v&=(-1)v+1\cdot v\\
&=(-1+1)v\\
&=v+(-v)
\end{aligned}$$
Thus, \((-1)v=-v\).
\item \textbf{Pg. 6 Proof of SP 3}
\label{sec:org03da356}
$$\begin{aligned}
(xA)\cdot B&=\sum\limits_{i=1}^{n}(xa_i) b_{i}\\
&=\sum\limits_{i=1}^{n}x(a_i b_{i})\\
&=x\sum\limits_{i=1}^{n} a_i b_{i}\\
&=x(A\cdot B)\\
A\cdot (xB)&=\sum\limits_{i=1}^{n}a_i (xb_{i})\\
&=\sum\limits_{i=1}^{n}x(a_i b_{i})\\
&=x\sum\limits_{i=1}^{n} a_i b_{i}\\
&=x(A\cdot B)
\end{aligned}$$
\item \textbf{\textbf{Pg. 7}}
\label{sec:orge2faa83}

\label{org581f974}
Upper one:
$$\begin{aligned}
(A+B)^2&=(A+B)\cdot (A+B)\\
&=(A+B)\cdot A+(A+B)\cdot B && \text{Use SP 2}\\
&=A^2+B\cdot A+A\cdot B+B^2 && \text{Use SP 1}\\
\end{aligned}$$
Bottom one:
Since \(K\) is a field, all \textbf{VS} s regarding summation or product of functions are actually closed on \(K\). By applying field axioms, \(V\) is then a vector space over \(K\).
\item \textbf{\textbf{Pg. 9}}
\label{sec:orgd14d931}

\label{org85de33c}
Let \(a_1=(u_1+w_1),a_2=(u_2+w_2)\). Both of them \(\in (U+W)\).\\
Since \(U,W\) are subspaces of \(V\), \(U,W\in V\). Thus, \(a_1,a_2 \in V\) as \(u_1,w_1,u_2,w_2\in V\), moreover, \((U+W)\subset V\).\\
\(a_1+a_2=(u_1+u_2)+(w_1+w_2)\in (U+W)\) \\
\(ca_1=c(u_1+w_1)=(cu_1)+(cw_1)\in (U+W)\) \\
Since \(O\in U\) and \(O\in W\), \(O=O+O\in (U+W)\). Thus, \((U+W)\) is a subspace of \(V\).
\end{enumerate}
\subsubsection{Exercises}
\label{sec:org4bc2bdd}
\begin{enumerate}
\item \textbf{Exercise 1}
\label{sec:org1dda14d}
Let \(v\in{} V\), \(c[v+(-v)]=cv+c(-v)=cv+(-c)v=v\cdot{}0=v\cdot{}(1-1)=v+(-v)=O\)
\item \textbf{Exercise 2}
\label{sec:orgf14d969}
Since \(c\not = 0\)
$$\begin{aligned}
O&=cv+[-(cv)]\\
cv&=cv+[-(cv)]\\
O&=-(cv)\\
\frac{-1}{c}\cdot O &= (-c)v\cdot \frac{-1}{c}\\
\frac{-1}{c}\cdot (v-v) &= v\\
\frac{-1}{c}\cdot v+ \frac{1}{c}\cdot v &= v\\
v\cdot (1-1)&=v\\
v-v&=v\\
O&=v
\end{aligned}$$
\item \textbf{Exercise 3}
\label{sec:orga2b4f2c}

\(\forall g\in V, (g+f)(x) = g(x)+f(x) = f(x)+g(x) = (f+g)(x) \Rightarrow g+f = f+g\).\\
If \(O+u = u\), \((O+u)(x) = O(x)+u(x)= u(x)\). Therefore, \(O(x)=0\).
\item \textbf{Exercise 4}
\label{sec:orgec0ece9}
$$\begin{aligned}
v+w&=O\\
v+w&=v+(-v)\\
w&=-v
\end{aligned}$$
\item \textbf{Exercise 5}
\label{sec:orgc5d171e}
$$\begin{aligned}
v+w&=v\\
v+(-v)+w&=v+(-v)\\
O+w&=O
\end{aligned}$$
Since \(\forall u, O+u=u\), we have \(w=O\).
\item \textbf{Exercise 6}
\label{sec:org6097804}

Let \(W=\{B| B\cdot A_{1}=O\ \text{and}\ B\cdot A_2=O\}\). Specifically, it is clear that \(O\in W\) as \(O\cdot A = \sum\limits_{i=1}^{n} b_i a_i=\sum\limits_{i=1}^{n} 0\times a_i=0\).\\
Let \(v_1,v_2 \in W\) such that \(v_1\cdot A_1=0\), \(v_1\cdot A_2=0\), \(v_2\cdot A_1=0\), \(v_2\cdot A_2=0\). Thus,
$$\begin{aligned}
(v_1+v_2)\cdot A_1&=v_1\cdot A_1+v_2\cdot A_1\\
&=O+O\\
&=O\\
[c(v_1+v_2)]\cdot A_1&=(cv_1+cv_2)\cdot A_1\\
&=(cv_1)\cdot A_1+(cv_2)\cdot A_1\\
&=c(v_1\cdot A_1+v_2\cdot A_1)\\
&=cO\\
&=O
\end{aligned}$$.
It is easy to show for \(A_2\) then. Therefore, \((v_1+v_2)\in W\).
\item \textbf{Exercise 7}
\label{sec:org3fe25c7}
Same to apply as Exercise 6.
\item \textbf{Exercise 8}
\label{sec:org9a83e43}

Name the set as \(W\).
\begin{enumerate}
\item Proof
\label{sec:org9a4fd70}

\(v_1+v_2=(x_1+x_2,y_1+y_2), x_1+x_2=y_1+y_2 \Rightarrow (v_1+v_2)\in W\) \\
\(cv=(cx,cy), cx=cy \Rightarrow cv\in W\) \\
\(O=(0,0)\in W\)
\item Proof
\label{sec:orgdce2172}
See Part (a).
\item Proof
\label{sec:org3b4397e}
Same technique as in Part (a).
\end{enumerate}
\item \textbf{Exercise 9}
\label{sec:orga5a379d}
See Exercise 8.
\item \textbf{Exercise 10}
\label{sec:org1d52f62}

For \(U\cap W\), let \(v_1,v_2\in U\cap W\). Since \(v_1, v_2\in U\) and \(U\) is a subspace, \(v_1+v_2\in U\). In same way, we can see that \(v_{1}+v_2\in W\). Thus, \(v_1+v_2\in U\cap W\).\\
Since \(v_1\in U\), \(cv_1\in U\). Also, it shows \(cv_1\in W\) in the same way. Thus, \(cv_{1}\in U\cap W\).
Because \(U, W\) are subspaces, \(O\in U\) and \(O\in W\). Thus, \(O\in U\cap W\). Therefore, \(U\cap W\) is a subspace.\\
Refer to the \hyperref[org85de33c]{note part} for proof for \(U+W\).
\item \textbf{Exercise 11}
\label{sec:org3a7bee7}
Since \(L\) is a field, \textbf{VS1, VS3, VS4, VS8} are established under field axioms, and multiplication and addition are closed in \(L\). For \textbf{VS5, VS6, VS7}, they are all valid as \(K\subset L\). \(O\) is simply \(0\), and \(1\cdot u=u\) is  established in \(L\).
\item \textbf{Exercise 12}
\label{sec:org2a908d4}

For \(x,y\in K\), we have\\
\(x+y=a_1+b_1\sqrt{2}+a_2+b_2\sqrt{2}=(a_1+a_2)+(b_1+b_2)\sqrt{2}\). Since \(a_1,b_1,a_2,b_2\in \mathbb{Q}\), \((a_1+a_2),(b_1+b_2)\in\mathbb{Q}\). Thus, \(x+y\in K\).\\
\(xy=(a_1 a_2+ 2b_1 b_2)+(a_2 b_1 + a_1 b_2)\times \sqrt{2}\). Since \(a_1,b_1,a_2,b_2\in \mathbb{Q}\), \((a_1 a_2+ 2b_1 b_2),(a_2 b_1 + a_1 b_2)\in\mathbb{Q}\). Thus, \(x+y\in K\).\\
\(-x=-a+-b\sqrt{2}\). Since \(a,b\in\mathbb{Q}\), \(-a,-b\in\mathbb{Q}\). Thus, \(-x\in K\).\\
If \(a+b\sqrt{2}\not = 0\), \(a,b\not = 0\), and \(a-b\sqrt{2}\not = 0\). Thus, \(x^{-1}=\frac{1}{a+b\sqrt{2}}=\frac{a-b\sqrt{2}}{a^2-2b^{2}}=\frac{a}{a^2-2b^2}-\frac{b}{a^2-2b^2}\sqrt{2}\). It is easy to see that \textbf{new} \(a,b\in\mathbb{Q}\) as \(a,b\in\mathbb{Q}\). Thus, \(x^{-1}\in K\).
Specifically, if \(a=b=0\), \(0\in\mathbb{Q}\). If \(a=1,b=0\), \(1\in\mathbb{Q}\).\\
Thus, \(K\) is a field.
\item \textbf{Exercise 13}
\label{sec:org635f6b8}
Same technique as Exercise 12.
\item \textbf{Exercise 14}
\label{sec:org5be232e}
Same technique as Exercise 12.
\end{enumerate}
\subsection{\(\S\) 2}
\label{sec:org98b9de7}
\subsubsection{Notes}
\label{sec:org9a59fd9}
\label{orgb6c34b8}
Another quite helpful equivalent of definition of linear independence is that (stated following without loss of generality)
$$\forall a_i\in K \text{ and some } a_i\not = 0, \text{ we have }a_1 v_1\not =\sum\limits_{i=2}^n a_iv_i$$
Here is the \emph{proof} of equivalence between above statement and definition of linear independence.\\
$$\begin{aligned}
a_1 v_1&\not =\sum\limits_{i=2}^n a_iv_i\\
O &\not = \sum\limits_{i=1}^n a_iv_i
\end{aligned}$$
This means as long as \textbf{some} \(a_i\not =0\), \(O \not = \sum\limits_{i=1}^n a_iv_i\). In other words, only if all \(a_i=0\), \(O = \sum\limits_{i=1}^n a_iv_i\). This means any \(v_i\) fulfilling our statement are linear independent. Conversely, if \(v_i\) are linear independent, it is clear that as long as \textbf{not all} \(v_i=0\), \(a_1 v_1\not =\sum\limits_{i=2}^n a_iv_i\), which is equal to our statement.\\
A simple but useful variation of this is
$$\forall v_i\in K, v_1\not = \sum\limits_{i=2}^n x_iv_i$$
\emph{Proof}. We see that
$$\begin{aligned}
O&\not = -v_1+\sum\limits_{i=2}^n x_iv_i\\
O&\not = (-\lambda)v_1+\sum\limits_{i=2}^n \lambda x_iv_i && \lambda\not = 0\text{ (If } \lambda=0 \text{ inequality holds not)}
\end{aligned}$$
Since \(\lambda\) and \(v_i\) can be arbitrary and they cannot be \(0\) all at once, we see it falls into the case of original statement.\\
Also, another point that worth paying attention to is that generators could be \textbf{linear dependent}. This is true because you could put arbitrary vectors at the end of a basis of a vector space and just set coefficients for these extraneous vectors when it is producing new linear combinations.
\subsubsection{Exercises}
\label{sec:org3700ffa}
\begin{enumerate}
\item \textbf{Exercise 1}
\label{sec:org8dd9f73}
Using result from \hyperref[org0fd46de]{\textbf{Exercise 4}}, easy to prove.
\item \textbf{Exercise 2}
\label{sec:org05b0564}
\begin{enumerate}
\item \((1,-1)\)
\label{sec:orgc25c944}
\item \((\frac{1}{2},\frac{3}{2})\)
\label{sec:org5764822}
\item \((1,1)\)
\label{sec:org2fdea08}
\item \((3,2)\)
\label{sec:org6878334}
\end{enumerate}
\item \textbf{Exercise 3}
\label{sec:org761871a}
\begin{enumerate}
\item \((\frac{1}{3},-\frac{1}{3},\frac{1}{3})\)
\label{sec:org55332ce}
\item \((1,0,1)\)
\label{sec:org0e22c06}
\item \((\frac{1}{3},-\frac{1}{3},-\frac{2}{3})\)
\label{sec:org9c702e5}
\end{enumerate}
\item \textbf{Exercise 4}
\label{sec:org529bd82}
\label{org0fd46de}

Following set of equations is an equivalent of \(x(a,b)+y(c,d)=O\),
$$\begin{aligned}
ax+cy&=0 && (1)\\
bx+dy&=0 && (2)\\
\end{aligned}$$
$$\begin{aligned}
(1)\times d-(2)\times c\Rightarrow (ad-cb)x+cdy-cdy &= 0\\
(ad-cb)x&=0\\
\end{aligned}$$
For \(ad-cb\not =0\) part, clearly we shall see that \(x=0\) as \((ad-cb)x=0\). Plugging \(x\) back to \((1)\), we get \(y=0\). Thus, two vectors are linear independent.\\
For \(ad-cb=0\) part, we need to prove that \(x(a,b)+y(c,d)=O\) has solution other than \(x=y=0\).\\
First, suppose \(a,b,c,d\not = 0\). Since \(ad-cb=0\), \(x\in \mathbb{R}\). By applying technique, we could also show \(y\in \mathbb{R}\). Thus, \((a,b),\ (c,d)\) are linear independent.\\
If \(a,b,c,d\not = 0\) does \textbf{NOT} hold. Without lose of generality (for all the possibilities, \(a,d\) and \(c.b\) are interchangeable), consider following scenarios in a \(xy\) -plane,
\begin{enumerate}
\item \(a=0,c=0\)
\label{sec:org36c5f85}

If \(a=c=0\), \(x,y\in \mathbb{R}\) in \((1)\). Because the \((2)\) is a line in the plane, there must exist some \(x,y\not = 0\).
\item \(a=0,b=0,c=0\)
\label{sec:org7b99c94}

Same argument as above, despite the line represented by \((2)\) is a little bit peculiar (it is \(y=0\)).
\item \(a=0,d=0,c=0\)
\label{sec:org6e82128}

Same argument as the first, despite the line represented by \((2)\) is a little bit peculiar (it is \(x=0\)).
\item \(a=0,d=0,b=0,c=0\)
\label{sec:org70b4ce7}

Both \((1), (2)\) represent the whole plane, thus, \(x,y\in \mathbb{R}\).
\end{enumerate}
\item \textbf{Exercise 5,6}
\label{sec:org65f483c}

To correctly understand how could functions be elements(vectors) in vector space, we need to understand that function \(f:S\rightarrow K\) is essentially a set of pairs \((s,k),\forall s\in S\). Functions have scalar multiplication and addition defined.\\
\(f+g\) is defined as \(\{(s,f(s)+g(s))|s\in S\}\), and \(cf, c\in K\) is defined as \(\{(s,c\cdot f(s))|s\in S\}\).\\
It is easy to verify that \(V\) of every \(f:S \rightarrow K\) is a vector space over \(K\). Particularly, \(O\) for \(V\) is \(\{(s,0)|s\in S\}\). So like other vector spaces, linear dependence is \textbf{about}
$$f_{sum}=\sum\limits_{i=1}^n a_if_i=O$$
Since right-hand-side of the equation is \(\{(s,0)|s\in S\}\), we can say that \(\forall v\in V, f_sum (s)=0\). This is useful in solving problems in \textbf{Exercise 5} and \textbf{Exercise 6}.\\
For example, we need to show that \(f(s)=1\) and \(g(s)=t\) are linear independent. This means that we need to consider following equation,
$$af+bg=O$$
which is an equivalent of
$$\forall t,a+bt=0$$
Above conversion is quite helpful since we could put in arbitrary \(t\) and the equation should hold. Thus, we could put in particular values of \(t\) to \textbf{construct} set of equations to show that \(a=b=0\). For example, here we plug in \(t=0\), then \(a=0\), and if we plug back \(a=0\) into original equation with \(t=0\) again, \(b=0\).\\
This method could be used throughout \textbf{Exercise 5,6}.
\item \textbf{Exercise 7}
\label{sec:org7413c47}
\((3,5)\)
\item \textbf{Exercise 8}
\label{sec:org8c69f0f}
\emph{\textbf{Calculus involved, not doing now.}}
\item \textbf{Exercise 9}
\label{sec:org07706a6}
$$\begin{aligned}
\sum\limits_{i=1}^{r} [a_i\cdot (A_i\cdot \sum\limits_{j=i+1}^{r}A_{j})]&=O && \text{All vectors are mutually perpendicular}\\
&=\sum\limits_{i=1}^{r} [(a_i\cdot A_i)\cdot \sum\limits_{j=i+1}^{r}A_{j}]\\
\end{aligned}$$
Since \(\forall A\in \{A_i\}, A\not = O\), it is only possible that every \(a\) is \(0\). Thus, \({A_i}\) are linearly independent.
\item \textbf{Exercise 10}
\label{sec:org1007918}

Since \(v,w\) are linear dependent, for
$$nv+mw=O$$
at least one of \(n,m\not =0\).
Consider following scenarios, we can see that there would be \(a=0\) or \(a=-\frac{n}{m}\).
\begin{enumerate}
\item \(n=0,m\not =0 \Rightarrow w=O\)
\label{sec:org1f58ac7}
\item \(n\not =0,m =0 \Rightarrow v=O\).
\label{sec:org6d768ab}
This contradicts with \(v\not =O\) in problem. Thus, this is impossible.
\item \(n\not = 0, m\not =0 \Rightarrow w=\frac{-n}{m}v\)
\label{sec:orge536b39}
\end{enumerate}
\end{enumerate}
\subsection{\(\S\) 3}
\label{sec:org9b561c9}
\subsubsection{Notes}
\label{sec:orge6853d5}
This subsection comprises a lot of concise proofs. But in conclusion, we need to know that
$$\begin{aligned}
\text{Basis}&\Leftrightarrow \text{Maximal linear independent vector set} && \text{proof at }\bold{Theorem 3.1}\\
\text{Basis}&\Leftrightarrow \text{Maximal linear indpendent vector set} \Rightarrow \text{Generators} && \text{proof at }\bold{Theorem 2.2}\\
\text{Generators} &\nRightarrow \text{Basis} && \text{Generators are not always linear independent.}
\end{aligned}$$
Thus, all possible bases of a vector space \(V\) are of one and only one possible number of elements, which is equal to the one of maximal independent vector set.
\subsection{\(\S\) 4}
\label{sec:org6b50779}
\subsubsection{Notes}
\label{sec:orgb7b4115}
\emph{Proof} for $$\dim (U\times W)=\dim U+\dim W$$
Because \(\forall u\in (U\times W) ,(O_u+O_w)+u=u+(O_u+O_w)=u\). Thus, by definition, \(O=(O_u,O_w)\).\\
Let \(A=\{u_i\}\) be a basis of \(U\) and \(B=\{w_i\}\) be a basis of \(W\). Note the dimension of \(U,W\) as \(n,m\) respectively. Let $$C=\{(u_i,0)|u_i\in A\}\cup\{(0,w_i)|w_i\in B\}$$
Since there would be no intersection between two sets being union above, the number of elements in \(C\) is \(n+m\).
If we could show that \(C\) is a basis of \(U\times W\), then we could show the original statement.\\
First we need to show that all elements in \(C\) is linear independent. This means \(a_i\in K,c_i\in C\)
$$\sum\limits_{i=1}^{n+m}a_i c_i=O$$
if and only if all the \(a_i=0\).\\
Because multiplication by scalar and addition for \(U\times W\) is defined componentwise, we shall see that (if we keep the "order" of elements in \(C\) as \(A\) and \(B\) are merged)
$$\begin{aligned}
\sum\limits_{i=1}^{n}a_i u_i&=O_u\\
\sum\limits_{i=n+1}^{n+m}a_i w_i&=O_w
\end{aligned}$$
Since both \(A\) and \(B\) are basis of \(U\) and \(W\) respectively, all the \(a_i\) should be \(0\).\\
Now, we need to show that \(C\) generates \(U\times W\). Since \(A\) and \(B\) are basis of \(U\) and \(W\) respectively,
$$\forall (a,b)\in (U\times W), \exists f_i,g_i\in K:\sum\limits_{i=1}^n f_i u_i=a \text{ and } \sum\limits_{i=1}^m g_i w_i=b $$
Thus, by setting set of scalar for "order"-kept \(C\) as \(\{f_i\}\cup \{g_i\}\), it is easy to see that it generates \(U\times W\).\\
Therefore, we see that
$$\dim (U\times W)=\dim U+\dim W$$
and
$$\{(u_i,0)|u_i\in A\}\cup\{(0,w_i)|w_i\in B\}$$
is a basis for \(U\times W\).\\
\subsubsection{Exercises}
\label{sec:org57607af}
\begin{enumerate}
\item \textbf{Exercise 1}
\label{sec:orgbab44c2}

For the first part, we need to show that \(\forall v\in V, \exists \text{ unique } u\in U, w\in W: v=u+w\). Since \((2,1)\) and \((0,1)\) are linear independent, they are a basis of \(V=\mathbb{R}^2\). This means
$$\forall v\in V, \exists \text{ unique } a,b\in K: v=a\cdot (2,1)+b\cdot (0,1)$$
Thus, just set \(u=a\cdot (2,1)\) and \(w=b\cdot (0,1)\), and we have proved it.\\
It is same for \((2,1)\) and \((1,1)\).
\item \textbf{Exercise 2}
\label{sec:orgd80edf0}

Since \((1,0,0), (1,1,0), (0,1,1)\) are linear independent, we obtain that
$$\forall v\in V, \exists \text{ unique } a,b,c\in K: v=a\cdot (1,0,0)+b\cdot (1,1,0)+ c\cdot (0,1,1)$$
Set \(u=a\cdot (1,0,0)\) and \(w=b\cdot (1,1,0)+ c\cdot (0,1,1)\), it would be proved.
\item \textbf{Exercise 3}
\label{sec:orgfc10483}
$$\begin{aligned}
cA&\not =B\\
O&\not = B-cA\\
O&\not =\lambda B-c\lambda A && \lambda\not = 0\text{ (If } \lambda=0 \text{ inequality holds not)}
\end{aligned}$$
Since \(\lambda ,c\) are arbitrary and \(\lambda\not = 0\), coefficients before \(A\) and \(B\) can be anything but not equal to \(0\) together.
According to argument provided \hyperref[orgb6c34b8]{here}, \(A,B\) are linear independent. Also, according to \textbf{Theorem 3.4}, they are a basis of \(\mathbb{R}^2\).\\
Based on the similar argument in \textbf{Exercise 1}, second part could be proved.
\item \textbf{Exercise 4}
\label{sec:orgfc588bf}
See notes
\end{enumerate}
\section{Chapter 2}
\label{sec:org3d234b7}
\subsection{\(\S\) 1}
\label{sec:orgcf7c42c}
\subsubsection{Exercises}
\label{sec:org497f6b8}
\begin{enumerate}
\item \textbf{Exercise 1}
\label{sec:org6f9bcf4}
Skip
\item \textbf{Exercise 2}
\label{sec:org0c3766d}
Skip
\item \textbf{Exercise 3}
\label{sec:org3885ae4}
Skip
\item \textbf{Exercise 4}
\label{sec:org22b2d81}
Skip
\item \textbf{Exercise 5}
\label{sec:orgd067eda}
Let \(C=^t(A+B)=(c_{ij})\). Then, \(c_{ij}=(a_{ij}+b_{ij})'=a_{ji}+b_{ji}\). Thus, \(C=^tA+^tB\).
\item \textbf{Exercise 6}
\label{sec:orga0963e9}
Let \(B=^t(cA)\). Then, \(b_{ij}=ca_{ji}\). Since \(^tA=(a^{\prime}_{ij})=(a_{ji})=A\), \(B=c^tA\).
\item \textbf{Exercise 7}
\label{sec:org0dfe9d5}
No difference.
\item \textbf{Exercise 8}
\label{sec:org4090bd8}
Skip
\item \textbf{Exercise 9}
\label{sec:org34b8235}
Skip
\item \textbf{Exercise 10}
\label{sec:orgb92fbb9}
Let \(B=A+^tA=(b_{ij})=(a_{ij}+a_{ji})\). Since, \(b_{ij}=a_{ij}+a_{ji}=a_{ji}+b_{ij}=b_{ji}\), \(B\) is symmetric.
\item \textbf{Exercise 11}
\label{sec:orga7757da}
Skip
\item \textbf{Exercise 12}
\label{sec:org20d3597}
Skip
\item \textbf{Exercise 13}
\label{sec:org4d7ae20}

\textbf{For followings, we mean ones in \emph{Exercises on Dimension} section}.\\
Followings are linear independent.
$$U_1=\begin{pmatrix}
   1 & 0 \\
   0 & 0
\end{pmatrix}$$
$$U_2=\begin{pmatrix}
   0 & 1 \\
   0 & 0
\end{pmatrix}$$
$$U_3=\begin{pmatrix}
   0 & 0 \\
   1 & 0
\end{pmatrix}$$
$$U_4=\begin{pmatrix}
   0 & 0 \\
   0 & 1
\end{pmatrix}$$
Apply \(a\cdot U_1+b\cdot U_2+c\cdot U_3+d\cdot U_4=O\) to verify it.
Because it generates the matrix vector space \(Mat_{2\times 2}K\) over K (For every \(v\in Mat_{2\times 2}K\), simply let \(a,b,c,d\) be \(v\)'s components) and \(\{U_i\}\) are linear independent, \(\{U_i\}\) is a basis of \(Mat_{2\times 2}K\).\\
Because the number of elements in a basis is the dimension of the vector space, we see that the dimension of it is 4.
\item \textbf{Exercise 14}
\label{sec:orgd35ca53}
Similar argument to \textbf{Exercise 13}. Dimension of it is \(mn\).
\item \textbf{Exercise 15}
\label{sec:org8141f08}
Dimension of it is \(n\). Simply build up a basis to see.
\item \textbf{Exercise 16}
\label{sec:orgb4beb4c}
Similarly, dimension of it is \(\frac{(n+1)n}{2}\).
\item \textbf{Exercise 17}
\label{sec:org37adfa2}

Basis is a set comprises
$$U_1=\begin{pmatrix}
   1 & 0 \\
   0 & 0
\end{pmatrix}$$
$$U_2=\begin{pmatrix}
   0 & 1 \\
   1 & 0
\end{pmatrix}$$
$$U_3=\begin{pmatrix}
   0 & 0 \\
   0 & 1
\end{pmatrix}$$
Then, it is easy to see that dimension is 3.
\item \textbf{Exercise 18}
\label{sec:orgf0e4fb8}
Basis similar to the one in \textbf{Exercise 17} is linear independent and generates space. And, indeed, the number of elements in the basis is the same as one in \textbf{Exercise 16}. Thus, dimension of it is \(\frac{n(n+1)}{2}\).
\item \textbf{Exercise 19}
\label{sec:org8cf5f59}
Same as \textbf{Exercise 15}.
\item \textbf{Exercise 20}
\label{sec:org7199960}

Let \(U\) be the subspace of \(V\). There would be a maximal number \(m\) of linear independent vectors (\textbf{Theorem 3.1} in chapter 1). Suppose the number \(m> \dim V\). Then it would contradicts \textbf{Theorem 3.1} in chapter 1 as any number of vectors more than \(\dim V\) would be linear dependent, which means the basis of \(U\) would be linear dependent (remember \(U\) is a subspace of \(V\)). Thus, \(m\leq \dim V\).\\
Dimension could be \(0,1,2\).
\item \textbf{Exercise 21}
\label{sec:orgb638aad}

According to the lemma we proved in \textbf{Exercise 20}, dimension of subspace of \(\mathbb{R}^{3}\) could be \(0,1,2,3\).
\end{enumerate}
\subsection{\(\S\) 2}
\label{sec:orgb2184c5}
\subsubsection{Notes}
\label{sec:org7232963}
\textbf{Lemma} Let \(A\) be a set of linear dependent vectors that generates \(V\). Then, for all \(v\in V\), there exists infinite linear combinations of \(A\) that form \(v\).\\
\emph{Proof} Say that number of vectors in \(A\) is \(n\). Since \(A\) generates \(V\), \(\forall v\in V, \exists \{a_i\}: v=\sum\limits_{i=1}^n a_i A_i\). Let \(L\) be a set of linear combinations that form \(v\) (here \(L\) is a set of sets). We have
$$\begin{aligned}
v&=\sum\limits_{i=1}^n a_iA_i+O\\
&=\sum\limits_{i=1}^n a_iA_i+\sum\limits_{i=1}^n b_iA_i\\
&=\sum\limits_{i=1}^n (a_i+b_i) A_i
\end{aligned}$$
Since \(A\) is linear dependent, there exists \(\{b_i\}\) where not every element is \(0\). Therefore, \(\{a_i+b_i\}\in L\) and \(\{a_i+b_i\}\not = \{a_i\}\) for some \(\{b_i\}\).\\
This means that \(\forall \ell \in L\), we can always form a new \(\ell^{\prime}\in L\). And since for all \(v\in V\) we always have one linear combination, we can do it infinitely, which means number of elements in \(L\) is infinite. Therefore, we have shown what was to be shown. \(\blacksquare\) \\
Here we discuss the number of solutions for general linear equations. (\(A\) is a \(m\times n\) matrix. \(X\) is a \(n\times 1\) column matrix. \(B\) is a \(m\times 1\) column matrix).
$$AX=B$$
If \(n>m\), according to \textbf{Theorem 3.1 in chapter 1}, they must be linear dependent, resulting in infinite number of solutions because of \textbf{Lemma} above.\\
If \(n=m\) and they are linear independent (it is then a basis because they are maximal independent vectors), there would only be one solution as \textbf{Theorem 2.1 in chapter 1} stated. If they are linear dependent and \(B\) is in the subspace generated by column vectors of \(A\), there would be infinite number of solutions (\textbf{Lemma}), else the equations are not solvable (there exists no linear combination to represent \(B\)).\\
If \(n<m\) and they are independent and \(B\) is in the subspace generated by column vectors of \(A\), there would be only one solution. If they are linear independent but \(B\) is not in subspace, then it is unsolvable. If they are linear dependent and \(B\) is in subspace, infinite solutions occur. If they are linear dependent but \(B\) is not in subspace, equations are not solvable.\\
In general,
\begin{enumerate}
\item If \(B\) is in the vector space generated by column vectors of \(A\) and they are linear independent, there exists one unique solution.
\label{sec:org1011f59}
\item If \(B\) is in the vector space generated by column vectors of \(A\) and they are linear dependent, there exists infinite solutions.
\label{sec:orgc07e32e}
\item If \(B\) is not in the vector space generated by column vectors of \(A\), there would be no solution.
\label{sec:org78eac55}
\end{enumerate}
\subsubsection{Exercises}
\label{sec:org13a1f98}
\begin{enumerate}
\item \textbf{Exercise 1}
\label{sec:org67b8c56}
See notes and refer to the definition of linear independence.
\item \textbf{Exercise 2}
\label{sec:orgd969ccc}

Let \(u\) be one set of solution and \(w\) be another.\\
We want to show that \(u+w\in X\).
$$\sum\limits_{i=1}^n (u_i+w_i)\cdot A^i=\sum\limits_{i=1}^n u_i\cdot A^i+\sum\limits_{i=1}^n w_i\cdot A^i=O+O=O$$
Thus, \(u+w\in X\).
Also, we need to show \(cu\in X\) where \(c\in K\).
$$c \sum\limits_{i=1}^n u_i \cdot A^i=cO=O$$
Other \textbf{VS} s are easy to follow as we define the addition of vectors in \(X\) componentwise, \(O\) as a vector whose components are all zero, \(1\) as a vector whose components are all one.
\item \textbf{Exercise 3}
\label{sec:org8312a9d}
We want to show following
$$\begin{aligned}
\sum\limits_{i=1}^n (a_i+b_i \text{i}) A^i&=O_{\mathbb{C}}\\
\sum\limits_{i=1}^n a_iA^{i}+\sum\limits_{i=1}^n b_i \text{i} \cdot A^i &= O_{\mathbb{C}}\\
O_{\mathbb{C}}+\sum\limits_{i=1}^n b_i \text{i} \cdot A^i&=O_{\mathbb{C}}\\
\sum\limits_{i=1}^n b_i \cdot A^i&=O_{\mathbb{C}}
\end{aligned}$$
This means that \(\{A^i\}\) should be linear independent over \(\mathbb{R}\) (\(\sum\limits_{i=1}^n b_i \cdot A^i=O_{\mathbb{C}}\) is equal to \(\sum\limits_{i=1}^n b_i \cdot A^i=O_{\mathbb{R}}\) as there is no imaginary part). Since it is known to us that \(\{A^i\}\) is linear independent over \(\mathbb{R}\), it has been proved as we do it reversely.
\item \textbf{Exercise 4}
\label{sec:orgebe750c}
We know that
$$\sum\limits_{i=1}^n (a_i+b_i \text{i}) A^i = O_{\mathbb{C}}$$
which means that \(\sum\limits_{i=1}^n a_i A^i = O_{\mathbb{C}}\) and/or \(\sum\limits_{i=1}^n b_i A^i = O_{\mathbb{C}}\).
For either cases, we have shown it is linear dependent over \(\mathbb{R}\) (\(a_i,b_i\in \mathbb{R}\)).
\end{enumerate}
\subsection{\(\S\) 3}
\label{sec:orgaa1f70e}
\subsubsection{Exercises}
\label{sec:orgeafc419}
\begin{enumerate}
\item \textbf{Exercise 1}
\label{sec:org586ac64}
\(AI=IA=A\)
\item \textbf{Exercise 2}
\label{sec:orgb07b12b}
\(AO=O\)
\item \textbf{Exercise 3}
\label{sec:org298815c}

For every \(A\) and \(B\), \((AB)C=A(BC)\).
\begin{enumerate}
\item Case 1
\label{sec:org2cd5d2c}
$$\begin{pmatrix}
3&2\\
4&1
\end{pmatrix}$$
\item Case 2
\label{sec:orgdc8fd7a}
$$\begin{pmatrix}
10\\
14
\end{pmatrix}$$
\item Case 3
\label{sec:org01e0dac}
$$\begin{pmatrix}
33&37\\
11&-18
\end{pmatrix}$$
\end{enumerate}
\item \textbf{Exercise 4}
\label{sec:org8acf746}
This one could be proved as it is proved \hyperref[org581f974]{here}.
\item \textbf{Exercise 5}
\label{sec:orgd8ff319}
$$AB=\begin{pmatrix}
4&2\\
5&-1
\end{pmatrix}$$
$$BA=\begin{pmatrix}
2&4\\
4&1
\end{pmatrix}$$
\item \textbf{Exercise 6}
\label{sec:orgcb015d9}
$$CA=AC=\begin{pmatrix}
7&14\\
21&-7
\end{pmatrix}$$
$$CB=BC=\begin{pmatrix}
14&0\\
7&7
\end{pmatrix}$$
General rule is that for symmetric one, we may have \(AB=BA\)? (I am not sure here).
\item \textbf{Exercise 7}
\label{sec:org5be1a79}
$$XA=\begin{pmatrix}
3&1&5
\end{pmatrix}$$
\item \textbf{Exercise 8}
\label{sec:orgdfe1e32}
$$\begin{aligned}
X_1 A=A_2\\
X_2 A=A_3
\end{aligned}$$
Let \(X_i\) be a unit vector with only \(i\) -th component equal to \(1\). \(X_i A=A_i\)
\item \textbf{Exercise 9}
\label{sec:org46d4426}

Skip the steps involving verifications.
\(^t (AB)=^tB^tA\) has already been proved in \(\S2\). Thus, \(^t [(AB)C]=^t C\cdot ^t (AB)=^t C\cdot ^t B\cdot ^tA\).
\item \textbf{Exercise 10}
\label{sec:org2c97e29}

Firstly, we know \(A\) is of \(1\times n\), \(M\) is of \(n\times n\) and \(B\) is of \(1\times n\). This means that \(\dim (\langle A,B\rangle)=1\). Also, it implies that \(^t (\langle A,B\rangle)=\langle A,B\rangle\). Thus, we have
$$\begin{aligned}
\langle A,B\rangle&=^t (\langle A,B\rangle)\\
&=^t(AM^tB)\\
&=^t(^tB)\cdot ^tM\cdot ^tA && \text{Exercise 9}\\
&=BM^tA\\
&=\langle B,A\rangle
\end{aligned}$$
which is \textbf{SP 1}.
Also, let
$$N=^t(B+C)$$
Then, \(n_{ij}=n^{\prime}_{ji}=b_{ji}+c_{ji}\). This implies also \(N=^tA+^tB\). Therefore,
$$\langle A,B+C\rangle=AM^t(B+C)=AM(^tB+^tC)=\langle A,B\rangle+\langle A,C\rangle$$
which is \textbf{SP 2}. Finally
$$\langle cA,B\rangle=cAM^tB=c\langle A,B\rangle$$
which is \textbf{SP 3}.
\item \textbf{Exercise 11}
\label{sec:org60fb450}

For part \textbf{(a)}, see \textbf{Exercise 35}.\\
Part \textbf{(b)}
$$A^2=\begin{pmatrix}
1&2&3\\
0&1&2\\
0&0&1
\end{pmatrix}$$
$$A^3=\begin{pmatrix}
1&3&6\\
0&1&3\\
0&0&1
\end{pmatrix}$$
$$A^4=\begin{pmatrix}
1&4&10\\
0&1&4\\
0&0&1
\end{pmatrix}$$
\item \textbf{Exercise 12}
\label{sec:org1852494}
$$(AX)_{a}=\begin{pmatrix}
4\\
7\\
5
\end{pmatrix}
(AX)_{b}=\begin{pmatrix}
3\\
1
\end{pmatrix}$$
$$(AX)_c=\begin{pmatrix}
x_2\\
0
\end{pmatrix}
(AX)_d=\begin{pmatrix}
0\\
x_1
\end{pmatrix}$$
\item \textbf{Exercise 13}
\label{sec:org57d1080}
$$(AX)_a=\begin{pmatrix}
2\\
4
\end{pmatrix}$$
$$(AX)_b=\begin{pmatrix}
4\\
6
\end{pmatrix}$$
$$(AX)_c=\begin{pmatrix}
3\\
5
\end{pmatrix}$$
\item \textbf{Exercise 14}
\label{sec:org5939f82}
$$(AX)_a=\begin{pmatrix}
3\\
1\\
2
\end{pmatrix}$$
$$(AX)_b=\begin{pmatrix}
12\\
3\\
9
\end{pmatrix}$$
$$(AX)_c=\begin{pmatrix}
5\\
4\\
8
\end{pmatrix}$$
\item \textbf{Exercise 15}
\label{sec:orgaa8cc7d}
\(AX=A^2\) (second column of \(A\)).
\item \textbf{Exercise 16}
\label{sec:orgcd4c81b}
\(AX=A^i\)
\item \textbf{Exercise 17}
\label{sec:org49c0ee0}

Let \(U_i\) be a unit column vector which only has \(1\) on its \(i\) -th component. The proposed form of \(C^k\) could be written in the following way.
$$\begin{aligned}
C^k&=\sum\limits_{i=1}^n b_{ik}A^i\\
&=\sum\limits_{i=1}^n b_{ik}[\sum\limits_{j=1}^m (a_{ji}\cdot U_j)]\\
&=\sum\limits_{i=1}^n [\sum\limits_{j=1}^m a_{ji}b_{ik}\cdot U_j]\\
\end{aligned}$$
$$\begin{aligned}
C^k&=\sum\limits_{j=1}^m A_j\cdot B^k\cdot U_j\\
&=\sum\limits_{j=1}^m [\sum\limits_{i=1}^n a_{ji}b_{ik}\cdot U_j]
\end{aligned}$$
Two forms are essentially the same if you expand them and compare. Thus, we have proved that the proposed formula is an equivalence of the original definition.
\item \textbf{Exercise 18}
\label{sec:org7277544}
\begin{enumerate}
\item \(A^{-1}=(I+A)\Rightarrow A\cdot A^{-1}=I^2-A^2=I\)
\label{sec:orgeaee7b7}
\item \(A^{-1}=(I^2+IA+A^2)\Rightarrow A\cdot A^{-1}=I^3-A^3=I\)
\label{sec:org7b96c1c}
\item For real number \(I\) and \(A\), we see that \(I^n-A^n\) can be factored into \(I-A\) and another polynomial, because according to remainder theorem, plugging in \(I=A\) results in \(I^n-A^n=0\). Thus, we could follow the same pattern to construct always a \(A^{-1}\).
\label{sec:orgde4ee00}
\item Set \(A^{-1}=(-A-2I)\)
\label{sec:orgfa0256b}
\item Set \(A^{-1}=(-A^2-A)\)
\label{sec:orgbada3b9}
\end{enumerate}
\item \textbf{Exercise 19}
\label{sec:orgef9dcc8}
$$AB=\begin{pmatrix}
1 & ab\\
0 & 1
\end{pmatrix}$$
$$A^2=\begin{pmatrix}
1 & 2a\\
0 & 1
\end{pmatrix}$$
Inductive step:
$$\begin{aligned}
A^{n+1}&=A^n\cdot A\\
&=\begin{pmatrix}
1 & na\\
0 & 1
\end{pmatrix}\cdot A\\
&=\begin{pmatrix}
1 & (n+1)a\\
0 & 1
\end{pmatrix}
\end{aligned}$$
Thus, we have proved it.
\item \textbf{Exercise 20}
\label{sec:org860b0e0}
$$A^{-1}=\begin{pmatrix}
1 & -a \\
0 & 1
\end{pmatrix}$$
\item \textbf{Exercise 21}
\label{sec:org001729f}
We now show that \(B^{-1}A^{-1}\) would be an inverse of \(AB\).
$$(AB)(B^{-1}A^{-1})=A(B\cdot B^{-1})A^{-1}=A\cdot A^{-1}=I$$
And for the reverse, it is easy to verify either.
\item \textbf{Exercise 22}
\label{sec:org7513a70}
See the solution manual
\item \textbf{Exercise 23}
\label{sec:org3c8ac8f}
$$\begin{aligned}
A^2&=A\cdot A\\
&=\begin{pmatrix}
\cos 2\theta & -\sin 2\theta\\
\sin 2\theta & \cos 2\theta
\end{pmatrix}
\end{aligned}$$
Inductive step:
$$\begin{aligned}
A^{n+1}&=\begin{pmatrix}
\cos n\theta & -\sin n\theta\\
\sin n\theta & \cos n\theta
\end{pmatrix}\cdot A\\
&=\begin{pmatrix}
\cos n\theta \cos \theta - \sin n\theta \sin \theta & -(\sin n\theta \cos \theta + \sin \theta \cos n\theta) \\
\sin n\theta \cos \theta + \sin \theta \cos n\theta & - \sin n\theta + \cos n\theta \cos \theta
\end{pmatrix}
&=\begin{pmatrix}
\cos (n+1)\theta & -\sin (n+1)\theta\\
\sin (n+1)\theta & \cos (n+1)\theta
\end{pmatrix}
\end{aligned}$$
Thus, we have determined \(A^n\)
\item \textbf{Exercise 24}
\label{sec:orga8d31c8}
$$A=\begin{pmatrix}
0 & 1\\
-1 & 0
\end{pmatrix}$$
\item \textbf{Exercise 25}
\label{sec:orga5d712a}
\begin{enumerate}
\item \(\text{tr}(A)=2\)
\label{sec:org6ae8a58}
\item \(\text{tr}(A)=4\)
\label{sec:orgafb8fe5}
\item \(\text{tr}(A)=8\)
\label{sec:orgba46d79}
\end{enumerate}
\item \textbf{Exercise 26}
\label{sec:org31f0762}
See \textbf{Exercise 27}.
\item \textbf{Exercise 27}
\label{sec:org8475578}
$$\begin{aligned}
\text{tr}(AB)&=\sum\limits_{i=1}^n [\sum\limits_{j=1}^n a_{ij} b_{ji}]\\
&=\sum\limits_{i=1}^n [\sum\limits_{j=1}^n b_{ji} a_{ij}]\\
&=\sum\limits_{i=1}^n [\sum\limits_{j=1}^n b_{ij} a_{ji}] && \text{They are the same if you expand}\\
&=\text{tr}(BA)
\end{aligned}$$
\item \textbf{Exercise 28}
\label{sec:org6af5a38}
As diagonal line keeps same after transpose, trace of the matrix would not change as well.
\item \textbf{Exercise 29}
\label{sec:org430f2a9}
\(A^n=((a_{ij})^n)\)
\item \textbf{Exercise 30}
\label{sec:org6a72f2d}
$$A^2=\begin{pmatrix}
a_1^2 & 0 & \cdots & 0\\
0 & a_2^2 & \cdots & 0\\
\vdots & \vdots & \ddots & \vdots \\
0 & 0 & \cdots & a_n^2
\end{pmatrix}$$
Inductive step
$$A^{k+1}=\begin{pmatrix}
a_1^k & 0 & \cdots & 0\\
0 & a_2^k & \cdots & 0\\
\vdots & \vdots & \ddots & \vdots \\
0 & 0 & \cdots & a_n^k
\end{pmatrix}\cdot A=\begin{pmatrix}
a_1^{k+1} & 0 & \cdots & 0\\
0 & a_2^{k+1} & \cdots & 0\\
\vdots & \vdots & \ddots & \vdots \\
0 & 0 & \cdots & a_n^{k+1}
\end{pmatrix}$$
\(\blacksquare\)
\item \textbf{Exercise 31}
\label{sec:orgbf27b7b}
See \textbf{Exercise 35}
\item \textbf{Exercise 32}
\label{sec:orge112cee}
We want to show
$$\begin{aligned}
^t(A^{-1})&=(^t A)^{-1}\\
^t(A^{-1})\cdot ^t (A)&=(^t A)^{-1} \cdot (^tA)\\
^t(A^{-1})\cdot ^t (A)&=I_n\\
\end{aligned}$$
Let \(C=^t(A^{-1})\cdot ^t (A)\). We then know
$$\begin{aligned}
c_{ij}&=\sum\limits_{k=1}^n a^{\prime -1}_{ik} a^{\prime}_{kj}\\
&=\sum\limits_{k=1}^n a_{jk} a^{-1}_{ki}\\
&=A_j\cdot A^{-1\ i}
\end{aligned}$$
Thus,
$$\begin{aligned}
C&=^t(A\cdot A^{-1})\\
&=^t(I_n)=I_n
\end{aligned}$$
If we do it in the reverse way, then we can prove it.
\item \textbf{Exercise 33}
\label{sec:org436769e}
Let \(B=^t (\bar{A})\), then \(b_{ij}=\bar{a}_{ji}\). Let \(C=\overline{^t A}\), then \(c_{ij}=\bar{a^{\prime}}_{ij}=\bar{a}_{ji}\). Thus, \(B=C\).
\item \textbf{Exercise 34}
\label{sec:orgc7e2f68}
Its inverse is
$$\begin{pmatrix}
\frac{1}{a_1} & 0 & \cdots & 0\\
0 & \frac{1}{a_2} & \cdots & 0\\
\vdots & \vdots & \ddots & \vdots \\
0 & 0 & \cdots & \frac{1}{a_n}
\end{pmatrix}$$
\item \textbf{Exercise 35}
\label{sec:org39c64b8}
See solution manual. Here I would not like to introduce complex formal reasoning to simulate computation result.
\item \textbf{Exercise 36}
\label{sec:org26b8e12}

By result of \textbf{Exercise 35} we see that \(N^{n+1}=O\) as \(N=A-I_n\) is of the form being described in \textbf{Exercise 35}.\\
For inverse part, see \textbf{Exercise 18}.
\item \textbf{Exercise 37}
\label{sec:org1575562}
$$(I-N)(I+N+\cdot +N^r)=I^{r+1}-N^{r+1}=I^{r+1}=I$$
\item \textbf{Exercise 38}
\label{sec:orge0b8505}
See solution manual for detail computation.
\item \textbf{Exercise 39}
\label{sec:orgee0eebc}
Since we know \(AB=BA\) or \(A,B\) fulfills \textbf{SP 1}, we may say
$$(AB)^r=A^rB^r=O$$
For \((A+B)\), we discuss \((A+B)^{2r}\) where \(r\) is the larger \(r\) for \(A\) and \(B\).
$$(A+B)^{2r}=\sum _{k=0}^{2r}{\binom {2r}{k}}A^{2r-k}B^{k}$$
If \(1\geq k\leq r\), then \(2r-k\geq r\) and \(A^{2r-k}=O\). If \(r<k \leq 2r\), then \(B^k=O\). Thus, essentially, \((A+B)^{2r}=O\).
\end{enumerate}
\section{Chapter 3}
\label{sec:org2240326}
\subsection{\(\S\) 1}
\label{sec:orgd081899}
\subsubsection{Notes}
\label{sec:org074b445}
If we want to say that \(S\) is the image of \(A\) under \(F\), we are essentially trying to say followings:
$$\begin{aligned}
&\forall z\in S, \exists x:F(x)=z. \Rightarrow S\subset F(A)\\
&\forall a\in A, F(a)\in S. \Rightarrow F(A)\subset S
\end{aligned}$$
Above are exactly what \textbf{Example 6} on Pg. 45 are saying.\\
Also, we shall work on the equality of two linear mappings. Two linear mappings \(F:S_1\rightarrow T_1 ,G:S_2\rightarrow T_2\) are said to be equal if and only if followings are fulfilled:
$$\begin{aligned}
S_1&=S_2\\
T_1&=T_2\\
\forall z\in S_1, F(z)&=G(z)
\end{aligned}$$
Proofs left to readers on Pg. 49.\\
 \emph{If \(u_1,u_2\) are elements of \(V\), then \(T_{u_1+u_2}=T_{u_1}\circ T_{u_2}\).}\\
$$\begin{aligned}
\forall v\in V, T_{u_1+u_2}&=(u_1+u_2)+v\\
&=u_1+(u_2+v)\\
&=T_{u_1}(u_2+v)\\
&=T_{u_1}(T_{u_2}(v))\\
&=T_{u_1}\circ T_{u_2}(v)
\end{aligned}$$
Which means that \(T_{u_1+u_2}=T_{u_1}\circ T_{u_2}\) according to our definition of linear mapping equality.\\
\emph{If \(u\) is an element of \(V\), then \(T_u:V\rightarrow V\) has an inverse mapping which is nothing but the translation \(T_{-u}\).}\\
First, it is easy to verify that \(T_{-u}\) is an inverse of \(T_u\). Then, we say that there is an inverse \(T_u^{-1}\). According to the definition of inverse of a linear mapping, we have, for every \(v\in V\) that
$$\begin{aligned}
T_u^{-1}(T_u(v))&=I_V(v)=v\\
T_u^{-1}(v+u)&=v\\
T_u^{-1}(x)&=x-u && \text{Let } x=v+u\\
\end{aligned}$$
which attests \(T_{u}^{-1}=T_{-u}\).\\
Here comes words on bijectivity, inverse and function composition:\\
\begin{enumerate}
\item For two mappings \(F:S_1\rightarrow T_1\) and \(F:S_2\rightarrow T_2\), \(F\circ G\) is only defined if \(T_1=S_2\).\\
\item A more clear proof for \emph{If \(F:S\rightarrow V\) has an inverse \(G:V\rightarrow S\), then \(F\) is bijective.} \emph{Proof.} If \(F(x)=F(y)\) given \(x,y\in S\), then \(G(F(x))=G(F(y))\). Also, since \(F,G\) are inverse of each other, we have
\end{enumerate}
$$\begin{aligned}
&\forall s\in S, (G\circ F)(s)=G(F(s))=I_s(s)=s\\
&\forall v\in V, (F\circ G)(v)=F(G(v))=I_v(v)=v
\end{aligned}$$
which means \(x=G(F(x))=G(F(y))=y\). Also, we contend that \(\forall v\in V, \exists x: F(x)=v\). Since we know \(\forall v\in V, (F\circ G)(v)=F(G(v))=I_v(v)=v\), we can simply let \(x=G(v)\) so that \(F(x)=v\). This proves the theorem.
\subsubsection{Exercises}
\label{sec:orgaf0ec95}
\begin{enumerate}
\item \textbf{Exercise 1}
\label{sec:org056d20c}
\emph{\textbf{Calculus involved, not doing now.}}
\item \textbf{Exercise 2}
\label{sec:orgae88dfc}
Proved in notes.
\item \textbf{Exercise 3}
\label{sec:org3091171}
\begin{enumerate}
\item \(L(X)=11\)
\label{sec:orgfea5632}
\item \(L(X)=13\)
\label{sec:orgeb2d91e}
\item \(L(X)=6\)
\label{sec:org3645526}
\end{enumerate}
\item \textbf{Exercise 4}
\label{sec:orgce9a8ea}

\(F(1)=(e,1)\), \(F(0)=(1,0)\), \(F(-1)=(e^{-1},-1)\)
\item \textbf{Exercise 5}
\label{sec:org751fc2a}

\((F+G)(1)=(e+1,3)\), \((F+G)(2)=(e^2+2,6)\), \((F+G)(0)=(1,0)\)
\item \textbf{Exercise 6}
\label{sec:org4be0d1a}

\((2F)(0)=(2,0)\), \((\pi F)(1)=(\pi e,\pi)\)
\item \textbf{Exercise 7}
\label{sec:orgab95666}
For (a), it is 1. For (b), it is 11.
\item \textbf{Exercise 8}
\label{sec:org507b494}

The image is a ellipse of the equation
$$\frac{u^2}{4}+\frac{w^2}{9}=1$$
Proof is omitted.
\item \textbf{Exercise 9}
\label{sec:org67f6a5f}

The image is a straight line
$$y=\frac{1}{2}x$$
\emph{Proof.} \(A=\{(2,y)|y\in \mathbb{R}\}\), \(S=\{(2x,x)|x\in \mathbb{R}\}\). We contend that \(\forall a\in A, F(a)\in S\).
$$\forall y\in \mathbb{R}, F(2,y)=(2y,y)\in S$$
Conversely, \(\forall s=(x,\frac{1}{2}x)\in S\), let \(a=(2,\frac{1}{2}x)\in A\), so that \(F(a)=s\), which means \(S\subset F(A)\).
\item \textbf{Exercise 10}
\label{sec:org8910234}
It is a circle of center \((0,0)\) and radius \(e^c\). Proof is omitted.
\item \textbf{Exercise 11}
\label{sec:org9212288}

It is a cylinder of radius 1 and center \((0,0)\). Proof is omitted.
\item \textbf{Exercise 12}
\label{sec:orgdb53137}
\(x^2+y^2=1\). Proof is omitted.
\end{enumerate}
\subsection{\(\S\) 2}
\label{sec:orgeaa96dd}
\subsubsection{Notes}
\label{sec:org095355d}
\label{org8cb922a}
Here we have an important \textbf{Lemma}\\
\emph{Let \(F:V\rightarrow W\) is a linear mapping. If for some \(v_i\in V\), we have \(F(v_i)\) are linear independent, then \(v_i\) are linear independent.}\\
\emph{Proof.} If \(\sum\limits_{i=1}^n t_i v_i=O\), then we have
$$\begin{aligned}
\sum\limits_{i=1}^n t_i v_i&=O\\
F(\sum\limits_{i=1}^n t_i v_i)&=F(O)=O && \text{(This is ensured as "output" of a mapping is unique for same "input")}\\
\sum\limits_{i=1}^n t_i F(v_i)=O
\end{aligned}$$
which means if \(\sum\limits_{i=1}^n t_i v_i=O\), we must have \(\sum\limits_{i=1}^n t_i F(v_i)=O\). Since \(F(v_i)\) are linear independent, we obtain that \(t_i\) is always equal to \(0\), which is another word for \(v_i\) are linear independent.\\
It is noteworthy that reversal of this \textbf{Lemma} is \textbf{NOT} always true as \(F(v)=O\) doesn't ensure that \(v=O\). In fact, in later subsections, we shall see that \(F\) is injective if and only if \(\text{Ker } F={O}\).
\subsubsection{Exercises}
\label{sec:org793799b}
\begin{enumerate}
\item \textbf{Exercise 1}
\label{sec:org0c6d82f}
Only (a), (b), (d), (e), (f), (h) are linear mappings. For (h), it involves \textbf{\emph{Calculus}}.
\item \textbf{Exercise 2}
\label{sec:org87756af}
\(T(O)=T[v+(-v)]=T(v)+T(-v)=T(v)-T(v)=O\)
\item \textbf{Exercise 3}
\label{sec:org2898d98}
\(T(u+v)=T(u)+T(v)=w+O=w\)
\item \textbf{Exercise 4}
\label{sec:org543bf91}

Let the set of elements \(v\in V\) satisfying \(T(v)=w\) be \(S\). We contend that \(\forall v\in S, \exists u\in U:v=u+v_0\).\\
\emph{Proof.} let \(u=v-v_0\). \(F(u)=F(v-v_0)=F(v)-F(v_0)=O\). Thus, \(v\in U\). This means \(S\subset (v_0+U)\).\\
Conversely, we contend that \(\forall u\in U\), we have \((v_0+u)\in S\).\\
\emph{Proof.} \(T(v_0+u)=T(v_0)+T(u)=w+O=w\). This means \((v_0+U)\subset S\).\\
Thus, \(S=(v_0+U)\).
\item \textbf{Exercise 5}
\label{sec:org2f788e5}
As \textbf{Exercise 2} said, \(T(O)=T(v-v)=T(v)+T(-v)=O \Rightarrow T(-v)=-T(v)\).
\item \textbf{Exercise 6}
\label{sec:org83db30b}

Firstly, \(F(v_1+v_2)=(f(v_1)+f(v_2),g(v_1)+g(v_2))=(f(v_1),g(v_1))+(f(v_2),g(v_2))=F(v_1)+F(v_2)\) \\
Secondly, \(F(cv)=(cf(v),cg(v))=c(f(v),g(v))=cF(v)\)
\item \textbf{Exercise 7}
\label{sec:org79e20a1}
\begin{enumerate}
\item Prove \((u_1+u_2)\in U\). We have \(F(u_1+u_2)=F(u_1)+F(u_2)=O+O=O\).
\item Prove \(cu\in U\). We have \(F(cu)=cF(u)=O\).
\end{enumerate}
\item \textbf{Exercise 8}
\label{sec:org7a3cf35}
Mapping 8 is linear, others are not.
\item \textbf{Exercise 9}
\label{sec:org1f9ee3d}

By definition later introduced in \(\S 5\), it is line segment between \(F(v)\) and \(F(v+w)\).\\
If \(F(w)\not = O\), then it is a line segment. If \(F(w)=O\), then it is a point.
\item \textbf{Exercise 10}
\label{sec:orgf555ad8}
By definition, it is a parallelogram.
\item \textbf{Exercise 11}
\label{sec:org0139100}
Note that \(E_1,E_2\) are standard generators.
Since \(S\) is a set of points that can be written in the form \(t_1E_1+t_2E_2\) where \(0\leq t_1\leq 1\) and \(0\leq t_2\leq 1\). Thus, \(F(t_1E_1+t_2E_2)=t_1F(E_1)+t_2F(E_2)\) where \(0\leq t_1\leq 1\) and \(0\leq t_2\leq 1\). Hence, prove the statement.
\item \textbf{Exercise 12}
\label{sec:org6ca55ea}
We know \(3E_1\) and \(E_2\) are also linear independent. So are \(3F(E_1)\) and \(F(E_2)\). Thus, adopting similar reasoning in \textbf{Exercise 11}, we prove statement.
\item \textbf{Exercise 13}
\label{sec:org3462250}
It is a parallelogram generated by \(5A\) and \(2B\).
\item \textbf{Exercise 14}
\label{sec:orge5d4524}
\(T_u(v_1+v_2)=v_1+v_2+u=T_u(v_1)+T_u(v_2)=v_1+v_2+2u\). Thus, we have \(2u=u\) and \(u=O\).
\item \textbf{Exercise 15}
\label{sec:orgf04744c}
It is shown in \hyperref[org8cb922a]{Lemma}.
\item \textbf{Exercise 16}
\label{sec:orga22b8d3}

If \(v\in W\), simply let \(c=0\) and \(w=v\).\\
If \(v\not \in W\), let \(c=\frac{F(v)}{F(v_0)}\) and \(w=v-cv_0\). We then contend that \(w\in W\). Since \(F(w)=F(v-cv_0)=F(v)-cF(v_0)=0\), we conclude \(w\in W\). Thus, concludes.
\item \textbf{Exercise 17}
\label{sec:org69e5abc}

We see that \(F(w_1+w_2)=F(w_1)+F(w_2)=0+0=0\). Also, \(F(cw)=cF(w)=0\). And since \(F\) is linear and as we proved before, \(F(O)=O\) and \(O\in W\). Thus, \(W\) is a subspace of \(V\).\\
We know by \textbf{Exercise 16} that \(\{v_0,v_1,\cdots , v_n\}\) generates \(V\). We contend then that they are linear independent. It is by definition that \(\{v_1,\cdots , v_n\}\) are linear independent. Since \(v_0\not \in W\), we see that \(v_0\) cannot be expressed by linear combination of \(\{v_0,v_1,\cdots , v_n\}\), \hyperref[orgb6c34b8]{thereby} \(v_0\) is linear independent from others. Thus, they are linear independent. Then, by definition, this set is a basis of \(V\).
\item \textbf{Exercise 18}
\label{sec:orgdbe3364}
\begin{enumerate}
\item \((-1,-1)\)
\item \((-\frac{2}{3},1)\)
\item \((-2,-1)\)
\end{enumerate}
\item \textbf{Exercise 19}
\label{sec:org621c470}
\begin{enumerate}
\item \((4,5)\)
\item \((\frac{11}{3},-3)\)
\item \((4,2)\)
\end{enumerate}
\end{enumerate}
\subsection{\(\S\) 3}
\label{sec:orgd19351a}
\subsubsection{Notes}
\label{sec:org98003dd}
Another part for \textbf{Theorem 3.3}. If \(\text{Im } L=W\), then \(\dim \text{Im } L=\dim W\) and \(\dim \text{Ker }L=0\). Thus, \(\text{Ker } L=\{O\}\).
\subsubsection{Exercises}
\label{sec:org8df0fa6}
\begin{enumerate}
\item \textbf{Exercise 1}
\label{sec:org7efd120}

We know \(\dim \mathbb{R}^{n}=n\). According to rank-nullity law, we see that \(\dim \mathbb{R}^2=\dim \text{Ker }F+\dim \text{Im }F\). Thus, \(2=\dim \text{Ker }F+n\) and \(2-n=\dim \text{Ker }F\) Since \(n,\dim \text{Ker }F\geq 0\), we see that \(0\leq n\leq 2\).
\begin{enumerate}
\item \(n=2\), then \(\dim \text{Ker }F=0\) and \(\text{Ker }F=\{O\}\). This means that \(t_1F(A)+t_2F(B)=O \Rightarrow F(t_1A+t_2B)=O \Rightarrow t_1A+t_2B=O \Rightarrow t_1=t_2=0\).
\item \(n=1\), then \(\dim \text{Im }F=1\).
\item \(n=0\), then \(\dim \text{Im }F=0\) and \(\text{Im }F=\{O\}\).
\end{enumerate}
\item \textbf{Exercise 2}
\label{sec:org70de6a8}

We know then that \(\dim \text{Ker }F\not =0\). Since \(2-\dim \text{Ker } F=\dim \text{Im }F\), we see that \(\dim \text{Im }F=0\) or \(1\). This concludes our prove.
\item \textbf{Exercise 3}
\label{sec:orgcce967f}
Consider \(L:\mathbb{R}^4\rightarrow \mathbb{R}^2\) such that \(L(x_1,x_2,x_3,x_4)=L(x_1+2x_2,x_3-15x_4)\). According to rank-nullity theorem and since \(\text{Ker }L=W\), we see that \(\dim \mathbb{R}^4=\dim W+\dim \mathbb{R}^{2}\). Thus \(\dim W=2\).
\item \textbf{Exercise 4}
\label{sec:org83d1c23}
We contend that there exists such a \(u\). \(\forall X\), \(L(X-v_0)=L(X)-L(v_0)=O\). This means if we let \(u=X-v_0\), then \(u\in \text{Ker }L\).
\item \textbf{Exercise 5-9}
\label{sec:orgc09ce26}
\emph{\textbf{Calculus Involved, not done now.}}
\item \textbf{Exercise 10}
\label{sec:org74dad92}

\begin{enumerate}
\item Let such a subspace be \(W\). Consider \(L:\mathbb{R}^n\rightarrow \mathbb{R}\) such that \(L(X)=\sum\limits_{i=1}^n x_i\). According to rank-nullity theorem and since \(\text{Ker }L=W\), we see that \(\dim \mathbb{R}^n=\dim W+\dim \mathbb{R}\). Thus \(\dim W=n-1\).
\item Let such a subspace be \(W\). Consider \(tr:\text{Mat}_{n\times n}(\mathbb{R})\rightarrow \mathbb{R}\) such that \(tr(A)=\sum\limits_{i=1}^n a_ii\). According to rank-nullity theorem and since \(\text{Ker }tr=W\), we see that \(\dim \text{Mat}_{n\times n}(\mathbb{R})=\dim W+\dim \mathbb{R}\). Thus \(\dim W=n^2-1\).
\end{enumerate}
\item \textbf{Exercise 11}
\label{sec:org7b891ec}
\begin{enumerate}
\item We have \(tr(A+B)=\sum\limits_{i=1}^n(a_{ii}+b_{ii})=\sum\limits_{i=1}^n a_{ii}+\sum\limits_{i=1}^n b_{ii}=tr(A)+tr(B)\) and \(tr(cA)=\sum\limits_{i=1}^n(ca_{ii})=c\sum\limits_{i=1}^n a_{ii}=c\cdot tr(A)\). This concludes linearity for \(tr\).
\item $$\begin{aligned}
   tr(AB)&=\sum\limits_{i=1}^n A_iB^i\\
   &=\sum\limits_{i,j=1}^n a_{ij}b_{ji}\\
   &=\sum\limits_{i,j=1}^n b_{ji}a_{ij}\\
   &=\sum\limits_{i=1}^{n} B_iA^i\\
   &=tr(BA)\\
   \end{aligned}$$
\item Since we know \(tr(AB)=tr(BA)\), we have \(tr[(B^{-1}A)B]=tr[B(B^{-1}A)]=tr[(BB^{-1})A]=tr(I_nA)=tr(A)\)
\item Firstly, \(\langle A,B \rangle = tr(AB)=tr(BA)=\langle B,A \rangle\). Secondly, \(\langle A,B+C \rangle=tr[A(B+C)]=tr[AB+AC]=tr(AB)+tr(AC)=\langle A,B\rangle+\langle A,C\rangle\). Thirdly, \(c\langle A,B \rangle=c\sum\limits_{i=1}^n A_iB^i=\sum\limits_{i=1}^n (cA_i)B^i=\langle cA,B \rangle\).
\item \(tr(AB-BA)=tr(AB)-tr(BA)=0\). Since \(tr(I_n)=n\), this could not be possible.
\end{enumerate}
\item \textbf{Exercise 12}
\label{sec:orge4b1862}
\(\dim S=\frac{n(n+1)}{2}\). Bases are trivial, skipped.
\item \textbf{Exercise 13}
\label{sec:org99dc3bc}

\(tr(AA)=\sum\limits_{i,j=1}^n a_{ij}a_{ji}=\sum\limits_{i,j=1}^n (a_{ij})^2\geq 0\).
Since \(a_{ji}^2=0\) if and only if \(a_{ji}=0\), \(tr(AA)=0\) if and only if \(A=O\).
\item \textbf{Exercise 14}
\label{sec:org4ca3273}

Part (a). Let \(B=\frac{A+^tA}{2}\), then \(b_{ij}=\frac{a_{ij}+a_{ji}}{2}=\frac{a_{ji}+a_{ij}}{2}=b_{ji}\). Thus, \(B\) is symmetric. We also know that \(C=\frac{A-{}^tA}{2}\) and contend that \(^tC=-C\) which is \(^t(A-{}^t A)={}^tA-A\). Let \(\tilde{A}=^t(A-{}^t A)=(\tilde{a}_{ij})\). We have \(\tilde{a}_{ij}=^t(a_{ij}-a_{ji})=a_{ji}-a_{ij}\). Thus, \(\tilde{A}={}^tA-A\). Thus, it concludes statement.\\

Part (b).
Let \(B=\frac{A+{}^tA}{2}\), thus \(C=\frac{A-{}^tA}{2}\). We then contend \(\frac{A-{}^tA}{2}-C_1=O\).
$$\begin{aligned}
\frac{A-{}^tA}{2}-C_1&=O &&\Leftrightarrow\\
A-{}^tA-2C_1&=O &&\Leftrightarrow\\
B_1+C_1-{}^tA-2C_1&=O &&\Leftrightarrow\\
B_1-{}^tA-C_1&=O &&\Leftrightarrow\\
^tB_1 +{}^tC_1 &={}^tA &&\Leftrightarrow\\
^t({}^tB_1+{}^tC_1)&=A &&\Leftrightarrow\\
B_1+C_1&=A
\end{aligned}$$
\(\blacksquare\)
\item \textbf{Exercise 15}
\label{sec:org2130fa3}

Part (a). \(P(A+B)=\frac{(A+B)+{}^tA+{}^tB}{2}=\frac{A+{}^tA+B+{}^tB}{2}=P(A)+P(B)\). \(P(cA)=\frac{cA+{}^t(cA)}{2}=\frac{c(A+{}^tA)}{2}=cP(A)\).

Part (b).
\(P(A)=O \Leftrightarrow A+{}^tA=O \Leftrightarrow -A={}^tA\).

Part (c).
Dimension is \(\frac{n(n+1)}{2}\).
\item \textbf{Exercise 16}
\label{sec:orga2f7d15}

Part (a). Similar to \textbf{Exercise 15}.

Part (b). \(A={}^tA\), symmetric matrices. Dimension is \(\frac{n(n+1)}{2}\).
\item \textbf{Exercise 17}
\label{sec:org7e3133f}

It is trial to show vector space. \(O=(O_u,O_w)\).
As we proved before in Chapter 1, \(\dim (U\times W)=\dim U+ \dim W\). Such basis is \((u_1,O_w),\dots ,(u_n,O_w),(O_u,w_1),\dots ,(O_u,w_m)\).
\end{enumerate}
\end{document}


\documentclass{article}
\usepackage{amsmath}
\usepackage{amsthm}
\usepackage{amssymb}
\usepackage{algorithm}
\usepackage{graphicx}
\usepackage[noend]{algpseudocode}
\usepackage{url}
\usepackage{listings}

\newlength\tindent
\setlength{\tindent}{\parindent}
\setlength{\parindent}{0pt}
\renewcommand{\indent}{\hspace*{\tindent}}

\title{COMP 312 Assignment 7}
\author{Daniel Braithwaite}

\begin{document}
	\pagenumbering{gobble}
	\maketitle
	\newpage
  	\pagenumbering{arabic}

  	\section{Python}
  		\subsection{Program A}
			\subsubsection{Code}
				\lstinputlisting[language=Python]{Programs/01.py}
			\subsubsection{Output}
				Lambda = 1\\
				Estimate of W: 3.26472367151\\
Conf int of W: (3.2488630500389366, 3.280584292989257)\\

Estimate of L: 3.26905934434\\
Conf int of L: (3.2481626576521117, 3.289956031026612)\\\\

				Lambda = 1.4\\
				Estimate of W: 5.27502175978\\
Conf int of W: (5.2113909913800276, 5.3386525281750901)\\

Estimate of L: 7.39460960176\\
Conf int of L: (7.2956646964018264, 7.4935545071161238)\\

				Lambda = 1.6\\
				Estimate of W: 8.88431876814\\
Conf int of W: (8.6294892979862041, 9.1391482382906801)\\

Estimate of L: 14.2139801084\\
Conf int of L: (13.788264932464067, 14.639695284252635)\\\\

				Lambda = 1.8\\
				Estimate of W: 50.9382817297\\
Conf int of W: (44.339013047433241, 57.537550411953703)\\

Estimate of L: 90.5524817225\\
Conf int of L: (78.81803465053963, 102.28692879440669)\\

  		\subsection{Program B}
  			\subsubsection{Code}
				\lstinputlisting[language=Python]{Programs/02.py}
			\subsubsection{Output}
				Estimate of W0: 4943.04818104\\
Conf int of W0: (4898.3210316269033, 4987.7753304614289)\\

Estimate of W1: 4985.24543653\\
Conf int of W1: (4939.9264150329, 5030.5644580285843)\\

Estimate of W2: 4977.50494534\\
Conf int of W2: (4937.3688100317413, 5017.6410806387121)\\

Estimate of L0: 1.20182218568\\
Conf int of L0: (1.1806983072381694, 1.2229460641316552)\\

Estimate of L1: 1.17795497502\\
Conf int of L1: (1.146837330909527, 1.2090726191268364)\\

Estimate of L2: 2.6202228393\\
Conf int of L2: (2.5774359912704954, 2.6630096873233171)\\

	\section{Code Used For MVA}
		\lstinputlisting[language=Python]{Programs/mva.py}

\end{document}


\vssub
\subsection{~Selecting model options} \label{sec:switches}
\vssub

The file {\file switch} in the {\file bin} directory contains a set of strings
identifying model options to be selected. Many options are available. Of
several groups of options it is mandatory to select exactly one. These
mandatory switches are described in \para\ref{sub:man_switch}. Other switches
are optional, and are described in \para\ref{sub:opt_switch}. Default model
setting are identified in \para\ref{sub:opt_default}. The order in which the
switches appear in {\file switch} is arbitrary. How these switches are
included in the source code files is described in \para\ref{sec:w3adc}.

\vsssub
\subsubsection{~Mandatory switches} \label{sub:man_switch}
\vsssub

Of each of the below groups of switches exactly one has to be selected. The
first group of switches controls the selection of machine-dependent code. With
the introduction of \fortran-90 this set of switches should have become
obsolete. Problems with some compilers have prompted the retention of the
second switch.
\begin{slist}
\sit{f90} {\fortran-90 style date and time capturing and program
           abort.}
\sit{dum} {Dummy to be used if \ws\ is to be installed on
           previously untried hardware.}
\end{slist}

\noindent
Hardware model (first group) and message passing protocol (second group). Note
that these two groups share a switch. This implies that the {\sc mpi} switch
can only be used in combination with the {\sc dist} switch.
\begin{slist}
\sit{shrd}{Shared memory model.}
\sit{dist}{Distributed memory model}.
\end{slist}

\begin{slist}
\sit{shrd}{Shared memory model, no message passing.}
\sit{mpi} {Message Passing Interface (MPI).}
\end{slist}

\noindent
Selection of propagation schemes and GSE alleviation method. These represent
two sets of switches with some shared switches between the groups. Note that
the second set of switches is secondary to the selection of program modules
in the first set of switches, and therefore, does not have a user-defined
option.
\begin{slist}
\sit{pr0} {No propagation scheme / GSE alleviation used.}
\sit{pr1} {First order propagation scheme, no GSE alleviation.}
\sit{pr2} {Higher-order schemes with \cite{art:BH87} dispersion correction.}
\sit{pr3} {Higher-order schemes with \cite{tol:OMOD02b} averaging technique.}
%\sit{pr4} {\uq\ propagation scheme with \cite{tol:OMOD02b}
%           divergence technique.}
\sit{prx} {Experimental (user supplied).}
\end{slist}

\begin{slist}
\sit{pr0} {No propagation scheme used.}
\sit{pr1} {First-order propagation scheme.}
\sit{uno} {Second-order (UNO) propagation scheme.}
\sit{uq } {Third-order (UQ) propagation scheme.}
\end{slist}

\noindent
Selection of flux computation:
\begin{slist}
\sit{flx0} {No routine used; flux computation included in source terms,}
\sit{flx1} {Friction velocity according to Eq.~(\ref{eq:Wu}).}
\sit{flx2} {Friction velocity from Tolman and Chalikov input.}
\sit{flx3} {Idem, with cap of Eq.~(\ref{eq:Cd_cap_1}) or (\ref{eq:Cd_cap_2}).}
\sit{flx4} {Friction velocity according to Eq.~(\ref{eq:ST607}).}
\sit{flxx} {Experimental (user supplied).}
\end{slist}

\noindent
Selection of linear input:
\begin{slist}
\sit{ln0} {No linear input.}
\sit{seed}{Spectral seeding of Eq.~(\ref{eq:seed}).}
\sit{ln1} {Cavaleri and Malanotte-Rizzoli with filter.}
\sit{lnx} {Experimental (user supplied).}
\end{slist}

\noindent
Selection of input and dissipation. {\F stab{}\it n} switches are optional and
additional to corresponding {\F st{\it n}} switch:
\begin{slist}
\sit{st0} {No input and dissipation used.}
\sit{st1} {\wam\-3 source term package.}
\sit{st2} {\cite{tol:JPO96} source term package. See also the optional
          {\F stab2} switch.}
\sit{stab0}{No stability correction. Compatible with any source term ({\F st}) package.
            Including this switch has no effect.}
\sit{stab2}{Enable stability correction (\ref{eq:scor}) - (\ref{eq:stab}).
            Compatible with {\F st2} only.}
\sit{st3} {\wam\-4 and variants source term package.}
\sit{stab3}{Enable stability correction from \cite{rep:AB02}.
            Compatible with {\F st3} and {\F st4} only.}
\sit{st4} {\cite{art:Aea10} source term package.}
%\sit{st5} {UNSW source term package.}
\sit{st6} {BYDRZ source term package.}
\sit{stx} {Experimental (user supplied).}
\end{slist}

\noindent
Selection of nonlinear interactions:
\begin{slist}
\sit{nl0} {No nonlinear interactions used.}
\sit{nl1} {Discrete interaction approximation (\dia).}
\sit{nl2} {Exact interaction approximation (\xnl).}
\sit{nl3} {Generalized Multiple \dia\ (\gmd).}
\sit{nl4} {Two-scale approximation (TSA).}
\sit{nlx} {Experimental (user supplied).}
\end{slist}

\noindent
Selection of bottom friction:
\begin{slist}
\sit{bt0} {No bottom friction used.}
\sit{bt1} {\js\ bottom friction formulation.}
%\sit{bt2} {??? bottom friction formulation.}
%\sit{bt3} {??? bottom friction formulation.}
\sit{bt4} {\showex\ bottom friction formulation.}
\sit{bt8} {Dalrymple and Liu formulation (fluid mud seafloor).}
\sit{bt9} {Ng formulation (fluid mud seafloor).}
\sit{btx} {Experimental (user supplied).}
\end{slist}

\noindent
Selection of term for damping by sea ice:
\begin{slist}
\sit{ic0} {No damping by sea ice.}
\sit{ic1} {Simple formulation.}
\sit{ic2} {Liu et al. formulation.}
\sit{ic3} {Wang and Shen formulation.}
\sit{ic4} {Frequency-dependent damping by sea ice.}
\end{slist}

\noindent
Selection of term for scattering by sea ice:
\begin{slist}
\sit{is0} {No scattering by sea ice.}
\sit{is1} {Diffusive scattering by sea ice (simple).}
\sit{is2} {Floe-size dependent scattering and dissipation.}
\end{slist}

\noindent
Selection of term for reflection:
\begin{slist}
\sit{ref0} {No reflection.}
\sit{ref1} {Enables reflection of shorelines and icebergs}
\end{slist}

\noindent
Selection depth-induced breaking of :
\begin{slist}
\sit{db0} {No depth-induced breaking used.}
\sit{db1} {Battjes-Janssen.}
\sit{dbx} {Experimental (user supplied).}
\end{slist}

\noindent
Selection of triad interactions:
\begin{slist}
\sit{tr0} {No triad interactions used.}
\sit{tr1} {Lumped Triad Interaction (LTA) method.}
\sit{trx} {Experimental (user supplied).}
\end{slist}

\noindent
Selection of bottom scattering:
\begin{slist}
\sit{bs0} {No bottom scattering used.}
\sit{bs1} {Magne and Ardhuin.}
\sit{bsx} {Experimental (user supplied).}
\end{slist}

\noindent
Selection of supplemental source term:
\begin{slist}
\sit{xx0} {No supplemental source term used.}
\sit{xxx} {Experimental (user supplied).}
\end{slist}

\noindent
Selection of method of wind interpolation (time):
\begin{slist}
\sit{wnt0}{No interpolation.}
\sit{wnt1}{Linear interpolation.}
\sit{wnt2}{Approximately quadratic interpolation.}
\end{slist}

\noindent
Selection of method of wind interpolation (space):
\begin{slist}
\sit{wnx0}{Vector interpolation.}
\sit{wnx1}{Approximately linear speed interpolation.}
\sit{wnx2}{Approximately quadratic speed interpolation.}
\end{slist}

\noindent
Selection of method of current interpolation (time):
\begin{slist}
\sit{crt0}{No interpolation.}
\sit{crt1}{Linear interpolation.}
\sit{crt2}{Approximately quadratic interpolation.}
\end{slist}

\noindent
Selection of method of current interpolation (space):
\begin{slist}
\sit{crx0}{Vector interpolation}
\sit{crx1}{Approximate linear speed interpolation.}
\sit{crx2}{Approximate quadratic speed interpolation.}
\end{slist}

\noindent
Switch for user supplied GRIB package.
\begin{slist}
\sit{nogrb}{No package included.}
\sit{ncep1}{\ncep\ GRIB1 package for IBM SP.}
\sit{ncep2}{\ncep\ GRIB2 package for IBM SP.}
\end{slist}

% -------------------------------------------------------------
\vsssub
\subsubsection{~Optional switches} \label{sub:opt_switch}
\vsssub

All switches below activate model behavior if selected, but do not require
particular combinations. The following switches control optional output for
\ws\ programs.

\begin{slist}
\sit{o0}  {Output of namelists in grid preprocessor.}
\sit{o1}  {Output of boundary points in grid preprocessor.}
\sit{o2}  {Output of the grid point status map in grid preprocessor.}
\sita{o2} {Generation of land-sea mask file {\file mask.ww3} in grid
           preprocessor.}
\sitb{o2} {Output of obstruction map in grid preprocessor.}
\sitc{o2} {Print status map in format as read by {\file ww3\_grid}.}
\sit{o3}  {Additional output in loop over fields in field preprocessor.}
\sit{o4}  {Print plot of normalized one-dimensional energy
           spectrum in initial conditions program.}
\sit{o5}  {Id. two-dimensional energy spectrum.}
\sit{o6}  {Id. spatial distribution of wave heights (not adapted for
           distributed memory).}
\sit{o7}  {Echo input data for homogeneous fields in generic shell.}
\sita{o7} {Diagnostic output for output points.}
\sitb{o7} {Idem in {\file ww3\_multi}.}
\sit{o8}  {Filter field output for extremely small wave heights
           in wave model (useful for some propagation tests).}
\sit{o9}  {Assign a negative wave height to negative energy in wave model.
           Used in testing phase of new propagation schemes.}
\sit{o10} {Identify main elements of multi-grid model extensions in
           standard output.}
\sit{o11} {Additional log output on management algorithm in {\file log.mww3}.}
\sit{o12} {Identify removed boundary points in overlapping grids (center).}
\sit{o13} {Identify removed boundary points in overlapping grids (edge).}
\sit{o14} {Generate log file with buoy data {\file buoy\_log.ww3} for output
           type {\code ITYPE = 0} in {\file ww3\_outp}.}
\sit{o15} {Generate log file with time stamps of input data file {\file
           times.XXX} in {\file ww3\_prep}.}
\sit{o16} {Generate GrADS output of grid partitioning in {\file ww3\_gspl}.}
\end{slist}

\noindent
The following switches enable parallelization of the model using \omp\
directives, also known as `threading'. Before model version 5.01, threading
and parallelization using the {\sc mpi} switch could no be used
simultaneously. With version 5.01, pure MPI,pure OMP and hybrid MPI-OMP
approaches became available. Switches used in version 5.01 and higher are not
compatible with switches used in previous model versions.
\begin{slist}
\sit{ompg}{General loop parallelization directives used for both exclusive
    OpenMP parallelization and hybrid MPI-OpenMP parallelization.}
\sit{ompx}{Idem, but for directives used only for exclusive OpenMP
    parallelization.}
\sit{omph}{Idem, but for directives used only for hybrid MPI-OpenMP
    parallelization.}
\sit{pdlib}{Domain Decomposition for Explicit and Implicit Solver on triangular unstructured grids. ({\code ParMetis} is required for this option)}
\end{slist}
Note that these switches can only be used in certain combinations, as enforced
in the model installation scripts (particularly {\file make\_makefile.sh}. A
pure MPI approach requires the {\F dist} and {\F mpi} switches. A pure OpenMP
approach requires the {\F shrd}, {\F ompg} and {\F ompx} switches, and the
hybrid approach requires the {\F dist}, {\F mpi}, {\F ompg}, and {\F omph}
switches.

\vspace{\baselineskip}
\noindent
The following switches are associated with the continuously moving grid
options. The first switch activates the option, the other two are optional
additions.
\begin{slist}
\sit{mgp }{Activate propagation correction in
           Eq.~(\ref{eq:bal_move}).}
\sit{mgw }{Apply wind correction in moving grid approach.}
\sit{mgg }{Activate GSE alleviation correction in
           Eq.~(\ref{eq:move_GSE_avg2}).}
\end{slist}

\noindent
The following compiler dependent switches are available. They may not have
been maintained for recent compiler versions.
\begin{slist}
\sit{c90} {Compiler directives for Cray C90 (vectorization).}
\sit{nec} {Compiler directives for NEC SX6/SX8 (vectorization).}
\end{slist}

\noindent
Furthermore the following miscellaneous switches are available:
\begin{slist}
\sit{arc} {Arctic grid option for SMC grid\footnote{~Not yet fully tested according to author.}.}
\sit{cou} {Activates the calculation of variables required for coupling}
\sit{dss0}{Switch off frequency dispersion in diffusive
           dispersion correction.}
\sit{fld1}{Sea-state dependent $\tau$ \citet{art:Rei14} (\para\ref{sec:FLD1}).}
\sit{fld2}{Sea-state dependent $\tau$ \citet{art:Don12} (\para\ref{sec:FLD2}).}
\sit{ig1} {Second-order spectrum and free infragravity waves (\para\ref{sec:IG1}.}
\sit{mlim}{Use Miche-style shallow water limiter of Eq.~(\ref{eq:MLIM})}.
\sit{mpibdi}{Experimental parallelization of multi-grid model initialization.}
\sit{mpit}{Test output for \mpi\ initializations.}
\sit{mprf}{Profiling of individual models and nesting in {\file ww3\_multi}.}
\sit{nc4} {Activates the NetCDF-4 API in the NetCDF pre- and post-processing
           programs.}
\sit{ncc} {NCEP coupler.}
\sit{nco} {Code modifications for operational implementation at NCO
           (NCEP Central Operations). Mostly changes unit numbers
           and file names. Not recommended for general use.}
\sit{nls }{Activate nonlinear smoother (\para\ref{sec:NLS}).}
\sit{nnt} {Generate file test\_data\_{\it{nnn}}.ww3 with spectra and
           nonlinear interactions for training and testing of NNIA}.
\sit{oasis }{Initializes OASIS Coupler (App.~\ref{sec:couplingB}).}
\sit{oasacm}{OASIS atmospheric model coupling fields(App.~\ref{sec:couplingB}).}
\sit{oasocm}{OASIS oceanic model coupling fields (App.~\ref{sec:couplingB}).}
\sit{oasicm}{OASIS sea ice model coupling fields (App.~\ref{sec:couplingB}).}
\sit{refrx} {Enables refraction based on spatial gradients in phase velocity (\para\ref{sec:ICE3})}
\sit{reft}{Test output for shoreline reflection (which is activated with
          {\F ref1}).}
\sit{rtd} {Rotated grid option.}
\sit{rwnd}{Correct wind speed for current velocity.}
\sit{s}   {Enable subroutine tracing in the main \ws\
           subroutines by activating calls to the
           subroutine {\F strace}.}
\sit{scrip   }{Enable SCRIP remapping routines (App. \ref{sec:scripC})}
\sit{scripnc }{Enable storage of remapping weights in NetCDF files
 (App. \ref{sec:scripC})}
\sit{sec1}{Enable the use of global time steps less than 1~s, but does not
           allow output at time steps less than 1~s.}
\sit{smc} {Activate SMC grid.}
\sit{t}   {Enable test output throughout the program(s).}
\sitn{t}  {Id.}
\sit{tdyn}{Dynamic increment of swell age in diffusive
           dispersion correction (test cases only).}
\sit{tide }{Enables tidal analysis: used for pre-processing of input
           files, run-time tidal prediction in ww3\_shel or tidal prediction
           with ww3\_prtide.}
\sit{tidet}{test output for tidal analysis.}
\sit{trknc} {Activates the NetCDF API in the wave system tracking
           post-processing program. Selecting TRKNC alone will generate
           NetCDF-3 files. Selecting both TRKNC and NC4 will generate
           NetCDF-4 files.}
\sit{uost}{Enable the unresolved obstacles source term.}
\sit{xw0 }{Swell diffusion only in \uq\ scheme.}
\sit{xw1 }{Id. wave growth diffusion only.}
\end{slist}

\vsssub
\subsubsection{~Default model settings} \label{sub:opt_default}
\vsssub

Up to model version 3.14, the NCEP operational model setup was considered as
the default model setup. However, with subsequent versions of \ws, the model
has evolved into a modeling framework rather than a single model. With this,
\ws\ is run differently at various centers, and a clear ``default'' model
version can no longer be identified.  Nevertheless, in order to be able to
concisely identify in publications exactly which model setup is used,
``default'' configurations of various centers are now provided in the {\file
bin} directory. These configurations are provided in example switch files and
README files, such as {\file switch\_NCEP\_st2} and {\file README.NCEP}. Note
that these files are provided to simplify referring to model version, but do
not imply an endorsement of the specific model configuration.; in this
context, it should be noted that by nature, model versions at operational
centers are in a continuous state of development.

% With the plethora of numerical and physical options in \ws, and with the different and ever evolving way \ws\ is implemented at various organizations, we no longer provide a `default' model set up for the model with respect to most numerical and physical approaches. The only setup options that are still considered default is the treatment of input fields.

% \begin{slist}
% \sit{wnt1} {Wind interpolation (linear).}
% \sit{wnx1} {Wind interpolation (linear).}
% \sit{rwnd} {Define wind as relative to current.}
% \sit{crt1} {Current interpolation (linear).}
% \sit{crx1} {Current interpolation (linear).}
% \end{slist}