Skip to content

Commit

Permalink
Make it compile
Browse files Browse the repository at this point in the history
  • Loading branch information
dandavison committed Dec 16, 2024
1 parent 2554b36 commit 62c0a33
Show file tree
Hide file tree
Showing 8 changed files with 34 additions and 23 deletions.
3 changes: 0 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,3 @@ build:
cd $(BUILD_DIR) && ln -sf ../img
cd $(BUILD_DIR) && ln -sf ../mathematics.sty
cd $(BUILD_DIR) && for f in ../*.{tex,pdf}; do ln -sf $$f; done


test:
2 changes: 1 addition & 1 deletion discrete-math.tex
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ \section{Combinatorics}
\end{proof}

\begin{claim}
Consider the assignment of $n$ items $x_1, x_2, \ldots, x_n$ to $k$ buckets. Define $S_i$ to be the sum of items assigned to bucket $i$. The assignments for which $\max_i S_i$ is minimized is the assignment for which $\var S_i$ is minimized.
Consider the assignment of $n$ items $x_1, x_2, \ldots, x_n$ to $k$ buckets. Define $S_i$ to be the sum of items assigned to bucket $i$. The assignments for which $\max_i S_i$ is minimized is the assignment for which $\Var S_i$ is minimized.
\end{claim}

Not true?
Expand Down
4 changes: 1 addition & 3 deletions foundations.tex
Original file line number Diff line number Diff line change
Expand Up @@ -336,13 +336,11 @@ \subsection*{\url{https://www.reddit.com/r/explainlikeimfive/comments/61siyw/eli
then $\gcd(a, b) = 2^2 = 4$ and $\lcm(a, b) = 2^3 \cdot 3 \cdot 5 = 120$.

This can be written as a general theorem involving mins and maxes in the exponents of a product of primes.


\end{remark*}

\begin{theorem*}
$\gcd(a,b) \times \lcm(a,b) = ab$
\end{theorem}
\end{theorem*}


\section{$\sqrt{2}$ is irrational}
Expand Down
18 changes: 15 additions & 3 deletions linear-algebra.tex
Original file line number Diff line number Diff line change
Expand Up @@ -937,7 +937,7 @@ \section{Computing the n-th Fibonacci number: generating function}
\varphi^n &= f_{n-1} + f_n\varphi \\
\psi^n &= f_{n-1} + f_n\psi.
\end{align*}
\end{claim}
\end{lemma}

\begin{proof}
If we define $f_0 = 0$ then the $\varphi$ claim is true for $n=1$ ($\varphi^1 = 0 + 1\varphi$). It's also true for $n=2$ ($\varphi^2 = 1 + 1\varphi$).
Expand Down Expand Up @@ -1100,19 +1100,31 @@ \section{Computing the n-th Fibonacci number: generating function}

\begin{mdframed}
\includegraphics[width=400pt]{img/linear-algebra--vector-spaces-and-fields--computing-the-n-th-fibonacci-number-generating-function-26b7.png}
\end{mdframed}

\begin{mdframed}
\includegraphics[width=400pt]{img/linear-algebra--vector-spaces-and-fields--computing-the-n-th-fibonacci-number-generating-function-03cb.png}
\end{mdframed}

\begin{mdframed}
\includegraphics[width=400pt]{img/linear-algebra--vector-spaces-and-fields--computing-the-n-th-fibonacci-number-generating-function-f048.png}
\end{mdframed}

\begin{mdframed}
\includegraphics[width=400pt]{img/linear-algebra--vector-spaces-and-fields--computing-the-n-th-fibonacci-number-generating-function-535e.png}
\end{mdframed}

\begin{mdframed}
\includegraphics[width=400pt]{img/linear-algebra--vector-spaces-and-fields--computing-the-n-th-fibonacci-number-generating-function-63d4.png}
\end{mdframed}

\begin{mdframed}
\includegraphics[width=400pt]{img/linear-algebra--vector-spaces-and-fields--computing-the-n-th-fibonacci-number-generating-function-eaaa.png}
\end{mdframed}

\begin{mdframed}
\includegraphics[width=400pt]{img/linear-algebra--vector-spaces-and-fields--computing-the-n-th-fibonacci-number-generating-function-e844.png}
\end{mdframed}\end{mdframed}\end{mdframed}\end{mdframed}\end{mdframed}\end{mdframed}\end{mdframed}
\end{mdframed}


{\bf Check:}
Expand Down Expand Up @@ -1573,7 +1585,7 @@ \subsubsection{2. Find inverse of $V$}
\end{align*}


\subsubsection{3. Find the matrix product $V^{-1}AV$
\subsubsection{3. Find the matrix product $V^{-1}AV$}

Before getting lost in calculations, let's remember what this is. It's a
matrix that does the $A$ transformation, but \textit{in the coordinate system defined
Expand Down
11 changes: 8 additions & 3 deletions mathematics.sty
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
\usepackage{amssymb}
\usepackage{amsthm}
\usepackage{array}
\usepackage{bbm}
% \usepackage{bbm}
\usepackage{braket}
\usepackage{caption}
\usepackage{centernot}
\usepackage{xcolor}
Expand All @@ -32,11 +33,12 @@
\usepackage{mathrsfs}
\usepackage{mathtools}
\usepackage{mdframed}
%\usepackage[outputdir=.build]{minted} \setminted{fontsize=\footnotesize}
%\usepackage{MnSymbol} % \upmodels
\usepackage[outputdir=.build]{minted} \setminted{fontsize=\footnotesize}
\usepackage{MnSymbol} % \upmodels
\usepackage{parskip}
\usepackage{relsize} % \mathlarger
\usepackage{ulem} % sout
% \usepackage{upgreek}
\usepackage{verbatim}
\usepackage{tikz}
\usetikzlibrary{graphs,graphdrawing}
Expand Down Expand Up @@ -407,6 +409,9 @@
\newcommand{\correct}{\red{\checkmark}}
\newcommand{\grad}{\nabla}
\newcommand{\va}[1]{\overrightarrow{#1}}
% https://tex.stackexchange.com/questions/2233/whats-the-best-way-make-an-augmented-coefficient-matrix$
\newenvironment{amatrix}[1]{%
\left(\begin{array}{@{}*{#1}{c}|c@{}}
Expand Down
6 changes: 3 additions & 3 deletions mathematics.tex
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ \chapter{Differential Equations}
\chapter{Complex Analysis}
\include{analysis--complex-analysis--berg}
\include{analysis--complex-analysis--wittens}
% \include{analysis--complex-analysis-math185}
\include{analysis--complex-analysis-math185}

\chapter{Calculus of variations}
\include{calculus-of-variations}
Expand All @@ -58,8 +58,8 @@ \chapter{Classical Mechanics}
\include{physics--classical-mechanics--taylor}
\include{physics--classical-mechanics--morin--questions}

% \chapter{Quantum Mechanics}
% \include{physics--quantum-mechanics}
\chapter{Quantum Mechanics}
\include{physics--quantum-mechanics}

\chapter{Probability, Statistical Inference and Machine Learning}
\include{statistics-and-machine-learning--pearl--causality}
Expand Down
9 changes: 4 additions & 5 deletions statistics-and-machine-learning--cs189-hw.tex
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
\renewcommand{\N}{\mathcal{N}}
\newcommand{\Pbf}{\textbf{P}}
\renewcommand{\R}{\mathbb{R}}
\newcommand{\Var}{\text{Var}}
\newcommand{\Cov}{\text{Cov}}
\renewcommand{\Var}{\text{Var}}
\renewcommand{\Cov}{\text{Cov}}
\renewcommand{\mat}{\mathbf}

\section{Homework 2}
Expand Down Expand Up @@ -609,8 +609,8 @@ \subsection{Gaussian Classification}

\newpage
\subsection{Maximum Likelihood Estimation}
Let $X$ be a discrete random variable which takes values in $\{1, 2, 3\}$ with probabilities $P(X = 1) = p_1, P(X=2) = p_2,$ and $P(X = 3) = p_3$, where $p_1 + p_2 + p_3 = 1$. Show how to use the method of maximum likelihood to estimate $p_1, p_2,$ and $p_3$ from $n$ observations of $X: x_1, \ldots, x_n$. Express your answer in terms of the counts $$k_1 = \sum_{i=1}^n \mathbbm{1}(x_i = 1), k_2 = \sum_{i=1}^n \mathbbm{1}(x_i = 2), \text{ and }k_3 = \sum_{i=1}^n \mathbbm{1}(x_i = 3),$$ where
$$\mathbbm{1}(x = a) =
Let $X$ be a discrete random variable which takes values in $\{1, 2, 3\}$ with probabilities $P(X = 1) = p_1, P(X=2) = p_2,$ and $P(X = 3) = p_3$, where $p_1 + p_2 + p_3 = 1$. Show how to use the method of maximum likelihood to estimate $p_1, p_2,$ and $p_3$ from $n$ observations of $X: x_1, \ldots, x_n$. Express your answer in terms of the counts $$k_1 = \sum_{i=1}^n \mathbb{1}(x_i = 1), k_2 = \sum_{i=1}^n \mathbb{1}(x_i = 2), \text{ and }k_3 = \sum_{i=1}^n \mathbb{1}(x_i = 3),$$ where
$$\mathbb{1}(x = a) =
\begin{cases}
1 & \text{if } x = a \\
0 & \text{if } x \neq a.
Expand Down Expand Up @@ -2217,4 +2217,3 @@ \subsection{Gradient with respect to weight matrix $\V$}
\begin{mdframed}
kaggle: \texttt{dandavison7} 0.88577
\end{mdframed}

4 changes: 2 additions & 2 deletions statistics-and-machine-learning--pearl--causality.tex
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ \subsection{Conditional independence and graphoids}

Conditional independence between subsets obeys some fairly unsurprising laws:

\begin{itemize}

\begin{table}[!h]
\centering
\begin{tabular}{|l|l l l l}
Expand All @@ -227,7 +227,7 @@ \subsection{Conditional independence and graphoids}
\end{tabular}
\caption{Properties of conditional independence relation between subsets}
\end{table}
\end{itemize}


\begin{itemize}
\item Graph >
Expand Down

0 comments on commit 62c0a33

Please sign in to comment.