Initial commit, start of notes and generic macros

This commit is contained in:
2025-05-27 09:52:17 +02:00
commit ad2213ac1e
5 changed files with 331 additions and 0 deletions

6
.gitignore vendored Normal file
View File

@ -0,0 +1,6 @@
*.aux
*.fls
*.fdb_latexmk
*.log
*.pdf
*.out

26
Makefile Normal file
View File

@ -0,0 +1,26 @@
DEPS = deps/macros.sty deps/setup.sty
SOURCES = $(wildcard *.tex)
TARGETS = $(SOURCES:.tex=)
WATCH_TARGETS = $(addsuffix -watch,$(TARGETS))
CHECK_TARGETS = $(addsuffix -check,$(TARGETS))
.PHONY: all check clean $(TARGETS) $(WATCH_TARGETS) $(CHECK_TARGETS)
all: $(TARGETS)
check: $(CHECK_TARGETS)
$(TARGETS): %: %.tex
latexmk -pdf $<
$(WATCH_TARGETS): %-watch: %.tex
latexmk -pdf -pvc -interaction=nonstopmode $<
$(CHECK_TARGETS): %-check: %
@! grep -A1 "Package nag Warning" $*.log
clean:
latexmk -c
rm -f *.pdf

55
deps/macros.sty vendored Normal file
View File

