From 641a93354793b7cacd9abce1d61424c6fb5e0905 Mon Sep 17 00:00:00 2001 From: Joshua Liu Date: Sat, 12 Sep 2026 22:43:53 -0400 Subject: feat: updating notes information cutoff 0911 also creating .gitignore --- main.tex | 294 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 294 insertions(+) create mode 100644 main.tex (limited to 'main.tex') diff --git a/main.tex b/main.tex new file mode 100644 index 0000000..cd4cf9d --- /dev/null +++ b/main.tex @@ -0,0 +1,294 @@ +\documentclass[a4paper]{article} + +% Imports +\usepackage{amssymb} +\usepackage{amsmath} +\usepackage{multicol} +\usepackage{ragged2e} +\usepackage{blindtext} +\usepackage[english]{babel} %this is the dictionary you will use +\usepackage{graphicx,mathdots,chemarr,fancyvrb,comment} %some more packages +\usepackage{tikz} %some more packages +%the packages from here on will help with creating a graph +%tikzpicture +\usepackage[many]{tcolorbox} +\usepackage{wrapfig} +\usepackage{scalerel} +\usepackage{pict2e} +\usepackage{tkz-euclide} +\usepackage{scalerel} +\usepackage{pict2e} +\usepackage{tkz-euclide} +\usepackage{listings} +\usepackage{color} +\usepackage{xifthen} +\usepackage{hyperref} +\usepackage{xstring} % for \IfStrEqCase + +\newcounter{lemmacount} +\newcounter{proofcount} +\graphicspath{ {/home/butterdog/Documents/texassets/} } +\definecolor{dkgreen}{rgb}{0,0.6,0} +%\definecolor{gray}{rgb}{0.5,0.5,0.5} +\definecolor{red}{HTML}{ffb3b3} +\definecolor{redbar}{HTML}{ff0000} +\definecolor{mauve}{rgb}{0.58,0,0.82} +\definecolor{cyanbar}{HTML}{00bfff} +\definecolor{cyan}{HTML}{b3f0ff} +\definecolor{greenbar}{HTML}{00ff00} +\definecolor{green}{HTML}{8cd98c} +\definecolor{main}{HTML}{5989cf} % setting main color to be used +\definecolor{sub}{HTML}{cde4ff} % setting sub color to be used +\tcbset{ + sharp corners, + colback = white, + before skip = 0.2cm, % add extra space before the box + after skip = 0.5cm % add extra space after the box +} % setting global options for tcolorbox +\makeatletter + +\lstset{frame=tb, + language=Java, + aboveskip=3mm, + belowskip=3mm, + showstringspaces=false, + columns=flexible, + basicstyle={\small\ttfamily}, + numbers=none, + numberstyle=\tiny\color{gray}, + keywordstyle=\color{blue}, + commentstyle=\color{dkgreen}, + stringstyle=\color{mauve}, + breaklines=true, + breakatwhitespace=true, + tabsize=3 +} + +%My Custom Commands +\newcommand{\mnewline}{\newline\newline\newline} +\newcommand{\mline}{\rule{0.5cm}{0.5pt}} +\newcommand{\proj}[1]{\text{Proj}_{#1}} +\newcommand{\st}{\ni:} +\newcommand{\evaline}[2]{\Big|^{#1}_{#2}} +\newcommand{\nulli}[1]{\text{Null }{#1}} +\newcommand{\ran}[1]{\text{ran }{#1}} +\newcommand{\col}[1]{\text{Col }({#1})} +\newcommand{\re}[1]{\text{Re}({#1})} +\newcommand{\im}[1]{\text{Im}({#1})} +\newcommand{\spa}[1]{\text{span}\{{#1}\}} +\newcommand{\cvec}[1]{\underline{#1}} +%\newcommand{\neproof}[3]{$\text{Let } \epsilon > {#2} \text{ be given}$\\\text{Choose $N = {#1}$\text{ Suppose $n > N > {#3}$}}} +\newcommand{\neproof}[3]{ %The first one is without the 3rd argument and the second one is + \ifthenelse{\isempty{#3}}{$\text{Let } \epsilon > {#2} \text{ be given}$\\\text{Choose $N = {#1}$\text{ Suppose $n > N$}}} + {$\text{Let } \epsilon > {#2} \text{ be given}$\\\text{Choose $N = {#1}$\text{ Suppose $n > N > {#3}$}}} +} +\newcommand{\infobox}[2]{\begin{InfoBox} + \smash{\raisebox{-5pt}{\includegraphics[width=0.77cm,height=0.68cm]{information}}}{\bf #1}\newline\newline + {#2} +\end{InfoBox}} +\newcommand{\warningbox}[2]{\begin{WarningBox} + \smash{\raisebox{-6pt}{\includegraphics[width=0.70cm,height=0.70cm]{warning}}} + {\bf #1}\newline\newline + {#2} +\end{WarningBox}} +\newcommand{\theorybox}[2]{\begin{TheoryBox} + \smash{\raisebox{-6pt}{\includegraphics[width=0.70cm,height=0.70cm]{theorem}}} + {\bf #1}\newline\newline + {#2} +\end{TheoryBox}} +\newcommand{\notebox}[2]{\begin{NoteBox} + \smash{\raisebox{-6pt}{\includegraphics[width=0.55cm,height=0.70cm]{reminder}}} + {\bf #1}\newline\newline + {#2} +\end{NoteBox}} +\newcommand{\proofbox}[3]{% + \IfStrEqCase{#1}{% + {lemma}{\stepcounter{lemmacount}\def\proofboxlabel{Lemma \thelemmacount}}% + {proof}{\stepcounter{proofcount}\def\proofboxlabel{Proof \theproofcount}}% + }[\PackageError{proofbox}{Unknown proofbox type '#1'}{Use 'lemma' or 'proof'}]% + \begin{ProofBox} + \IfStrEq{#2}{}% + {{\bf \proofboxlabel:}}% + {{\bf \proofboxlabel\ (#2):}}% + \newline\newline + {#3} + \end{ProofBox} +} +\renewcommand*\env@matrix[1][*\c@MaxMatrixCols c]{% + \hskip -\arraycolsep + \let\@ifnextchar\new@ifnextchar + \array{#1}} +\newtcolorbox{InfoBox}{ + colback = sub, + colframe = main, + boxrule = 0pt, + leftrule = 6pt % left rule weight +} +\newtcolorbox{WarningBox}{ + colback = red, + colframe = redbar, + boxrule = 0pt, + leftrule = 6pt % left rule weight +} +\newtcolorbox{TheoryBox}{ + colback = cyan, + colframe = cyanbar, + boxrule = 0pt, + leftrule = 6pt % left rule weight +} +\newtcolorbox{NoteBox}{ + colback = green, + colframe = greenbar, + boxrule = 0pt, + leftrule = 6pt % left rule weight +} +\newtcolorbox{TitleBox}{ + boxrule = 2pt, + rounded corners +} +\newtcolorbox{ProofBox}{ + boxrule = 1.3pt, +} +\makeatother +\usepackage[letterpaper,left=6mm,includemp=true,marginparwidth=12mm,marginparsep=1mm,reversemarginpar,right=19mm, +includefoot=true,top=19mm,nohead,footskip=12mm,bottom=6mm]{geometry} +% Here are the custom commands I have created. They are increadibly retarded +% mnewline: creates 3 newlines +% mline: Creates a horizontal line +% proj: Creates a Proj with a suitable subscript - Takes an argument +% st: creates a ni and a : as the 'such that' +% evaline: creates a vertical line for evaluated definite integrals. First argument is upper limit, second is lower. - Takes two arguments +% nulli: creates a Null (with a whitespace) - Takes an argument +% col: creates a Col (with a whitespace) - Takes an argument +% ran: creates a ran (with a whitespace) - Takes an argument +% re: creates a Re() - Takes an argument +% im: creates a Im() - Takes an argument +% sp: creates a span{} - Takes an argument +% neproof: Creates a cookie cutter N-epsilon proof. First argument set's N's value and second argument sets epsilon greater than value and the third (optional) argument sets the n > N > value. IF YOU DO NOT WANT THE THIRD ARGUMENT YOU NEED AN EMPTY CURLY BRACKET +\begin{document} + \setlength{\parindent}{1cm} + \begin{center} + {\bf \Large CSCC37} + \end{center} + \begin{TitleBox} + \begin{center} + {\bf Main Notes} + \end{center} + \end{TitleBox} + \tableofcontents + \pagebreak + \section{Floating Point Arithmetic} + \subsection{Overview} + A broad overview of this chapter is studying how computers represent real numbers and how we manipulate them. This is because while some real numbers are much easier, like integers, dealing with irrational values, even just seemingly simple decimal values like $0.1$ can be challenging. Often when dealing with floating point values we deal with issues such as rounding or even chopping, which lead to round off error, and can subsequently lead to error propagation. For example, if we have a computer that can only handle four digit floating point values, and we subtract $0.1234367$ and $0.1234216$, we would expect something like $1.51*10^{-4}$, but because our computer can only do four digits, we actually get $0$. While this may seem close enough, ``close enough'' is relative. If we are only dealing with very small values, this is a massive issue.\\ + \theorybox{Definition -- Conditioning/Stability}{These two both refer to how we measure how small changes in the initial input impact the final result. While both do this, they apply to different things. Conditioning applies specifically to functions, where we say the condition of $f$ or $\text{cond}(f)$. Stability meanwhile refers to algorithms where we can have multiple inputs and outputs. The value is always a number that indicates the amplification of the impact.} + \pagebreak + \section{Solving Linear Systems of Equations} + \subsection{Overview} + \notebox{Notation}{$A$ in this context refers to a square matrix. We should only be handling square matrices because non-squares are handled in the next course. Row/Column vectors are denoted with an underline such as $\underline{x}$ or $\underline{b}$.\\\\ + When referring to the triangular matrices, we use $\triangle^r$. Refer to B24 notes for definitions on what is an upper/lower (strict) matrix.} + Here we will be exploring how to solve these systems, how error propagation affects them and how to control the error propagation.\\ + \infobox{Review Linear Algebra}{Review concepts such as triangular matrices, square matrices and their properties.} + \subsection{Direct Method} + So as a recap, our problem is $A\cvec{x} = \cvec{b}$. We know $A$ and $\cvec{b}$, and we want to solve for $\cvec{x}$. + \infobox{Do you want to learn more?}{This is the method that Pancer is using for this course. More information can be found in the textbook Scientific Computing: An Introductory Survey.} + The direct method is the method already introduced in A22 but with some extra steps. Remember that while the process might be like ``why do it like this, why these inbetweener steps'', its all to simplify the calculations.\\ + \begin{enumerate} + \item Factorize $A$\\ + We will factorize $A = LU$, where $L$ is a unit lower $\triangle^r$ and $V$ is an upper $\triangle^r$. + \notebox{Why are they square}{$L$ and $U$ don't necessarily have to be square, but as you will see in the later steps, it helps that they are.} + Note that by doing this, we have turned $A$, which is an unstructured matrix that is likely dense, into two highly structured matrices. + \item Restate the problem\\ + So now: + \begin{equation} + A\cvec{x} = \cvec{b} \iff LU\cvec{x} = \cvec{b} + \end{equation} + \item Next, we will do a change of variable and make + \begin{equation} + L\cvec{d} = \cvec{b} + \end{equation} + Where + \begin{equation} + \cvec{d} = U\cvec{x} + \end{equation} + \item Next, solve for $\cvec{d}$. + So if we expand we will have something like: + \begin{equation} + \left[ + \begin{array}{cccc} + 1&&&0\\ + \ell_{21}&1&&\\ + \vdots&&\ddots&\\ + \ell_{n1}&\cdots&&1\\ + \end{array} + \right] + \left[ + \begin{array}{c} + d_1\\ + d_2\\ + \vdots\\ + d_n + \end{array} + \right] + = + \left[ + \begin{array}{c} + d_1\\ + \ell_{21}d_1 + d_2\\ + \vdots\\ + \vdots\\ + \end{array} + \right] + = + \left[ + \begin{array}{c} + b_1\\ + b_2\\ + \vdots\\ + \vdots\\ + \end{array} + \right] + \end{equation} + Which honestly is not too bad, second result depends on first, third on second, etc. It just unfolds like that.\\ + If this looks confusing, {\it remember} that we have $\ell_{ii}$ and we have $b_i$. We just have to work our way down. This is called {\bf forward elimination}. + \item Then solve $U\cvec{x} = \cvec{d}$ for $\cvec{x}$. We have to do this because the point is not to solve $D$, but to solve $\cvec{x}$. + \begin{equation} + \left[ + \begin{array}{cccc} + u_{11} > 0&&\cdots&u_{1n} > 0\\ + 0&u_{22}>0&&\\ + \vdots &&\ddots&\\ + 0&\cdots&\cdots&u_{nn} > 0\\ + \end{array} + \right] + \left[ + \begin{array}{c} + x_1\\ + \vdots\\ + x_n + \end{array} + \right] + = + \left[ + \begin{array}{c} + d_1\\ + \vdots\\ + d_n + \end{array} + \right] + \end{equation} + And from this it is obvious that $x_n = \frac{d_n}{u_{nn}}$. And thus we can calculate $x_i$. Here we have to work our way up as opposed to step 4 where we worked down. this is called {\bf backwards substitution}. + \end{enumerate} + Just note that this process has a lot of error propagation. One of the reasons is because this algorithm has a runtime of $\mathcal{O}(n^3)$ and as we run more, we perform more operations which causes more rounding or chopping. This will be elaborated on later. + \subsection{Indirect Method} + \theorybox{Definition -- X-Test}{TBA} + \theorybox{Definition -- F-Test}{TBA} + \subsection{Iterative Refinement/Improvement} + \pagebreak + \section{Solving Non-linear Single Equations} + \subsection{Overview} + For this section we are only doing single equations because doing multiple requires knowledge of multivariable calculus (and fuck that shit).\\ + Non-linear problems are harder because of the fact that we don't always know how many solutions there will be. + \theorybox{Definition -- Fixed Point Problem -- FPP}{The FPP relates directly with the FPI, or Fixed Point Iteration} + \theorybox{Definition -- Fixed Point Iteration -- FPI}{TBA} + \pagebreak +\end{document} -- cgit v1.2.3