-
Notifications
You must be signed in to change notification settings - Fork 0
/
definitions.tex
74 lines (67 loc) · 2.42 KB
/
definitions.tex
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
%Some quick defs - sets
\newcommand{\nonneg}{\mathbb{N}}
\newcommand{\integer}{\mathbb{Z}}
\newcommand{\real}{\mathbb{R}}
\newcommand{\singleton}{\mathbbm{1}}
\newcommand{\binary}{\mathbbm{2}}
%Some quick defs - prob distributions
\newcommand{\probdist}{\mathcal{R}and}
\newcommand{\unifdist}{\mathcal{U}nif}
\newcommand{\binomdist}{\mathcal{B}inom}
\newcommand{\berdist}{\mathcal{B}er}
%Some quick defs - abbreviations
\newcommand{\iid}{\textsc{iid}}
\newcommand{\uar}{\textsc{uar}}
%Some quick defs - similarities
\newcommand{\jaccsim}{\mathcal{J}acc}
\newcommand{\hammsim}{\mathcal{H}amm}
%Some quick defs - other
\newcommand{\permut}{\mathcal{P}erm}
\newcommand{\indep}{\perp\!\!\!\perp}
\newcommand{\expect}{\mathcal{E}}
\newcommand{\Var}{\mathrm{Var}}
\newcommand{\powerset}{\mathcal{P}}
\renewcommand{\Pr}[1]{\text{Pr}\left\{#1\right\}} % probability
\def\Prs_#1#2{\text{Pr}_{#1}\left\{{#2}\right\}} % probability with sub
\newcommand{\st}{\;\ifnum\currentgrouptype=16 \middle\fi|\;}
% Some redundant names
\newcommand{\coin}{\berdist}
\newcommand{\order}{\permut}
% Nicer lists
\renewcommand{\labelitemiii}{$\circ$}
\renewcommand{\labelenumii}{\theenumii}
\renewcommand{\theenumii}{\theenumi.\arabic{enumii}.}
\renewcommand{\labelenumiii}{\theenumiii}
\renewcommand{\theenumiii}{\theenumii\arabic{enumiii}.}
% Apply colored underline or overline to math expressions
\def\mathunderline#1#2{\color{#1}\underline{{\color{black}#2}}\color{black}}
\def\mathoverline#1#2{\color{#1}\overline{{\color{black}#2}}\color{black}}
% Theorems
\newtheorem{thm}{Theorem}[section]
\newtheorem{cor}{Corollary}[thm]
\newtheorem{claim}{Claim}[thm]
\newtheorem{lem}[thm]{Lemma}
\newtheorem{defn}{Definition}[section]
\theoremstyle{definition}
\newtheorem{obs}{Observation}[section]
\theoremstyle{remark}
\newtheorem{ex}{Example}[section]
\theoremstyle{remark}
\newtheorem{qst}{Question}[section]
% adds commands \abs and \norm (from https://tex.stackexchange.com/questions/43008/absolute-value-symbols)
\DeclarePairedDelimiter\abs{\lvert}{\rvert}%
\DeclarePairedDelimiter\norm{\lVert}{\rVert}%
\makeatletter
\let\oldabs\abs
\def\abs{\@ifstar{\oldabs}{\oldabs*}}
\let\oldnorm\norm
\def\norm{\@ifstar{\oldnorm}{\oldnorm*}}
\makeatother
% other math commands
\DeclareMathOperator*{\argmin}{arg\,min}
\DeclareMathOperator*{\argmax}{arg\,max}
\DeclareMathOperator*{\avg}{avg}
\DeclareMathOperator*{\xor}{\oplus}
% other symbols
\newcommand{\cmark}{\ding{51}}
\newcommand{\xmark}{\ding{55}}