From 60f74eb9b678f06e32d4ab945db8e69c954783aa Mon Sep 17 00:00:00 2001 From: Mark Date: Sun, 9 Apr 2023 10:58:49 -0700 Subject: [PATCH] Linear Algebra edits --- Advanced/Linear Algebra 101/main.tex | 210 +++++++++--------- .../Linear Algebra 101/parts/0 notation.tex | 87 ++++++++ .../Linear Algebra 101/parts/1 vectors.tex | 81 +++++++ 3 files changed, 268 insertions(+), 110 deletions(-) create mode 100755 Advanced/Linear Algebra 101/parts/0 notation.tex create mode 100755 Advanced/Linear Algebra 101/parts/1 vectors.tex diff --git a/Advanced/Linear Algebra 101/main.tex b/Advanced/Linear Algebra 101/main.tex index 719d081..0729ce7 100755 --- a/Advanced/Linear Algebra 101/main.tex +++ b/Advanced/Linear Algebra 101/main.tex @@ -9,6 +9,7 @@ %\usepackage{lua-visual-debug} \usepackage{tikz-3dplot} +\usetikzlibrary{quotes,angles} \begin{document} @@ -21,131 +22,120 @@ } - \section{Notation and Terminology} + \input{parts/0 notation} + \input{parts/1 vectors} + + \section{Dot Products} \definition{} - \begin{itemize} - \item $\mathbb{R}$ is the set of all real numbers. - \item $\mathbb{R}^+$ is the set of positive real numbers. Zero is not positive. - \item $\mathbb{R}^+_0$ is the set of positive real numbers and zero - \end{itemize} + We can also define the \textit{dot product} of two vectors.\footnotemark{} \\ + The dot product maps two elements of $\mathbb{R}^n$ to one element of $\mathbb{R}$: - Mathematicians are often inconsistent with their notation. Depending on the author, their mood, and the phase of the moon, $\mathbb{R}^+$ may or may not include zero. I will use the definitions above. + \footnotetext{ + \textbf{Bonus content. Feel free to skip.} + Formally, we would say that the dot product is a map from $\mathbb{R}^n \times \mathbb{R}^n$ to $\mathbb{R}$. Why is this reasonable? - \definition{} - Consider two sets $A$ and $B$. The set $A \times B$ consists of all tuples $(a, b)$ where $a \in A$ and $b \in B$. \\ - For example, $\{1, 2, 3\} \times \{\heartsuit, \star\} = \{(1,\heartsuit), (1, \star), (2,\heartsuit), (2, \star), (3,\heartsuit), (3, \star)\}$ \\ + \vspace{2mm} - \vspace{4mm} - - You can think of this as placing the two sets \say{perpendicular} to one another. In the image below, each dot corresponds to an element of $A \times B$: - - \begin{center} - \begin{tikzpicture}[ - scale=1, - bullet/.style={circle,inner sep=1.5pt,fill} - ] - \draw[->] (-0.2,0) -- (4,0) node[right]{$A$}; - \draw[->] (0,-0.2) -- (0,3) node[above]{$B$}; - - \draw (1,0.1) -- ++ (0,-0.2) node[below]{$1$}; - \draw (2,0.1) -- ++ (0,-0.2) node[below]{$2$}; - \draw (3,0.1) -- ++ (0,-0.2) node[below]{$3$}; - - \draw (0.1, 1) -- ++ (-0.2, 0) node[left]{$\heartsuit$}; - \draw (0.1, 2) -- ++ (-0.2, 0) node[left]{$\star$}; - - \node[bullet] at (1, 1){}; - \node[bullet] at (2, 1) {}; - \node[bullet] at (3, 1) {}; - \node[bullet] at (1, 2) {}; - \node[bullet] at (2, 2) {}; - \node[bullet] at (3, 2) {}; - - \end{tikzpicture} - \end{center} - - \problem{} - Let $A = \{0, 1\} \times \{0, 1\}$. \\ - Let $B = \{ a, b\}$ \\ - What is $A \times B$? - - \vfill - - \problem{} - What is $\mathbb{R} \times \mathbb{R}$? \\ - \hint{Use the \say{perpendicular} analogy} - - \vfill - \pagebreak - - \definition{} - $\mathbb{R}^n$ is the set of $n$-tuples of real numbers. \\ - In english, this means that an element of $\mathbb{R}^n$ is a list of $n$ real numbers: \\ - - \vspace{4mm} - - Elements of $\mathbb{R}^2$ look like $(a, b)$, where $a, b \in \mathbb{R}$. \hfill \note{\textit{Note:} $\mathbb{R}^2$ is pronounced \say{arrgh-two.}} - Elements of $\mathbb{R}^5$ look like $(a_1, a_2, a_3, a_4 a_5)$, where $a_n \in \mathbb{R}$. \\ - - $\mathbb{R}^1$ and $\mathbb{R}$ are identical. - - \vspace{4mm} - - Intuitively, $\mathbb{R}^2$ forms a two-dimensional plane, and $\mathbb{R}^3$ forms a three-dimensional space. \\ - $\mathbb{R}^n$ is hard to visualize when $n \geq 4$, but you are welcome to try. - - \problem{} - Convince yourself that $\mathbb{R} \times \mathbb{R}$ is $\mathbb{R}^2$. \\ - What is $\mathbb{R}^2 \times \mathbb{R}$? - - - \vfill - - - \section{Vectors} - - \definition{} - Elements of $\mathbb{R}^n$ are often called \textit{vectors}. \\ - As you already know, we have a few operations on vectors: - \begin{itemize} - \item Vector addition: $[a_1, a_2] + [b_1, b_2] = [a_1+b_1, a_2+b_2]$ - \item Scalar multiplication: $x \times [a_1, a_2] = [xa_1, xa_2]$. - \end{itemize} - - - \problem{} - Compute the following, or explain why you can't: - \begin{itemize} - \item $[1, 2, 3] + [1, 3, 4]$ - \item $4 \times [5, 2, 4]$ - \item $a + b$, where $a \in \mathbb{R} -^5$ and $b \in \mathbb{R}^7$ - \end{itemize} - - \vfill - \pagebreak - - \definition{} - We can also define the \textit{dot product} of two vectors. \\ - The dot product maps a pair of elements from $\mathbb{R}^n$ to $\mathbb{R}$: + It's also worth noting that a function $f$ from $X$ to $Y$ can defined as a subset of $X \times Y$, where for all $x \in X$ there exists a unique $y \in Y$ so that $(x, y) \in f$. Try to make sense of this definition. + } $$ a \cdot b = \sum_{i = 1}^n a_ib_i = a_1b_1 + a_2b_2 + ... + a_nb_n $$ \problem{} + Compute $[2, 3, 4, 1] \cdot [2, 4, 10, 12]$ + + \vfill + + \problem{} + Show that the dot product is + \begin{itemize} + \item Commutative + \item Distributive + \item Homogeneic: $x(a \cdot b) = xa \cdot b = a \cdot xb$ + \item Positive definite: $a \cdot a \geq 0$, with equality iff $a = 0$ + \end{itemize} + + + \vfill + \pagebreak - % pictures - % addition, scalar multiplication - % dot product - % transformations - % linearity - % matrices - % norms + + \problem{} + Say you have two vectors, $a$ and $b$. Show that $\langle a, b \rangle$ = $||a||~||b||\cos(\alpha)$ \\ + \hint{What is $c$ in terms of $a$ and $b$?} + \hint{The law of cosines is $a^2 + b^2 - 2ab\cos(\alpha) = c^2$} + \hint{The length of $a$ is $||a||$} + + + \begin{center} + \begin{tikzpicture}[scale=1] + + \draw[->] + (0,0) coordinate (o) -- node[above left] {$a$} + (1,2) coordinate (a) + ; + + \draw[->] + (o) -- node[below] {$b$} + (3,0.5) coordinate (b) + ; + + \draw[ + draw = gray, + text = gray, + - + ] (a) -- node[above] {$c$} (b); + + \draw + pic[ + "$\alpha$", + draw = orange, + text = orange, + <->, + angle eccentricity = 1.2, + angle radius = 1cm + ] + { angle = b--o--a } + ; + + \end{tikzpicture} + \end{center} + + + + + \vfill + \pagebreak + + \begin{minipage}[t]{0.48\textwidth}\vspace{0pt} + \begin{center} + \begin{tikzpicture}[scale=1] + \draw[dashed,->] (-0.5,0) -- (4,0) node[right]{}; + \draw[dashed,->] (0,-0.5) -- (0,3) node[above]{}; + + \draw[->] (0,0) -- (1,2) node[right]{}; + \draw[->] (0,0) -- (3,0.5) node[above]{}; + \end{tikzpicture} + \end{center} + \end{minipage} + \begin{minipage}[t]{0.48\textwidth}\vspace{0pt} + \begin{center} + \begin{tikzpicture}[scale=1] + \draw[dashed,->] (-0.5,0) -- (4,0) node[right]{}; + \draw[dashed,->] (0,-0.5) -- (0,3) node[above]{}; + + \draw[->] (0,0) -- (3,1) node[right]{}; + \draw[->] (0,0) -- (3,0.5) node[above]{}; + \end{tikzpicture} + \end{center} + \end{minipage} + diff --git a/Advanced/Linear Algebra 101/parts/0 notation.tex b/Advanced/Linear Algebra 101/parts/0 notation.tex new file mode 100755 index 0000000..aba4de2 --- /dev/null +++ b/Advanced/Linear Algebra 101/parts/0 notation.tex @@ -0,0 +1,87 @@ +\section{Notation and Terminology} + +\definition{} +\begin{itemize} + \item $\mathbb{R}$ is the set of all real numbers. + \item $\mathbb{R}^+$ is the set of positive real numbers. Zero is not positive. + \item $\mathbb{R}^+_0$ is the set of positive real numbers and zero. +\end{itemize} + +Mathematicians are often inconsistent with their notation. Depending on the author, their mood, and the phase of the moon, $\mathbb{R}^+$ may or may not include zero. I will use the definitions above. + + +\definition{} +Consider two sets $A$ and $B$. The set $A \times B$ consists of all tuples $(a, b)$ where $a \in A$ and $b \in B$. \\ +For example, $\{1, 2, 3\} \times \{\heartsuit, \star\} = \{(1,\heartsuit), (1, \star), (2,\heartsuit), (2, \star), (3,\heartsuit), (3, \star)\}$ \\ +This is called the \textit{cartesian product}. + +\vspace{4mm} + +You can think of this as placing the two sets \say{perpendicular} to one another: + +\begin{center} +\begin{tikzpicture}[ + scale=1, + bullet/.style={circle,inner sep=1.5pt,fill} +] + \draw[->] (-0.2,0) -- (4,0) node[right]{$A$}; + \draw[->] (0,-0.2) -- (0,3) node[above]{$B$}; + + \draw (1,0.1) -- ++ (0,-0.2) node[below]{$1$}; + \draw (2,0.1) -- ++ (0,-0.2) node[below]{$2$}; + \draw (3,0.1) -- ++ (0,-0.2) node[below]{$3$}; + + \draw (0.1, 1) -- ++ (-0.2, 0) node[left]{$\heartsuit$}; + \draw (0.1, 2) -- ++ (-0.2, 0) node[left]{$\star$}; + + \node[bullet] at (1, 1){}; + \node[bullet] at (2, 1) {}; + \node[bullet] at (3, 1) {}; + \node[bullet] at (1, 2) {}; + \node[bullet] at (2, 2) {}; + \node[bullet] at (3, 2) {}; + + + \draw[rounded corners] (0.5, 0.5) rectangle (3.5, 2.5) {}; + \node[above] at (2, 2.5) {$A \times B$}; + +\end{tikzpicture} +\end{center} + +\problem{} +Let $A = \{0, 1\} \times \{0, 1\}$ \\ +Let $B = \{ a, b\}$ \\ +What is $A \times B$? + +\vfill + +\problem{} +What is $\mathbb{R} \times \mathbb{R}$? \\ +\hint{Use the \say{perpendicular} analogy} + +\vfill +\pagebreak + +\definition{} +$\mathbb{R}^n$ is the set of $n$-tuples of real numbers. \\ +In english, this means that an element of $\mathbb{R}^n$ is a list of $n$ real numbers: \\ + +\vspace{4mm} + +Elements of $\mathbb{R}^2$ look like $(a, b)$, where $a, b \in \mathbb{R}$. \hfill \note{\textit{Note:} $\mathbb{R}^2$ is pronounced \say{arrgh-two.}} +Elements of $\mathbb{R}^5$ look like $(a_1, a_2, a_3, a_4 a_5)$, where $a_n \in \mathbb{R}$. \\ + +$\mathbb{R}^1$ and $\mathbb{R}$ are identical. + +\vspace{4mm} + +Intuitively, $\mathbb{R}^2$ forms a two-dimensional plane, and $\mathbb{R}^3$ forms a three-dimensional space. \\ +$\mathbb{R}^n$ is hard to visualize when $n \geq 4$, but you are welcome to try. + +\problem{} +Convince yourself that $\mathbb{R} \times \mathbb{R}$ is $\mathbb{R}^2$. \\ +What is $\mathbb{R}^2 \times \mathbb{R}$? + + +\vfill +\pagebreak \ No newline at end of file diff --git a/Advanced/Linear Algebra 101/parts/1 vectors.tex b/Advanced/Linear Algebra 101/parts/1 vectors.tex new file mode 100755 index 0000000..bbc66c0 --- /dev/null +++ b/Advanced/Linear Algebra 101/parts/1 vectors.tex @@ -0,0 +1,81 @@ +\section{Vectors} + +\definition{} +Elements of $\mathbb{R}^n$ are often called \textit{vectors}. \\ +As you may already know, we have a few operations on vectors: +\begin{itemize} + \item Vector addition: $[a_1, a_2] + [b_1, b_2] = [a_1+b_1, a_2+b_2]$ + \item Scalar multiplication: $x \times [a_1, a_2] = [xa_1, xa_2]$. +\end{itemize} +\note{ + The above examples are for $\mathbb{R}^2$, and each vector thus has two components. \\ + These operations are similar for all other $n$. +} + +\problem{} +Compute the following or explain why you can't: +\begin{itemize} + \item $[1, 2, 3] - [1, 3, 4]$ \note{Subtraction works just like addition.} + \item $4 \times [5, 2, 4]$ + \item $a + b$, where $a \in \mathbb{R} +^5$ and $b \in \mathbb{R}^7$ +\end{itemize} + +\vfill + +\problem{} +Consider $(2, -1)$ and $(3, 1)$ in $\mathbb{R}^2$. \\ +Can you develop geometric intuition for their sum and difference? + +\begin{center} + \begin{tikzpicture}[scale=1] + + \draw[->] + (0,0) coordinate (o) -- node[below left] {$(1, 2)$} + (2, -1) coordinate (a) + ; + + \draw[->] + (a) -- node[below right] {$(3, 1)$} + (5, 0) coordinate (b) + ; + + \draw[ + draw = gray, + text = gray, + -> + ] + (o) -- node[above] {$??$} + (b) coordinate (s) + ; + + \end{tikzpicture} + \end{center} + + +\vfill +\pagebreak + +\definition{Euclidean Norm} +In general, a \textit{norm} on $\mathbb{R}^n$ is a map from $\mathbb{R}^n$ to $\mathbb{R}^+_0$ \\ +Usually, one thinks of a norm as a \say{length metric} on a vector space. \\ +The norm of a vector $v$ is written $||v||$. \\ + +\vspace{2mm} + +We usually use the \textit{euclidean norm} when we work in $\mathbb{R}^n$. \\ +If $v \in \mathbb{R}^n$, the euclidean norm is defined as follows: +$$ + ||v|| = \sqrt{v_1^2 + v_2^2 + ... + v_n^2} +$$ +This is simply an application of the pythagorean theorem. + +\problem{} +Compute the euclidean norm of +\begin{itemize} + \item $[2, 3]$ + \item $[-2, 1, -4, 2]$ +\end{itemize} + +\vfill +\pagebreak \ No newline at end of file