@ -0,0 +1,55 @@
\NeedsTeXFormat{LaTeX2e}[1994/06/01]
\ProvidesPackage{omicron/macros}[2025-05-25 omicron/macros package]
\RequirePackage{mathtools}
\RequirePackage{amssymb}
\RequirePackage{amsthm}
% create \set and \smid macro to create sets and scaling bar for set builder notation.
\newcommand{\set}[1]{\left\{ #1 \right\}}
\newcommand{\smid}{\,\middle|\,}
% easier access to blackboard bold
\@ifpackageloaded{dsfont}{%
\let\bb\mathds
}{%
\let\bb\mathbb
}
% swap default slanted/curly versions of common relations
\let\leqflat\leq
\let\leq\leqslant
\let\geqflat\geq
\let\geq\geqslant
\let\precflateq\preceq
\let\preceq\preccurlyeq
\let\succflateq\succeq
\let\succeq\succcurlyeq
% swap varepsilon and epsilon
\let\uglyepsilon\epsilon
\let\epsilon\varepsilon
\let\varepsilon\uglyepsilon
% swap varphi and phi
\let\uglyphi\phi
\let\phi\varphi
\let\varphi\uglyphi
% scaling abs value
\newcommand{\abs}[1]{\left|#1\right|}
% scaling parenthesis
\newcommand{\paren}[1]{\left(#1\right)}
% Probability function
\DeclareMathOperator{\probop}{P}
\newcommand{\prob}[1]{\probop\paren{#1}}
% Complement superscript operator
\DeclareMathOperator{\complop}{c}
\newcommand{\mycomplement}{{\complop}}
\let\altcomplement\complement
\let\complement\mycomplement
\endinput

62
deps/setup.sty vendored Normal file
View File

@ -0,0 +1,62 @@
\NeedsTeXFormat{LaTeX2e}[1994/06/01]
\ProvidesPackage{omicron/setup}[2025-05-25 omicron/setup package]
% better typesetting
\RequirePackage[T1]{fontenc}
\RequirePackage{lmodern}
\RequirePackage{microtype}
\RequirePackage{bbm}
\RequirePackage{dsfont}
% math essentials
\RequirePackage{amsmath}
\RequirePackage{amssymb}
\RequirePackage{amsthm}
\RequirePackage{thmtools}
\RequirePackage{mathtools}
% for title page edits
\RequirePackage{titling}
% utility
\RequirePackage{enumitem}
\RequirePackage{hyperref}
\RequirePackage{cleveref}
\RequirePackage{todonotes}
% Helps create better more modern LaTeX
\RequirePackage[l2tabu, orthodox]{nag}
% lorem ipsum
\RequirePackage{lipsum}
% No indent style paragraphs
\setlength{\parindent}{0pt}
\setlength{\parskip}{0.5\baselineskip plus 2pt minus 1pt}
% subtitle macro
\newcommand{\subtitle}[1]{%
\posttitle{%
\par\end{center}
\begin{center}
\parbox{0.7\textwidth}{\centering#1}
\end{center}
\vskip0.5em}%
}
% Remove the date completely from the title page
\predate{}
\date{}
\postdate{}
% Essential theorem environments
\declaretheorem[style=definition, name=Definition]{definition}
\declaretheorem[style=definition, sibling=definition, name=Theorem]{theorem}
\declaretheorem[style=definition, sibling=definition, name=Lemma]{lemma}
\declaretheorem[style=definition, sibling=definition, name=Observation]{observation}
\declaretheorem[style=definition, sibling=definition, name=Rules]{rules}
% default enumeration style
\setlist[enumerate]{label=(\arabic*)}
\endinput

182
probability.tex Normal file
View File

@ -0,0 +1,182 @@
\documentclass{article}
\usepackage{deps/setup}
\usepackage{deps/macros}
\usepackage{showkeys}
\title{Probability Notes}
\subtitle{Based on KUL Course Notes for ``Kansrekenen I'' (2018) by Tim Verdonck}
\author{omicron}
\begin{document}
\maketitle
\section{Probability Spaces}
\begin{definition}[Sigma Algebra]\label{def:sigma-algebra}
A collection $\mathcal A$ of subsets of $\Omega$ is called a
\emph{sigma-algebra} (or $\sigma$-algebra) on the universe $\Omega$ if
$\mathcal A$ satisfies the following axioms:
\begin{enumerate}
\item $\Omega \in \mathcal A$,
\item $A \in \mathcal A \implies A^\complement \in \mathcal A$,
\item $\forall n\in\bb N : A_n \in \mathcal A \implies
\paren{\bigcup_{n\in \bb N} A_n} \in \mathcal A$.
\end{enumerate}
We call the pair $(\Omega, \mathcal A)$ a \emph{measurable space} and the
elements of $\mathcal A$ \emph{events}.
\end{definition}
\begin{observation}\label{obs:has-empty}
Let $(\Omega, \mathcal A)$ be a measurable space, then $\emptyset \in
\mathcal A$.
\end{observation}
\begin{proof}
By \cref{def:sigma-algebra} we have $\Omega \in \mathcal A$ and
$\Omega^\complement = \emptyset \in \mathcal A$.
\end{proof}
\begin{definition}[Probability Measure]\label{def:probability-measure}
A function $\probop : \mathcal A \to \bb R$ is called a \emph{probability
measure} if it satisfies the following axioms:
\begin{enumerate}
\item $\prob{\Omega} = 1$.
\item $\forall A \in \mathcal A : \prob A \geq 0$.
\item For a family of pairwise disjoint sets $A_1, A_2, \ldots \in
\mathcal A$,
\[
\prob{\bigcup_{n \in \bb N} A_n} = \sum_{n \in \bb N}
\prob{A_n}.
\]
We call this axiom the axiom of \emph{countable additivity} or
\emph{$\sigma$-additivity}.
\end{enumerate}
The triple $(\Omega, \mathcal A, \probop)$ is called a \emph{probability
space}, comprised of the universe $\Omega$, a $\sigma$-algebra $\mathcal A$
and a probability measure $\probop$.
\end{definition}
\begin{observation}\label{obs:prob-empty}
Let $(\Omega, \mathcal A, \probop)$ be a probability space, then
$\prob{\emptyset} = 0$.
\end{observation}
\begin{proof}
Note that $\emptyset = \bigcup_{n\in\bb N} \emptyset$ and that the
right-hand side is a union of disjoint sets. By applying the
sigma-additivity axiom we get \[ \prob{\emptyset} = \prob{\bigcup_{n\in\bb
N} \emptyset} = \sum_{n\in\bb N} \prob{\emptyset}. \] Since $P$ takes real
values we know the series must converge. This can only happen if
$P(\emptyset) = 0$.
\end{proof}
\begin{definition}[Monotonous sequence of sets]\label{def:monotonous-sets}
A sequence of sets $\paren{A_n}_{n\in\bb N_0}$ is said to be
\emph{increasing} if $A_n \subseteq A_{n+1}$ for
every $n \in \bb N_0$. Similarly, a sequence is called \emph{decreasing}
if $A_n \supseteq A_{n+1}$ for every $n \in \bb
N_0$. A sequence is called \emph{monotonous} if it is either increasing or
decreasing. For such sequences we define
\[
\lim_{n\to\infty} A_n = \begin{cases}
\bigcup_{n=1}^{\infty} A_n & \text{if $A_n$ is increasing}, \\
\bigcap_{n=1}^{\infty} A_n & \text{if $A_n$ is decreasing}. \\
\end{cases}
\]
\end{definition}
\begin{theorem}
Let $(\Omega, \mathcal A, \probop)$ be a probability space.
\begin{enumerate}
\item \emph{Finite additivity} for a pairwise disjoint family of sets
$\set{A_n \in \mathcal A \smid n \in \set{1, \dots, N}}$
\[
\prob{\bigcup_{n=1}^{N} A_n} = \sum_{n=1}^{N} \prob{A_n}.
\]
\item $\forall A \in \mathcal A : \prob{A^\complement} = 1 - \prob{A}$.
\item For a monotonous sequence $\paren{A_n}_{n\in\bb N_0}$
\[
\prob{\lim_{n\to\infty} A_n} = \lim_{n\to\infty} \prob{A_n}
\]
\end{enumerate}
\end{theorem}
\begin{proof}
\begin{enumerate}
\item We start by showing finite additivity as defined above holds. Consider the
finite family of sets defined above, we define a related infinite family of
sets as follows
\[
B_n = \begin{cases}
A_n & \text{if $n \leq N$}, \\
\emptyset & \text{otherwise}.
\end{cases}
\]
Note that since we only added empty sets this new family is also pairwise
disjoint and that the countable union over $B_n$ is equal to the finite
union over $A_n$. This leads to
\begin{align*}
\prob{\bigcup_{n=1}^{N} A_n}
&= \prob{\bigcup_{n=1}^{\infty} B_n}. \\
\intertext{Next we apply countable additivity by \cref{def:probability-measure} and get}
&= \sum_{n=1}^{\infty} \prob{B_n} \\
&= \sum_{n=1}^{N} \prob{A_n} + \sum_{n=N+1}^{\infty} \prob{\emptyset}.
\intertext{In \cref{obs:prob-empty} we concluded $\prob{\emptyset} = 0$ so}
&= \sum_{n=1}^{N} \prob{A_n}.
\end{align*}
This concludes the proof of finite additivity.
\item Let $A \in \mathcal A$ be arbitrary. By
\cref{def:probability-measure}, finite additivity and the definition of
complement we get
\[
1 = \prob{\Omega} = \prob{A \cup A^\complement} = \prob{A} + \prob{A^\complement}.
\]
Subtracting $\prob{A}$ from both sides gives us
\[
\prob{A^\complement} = 1 - \prob{A}.
\]
This concludes the proof of the second point.
\item Let $(A_n)_{n\in\bb N_0}$ be a monotonous sequence in $\mathcal A$.
We first consider the case where $(A_n)$ is increasing. We define a
related sequence as follows
\[
B_n = \begin{cases}
A_1 & \text{if $n=1$,} \\
A_n \setminus A_{n-1} & \text{otherwise.}
\end{cases}
\]
Note that $(B_n)$ is pairwise disjoint and that for any $n \in \bb N_0$
\[
\bigcup_{i=1}^n A_i = \bigcup_{i=1}^n B_i = A_n
\]
By using the properties of this related sequence and by applying sigma
additivity we get
\begin{align*}
\prob{\lim_{n\to\infty} A_n}
&= \prob{\bigcup_{i=1}^\infty A_i} \\
&= \prob{\bigcup_{i=1}^\infty B_i} \\
&= \sum_{i=1}^\infty \prob{B_i}. \\
\intertext{Next we use the definition of a series and apply finite
additivity (in reverse) as follows}
&= \lim_{n\to\infty} \sum_{i=1}^n \prob{B_i} \\
&= \lim_{n\to\infty} \prob{\bigcup_{i=1}^n B_i} \\
&= \lim_{n\to\infty} \prob{A_n}.
\end{align*}
This concludes of the proof when $(A_n)$ is increasing. Next assume
that $(A_n)$ is decreasing. Note that the complement sequence
$(A_n^\complement)$ is an increasing sequence. Combined with De
Morgan's laws and the earlier formula for the probability of a
complement we get
\begin{align*}
\prob{\lim_{n\to\infty} A_n}
&= \prob{\bigcap_{i=1}^\infty A_i} \\
&= 1 - \prob{\bigcup_{i=1}^\infty A_i^\complement} \\
&= 1 - \prob{\lim_{n\to\infty} A_n^\complement}. \\
\intertext{since the complement sequence is an increasing sequence
we can apply the result from before and we get}
&= 1 - \lim_{n\to\infty} \prob{A_n^\complement} \\
&= 1 - \lim_{n\to\infty} 1 - \prob{A_n} \\
&= \lim_{n\to\infty} \prob{A_n}.
\end{align*}
This concludes the proof for the final case. \qedhere
\end{enumerate}
\end{proof}
\end{document}