\documentclass[10pt,a4paper]{article} % Packages \usepackage{fancyhdr} % For header and footer \usepackage{multicol} % Allows multicols in tables \usepackage{tabularx} % Intelligent column widths \usepackage{tabulary} % Used in header and footer \usepackage{hhline} % Border under tables \usepackage{graphicx} % For images \usepackage{xcolor} % For hex colours %\usepackage[utf8x]{inputenc} % For unicode character support \usepackage[T1]{fontenc} % Without this we get weird character replacements \usepackage{colortbl} % For coloured tables \usepackage{setspace} % For line height \usepackage{lastpage} % Needed for total page number \usepackage{seqsplit} % Splits long words. %\usepackage{opensans} % Can't make this work so far. Shame. Would be lovely. \usepackage[normalem]{ulem} % For underlining links % Most of the following are not required for the majority % of cheat sheets but are needed for some symbol support. \usepackage{amsmath} % Symbols \usepackage{MnSymbol} % Symbols \usepackage{wasysym} % Symbols %\usepackage[english,german,french,spanish,italian]{babel} % Languages % Document Info \author{Delegado FM (Learningbizz)} \pdfinfo{ /Title (mve137-chalmers-university.pdf) /Creator (Cheatography) /Author (Delegado FM (Learningbizz)) /Subject (MVE137 - Chalmers University Cheat Sheet) } % Lengths and widths \addtolength{\textwidth}{6cm} \addtolength{\textheight}{-1cm} \addtolength{\hoffset}{-3cm} \addtolength{\voffset}{-2cm} \setlength{\tabcolsep}{0.2cm} % Space between columns \setlength{\headsep}{-12pt} % Reduce space between header and content \setlength{\headheight}{85pt} % If less, LaTeX automatically increases it \renewcommand{\footrulewidth}{0pt} % Remove footer line \renewcommand{\headrulewidth}{0pt} % Remove header line \renewcommand{\seqinsert}{\ifmmode\allowbreak\else\-\fi} % Hyphens in seqsplit % This two commands together give roughly % the right line height in the tables \renewcommand{\arraystretch}{1.3} \onehalfspacing % Commands \newcommand{\SetRowColor}[1]{\noalign{\gdef\RowColorName{#1}}\rowcolor{\RowColorName}} % Shortcut for row colour \newcommand{\mymulticolumn}[3]{\multicolumn{#1}{>{\columncolor{\RowColorName}}#2}{#3}} % For coloured multi-cols \newcolumntype{x}[1]{>{\raggedright}p{#1}} % New column types for ragged-right paragraph columns \newcommand{\tn}{\tabularnewline} % Required as custom column type in use % Font and Colours \definecolor{HeadBackground}{HTML}{333333} \definecolor{FootBackground}{HTML}{666666} \definecolor{TextColor}{HTML}{333333} \definecolor{DarkBackground}{HTML}{A30303} \definecolor{LightBackground}{HTML}{FCF7F7} \renewcommand{\familydefault}{\sfdefault} \color{TextColor} % Header and Footer \pagestyle{fancy} \fancyhead{} % Set header to blank \fancyfoot{} % Set footer to blank \fancyhead[L]{ \noindent \begin{multicols}{3} \begin{tabulary}{5.8cm}{C} \SetRowColor{DarkBackground} \vspace{-7pt} {\parbox{\dimexpr\textwidth-2\fboxsep\relax}{\noindent \hspace*{-6pt}\includegraphics[width=5.8cm]{/web/www.cheatography.com/public/images/cheatography_logo.pdf}} } \end{tabulary} \columnbreak \begin{tabulary}{11cm}{L} \vspace{-2pt}\large{\bf{\textcolor{DarkBackground}{\textrm{MVE137 - Chalmers University Cheat Sheet}}}} \\ \normalsize{by \textcolor{DarkBackground}{Delegado FM (Learningbizz)} via \textcolor{DarkBackground}{\uline{cheatography.com/73767/cs/34116/}}} \end{tabulary} \end{multicols}} \fancyfoot[L]{ \footnotesize \noindent \begin{multicols}{3} \begin{tabulary}{5.8cm}{LL} \SetRowColor{FootBackground} \mymulticolumn{2}{p{5.377cm}}{\bf\textcolor{white}{Cheatographer}} \\ \vspace{-2pt}Delegado FM (Learningbizz) \\ \uline{cheatography.com/learningbizz} \\ \end{tabulary} \vfill \columnbreak \begin{tabulary}{5.8cm}{L} \SetRowColor{FootBackground} \mymulticolumn{1}{p{5.377cm}}{\bf\textcolor{white}{Cheat Sheet}} \\ \vspace{-2pt}Not Yet Published.\\ Updated 25th September, 2022.\\ Page {\thepage} of \pageref{LastPage}. \end{tabulary} \vfill \columnbreak \begin{tabulary}{5.8cm}{L} \SetRowColor{FootBackground} \mymulticolumn{1}{p{5.377cm}}{\bf\textcolor{white}{Sponsor}} \\ \SetRowColor{white} \vspace{-5pt} %\includegraphics[width=48px,height=48px]{dave.jpeg} Measure your website readability!\\ www.readability-score.com \end{tabulary} \end{multicols}} \begin{document} \raggedright \raggedcolumns % Set font size to small. Switch to any value % from this page to resize cheat sheet text: % www.emerson.emory.edu/services/latex/latex_169.html \footnotesize % Small font. \begin{multicols*}{3} \begin{tabularx}{5.377cm}{x{2.4885 cm} x{2.4885 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{Basic Probability Definitions}} \tn % Row 0 \SetRowColor{LightBackground} Sample Space (Ω) & Set of all possible outcomes of a random experiment. \tn % Row Count 3 (+ 3) % Row 1 \SetRowColor{white} Event & Outcome of a random experiment (inside Ω) \tn % Row Count 6 (+ 3) % Row 2 \SetRowColor{LightBackground} σ-field & The allowable events constitute a family of sets F, usually referred to as σ-field. Each set in F is a subset of the sample space Ω. \tn % Row Count 13 (+ 7) % Row 3 \SetRowColor{white} Probability measure (P) & A probability measure on (Ω, F) is a function P : F → {[}0, 1{]} that satisfies the following two properties: \{\{nl\}\} 1. P{[}Ω{]} = 1 \{\{nl\}\} 2. The probability of the union of a collection of disjoint members is the sum of its probabilities \tn % Row Count 25 (+ 12) % Row 4 \SetRowColor{LightBackground} Probability space & (Ω, F, P) \tn % Row Count 26 (+ 1) % Row 5 \SetRowColor{white} Basic properties of probability measures & P{[}∅{]} = 0 \{\{nl\}\} P{[}A¯{]} = 1 − P{[}A{]} \{\{nl\}\} If A ⊂ B, then P{[}B{]} = P{[}A{]} + P{[}B \textbackslash{} A{]} ≥ P{[}A{]} \{\{nl\}\} P{[}A ∪ B{]} = P{[}A{]} + P{[}B{]} − P{[}A ∩ B{]} \tn % Row Count 33 (+ 7) \end{tabularx} \par\addvspace{1.3em} \vfill \columnbreak \begin{tabularx}{5.377cm}{x{2.4885 cm} x{2.4885 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{Basic Probability Definitions (cont)}} \tn % Row 6 \SetRowColor{LightBackground} Inclusion Exclusion Principle \{\{nl\}\} (comes from last basic property of probability measures) & Given sets A1, A2... \{\{nl\}\} {\bf{P{[}union(Ai){]} ≤ sum(P{[}Ai{]})}} \{\{nl\}\} When the two events are disjoint, the inequality is = as they don't share any common space: P{[}A ∩ B{]} = 0 \tn % Row Count 9 (+ 9) % Row 7 \SetRowColor{white} Sampling strategy & Choose repeatedly a random number in Ω \tn % Row Count 11 (+ 2) % Row 8 \SetRowColor{LightBackground} Sampling with replacement & Select random numbers in Ω, {\bf{without taking into account}} which ones you've already tested. Therefore, there will be some numbers tested multiple times \tn % Row Count 19 (+ 8) % Row 9 \SetRowColor{white} Sampling without replacement & Select random numbers in Ω {\bf{taking into account}} which ones you've already used. Therefore, you won't run the algorithm with the same number more than once \tn % Row Count 27 (+ 8) % Row 10 \SetRowColor{LightBackground} Independent (events or family) & Two events are independent if: \{\{nl\}\} P{[}A ∩ B{]} = P{[}A{]} P{[}B{]} \{\{nl\}\} It also applies to families \{Ai, i∈ I\} \tn % Row Count 33 (+ 6) \end{tabularx} \par\addvspace{1.3em} \vfill \columnbreak \begin{tabularx}{5.377cm}{x{2.4885 cm} x{2.4885 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{Basic Probability Definitions (cont)}} \tn % Row 11 \SetRowColor{LightBackground} Pairwise & To form all possible pairs (two items at a time) from a set \tn % Row Count 3 (+ 3) % Row 12 \SetRowColor{white} Pairwise independent (family or events) & A family or events are pairwise independent if: \{\{nl\}\} {\bf{P{[}Ai ∩ Aj {]} = P{[}Ai{]} P{[}Aj{]} for all i != j}} \{\{nl\}\} In english terms, a family or events is pairwise independent if any of its possible pairs is independent of each other. For example: \{\{nl\}\} P(A∩B)=P(A)P(B) \{\{nl\}\} P(A∩C)=P(A)P(C) \{\{nl\}\} P(B∩C)=P(B)P(C) \tn % Row Count 19 (+ 16) % Row 13 \SetRowColor{LightBackground} Mutually independent (events) & More than two events (i.e. A,B,C) are mutually independent if: \{\{nl\}\} 1. They are pairwise independent \{\{nl\}\} 2. They meet the condition: \{\{nl\}\} P(A ∩ B ∩ C) = P(A) × P(B) × P(C) \{\{nl\}\} In plain english, events are mutually independent if any event is independent to the other events \tn % Row Count 34 (+ 15) \end{tabularx} \par\addvspace{1.3em} \vfill \columnbreak \begin{tabularx}{5.377cm}{x{2.4885 cm} x{2.4885 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{Basic Probability Definitions (cont)}} \tn % Row 14 \SetRowColor{LightBackground} Conditional Probability & If P{[}B{]} \textgreater{} 0, the conditional probability that A occurs give that B occurs is: P{[}A|B{]}=P{[}A∩B{]}/P{[}B{]} \tn % Row Count 5 (+ 5) % Row 15 \SetRowColor{white} Conditional Probability (independent events) & If A and B are independent events, then: \{\{nl\}\} P{[}A|B{]} = P{[}A∩ B{]}/P{[}B{]} = \{\{nl\}\}(P{[}A{]}*P{[}B{]})/P{[}B{]} = P{[}A{]} \tn % Row Count 11 (+ 6) % Row 16 \SetRowColor{LightBackground} Law of Total Probability & Let e1...en be {\bf{partitions}} of Ω\{\{nl\}\}(a collection of ALL the sets in Ω which are independent of each other). Also assuming P{[}ei{]} \textgreater{} 0 for all i. The probability of A can be written as: \{\{nl\}\} P{[}A{]} = sum(i=1,n)(P{[}A|ei{]}*P{[}ei{]})\{\{nl\}\} In english, it's the sum of all the possible scenarios in which A can occur \tn % Row Count 27 (+ 16) % Row 17 \SetRowColor{white} Bayes Theorem & Assuming e1...en be {\bf{partitions}} of Ω: \{\{nl\}\} P{[}ej|B{]} = P{[}Ej ∩ B{]}/P{[}B{]} = (P{[}B|Ej{]}{\emph{P{[}Ej{]})/(sum(i=1,n)(P{[}B|ei{]}}}P{[}ei{]}) \{\{nl\}\} It's basically using conditional theory and then applying conditional theory again for the top part and law of total probability in the lower part \tn % Row Count 41 (+ 14) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{x{2.38896 cm} x{2.58804 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{Discrete Random Variables and Expectation}} \tn % Row 0 \SetRowColor{LightBackground} Random Variable & A random variable X on a sample space Ω is a real-valued (measurable) function on Ω; that is X : Ω → R.\{\{nl\}\}Denoted as upper case in this course and real numbers as lower case \tn % Row Count 10 (+ 10) % Row 1 \SetRowColor{white} Discrete Random Variable & A discrete random variable is a random variable that outputs only a finite or countably infinite number of values\{\{nl\}\}(i.e. number of kids in a family, range between 1 and x) \tn % Row Count 19 (+ 9) % Row 2 \SetRowColor{LightBackground} Probability that X=a & Sum of all the events {\emph{w}} in Ω which X(w) = x \tn % Row Count 22 (+ 3) % Row 3 \SetRowColor{white} Independence of random variables & Two random variables X and Y are independent if and only if: \{\{nl\}\}P{[}(X = x)∩(Y = y){]} = P{[}X=x{]}*P{[}Y=y{]} \{\{nl\}\}for all values x and y \tn % Row Count 29 (+ 7) % Row 4 \SetRowColor{LightBackground} Mutually independent random variables & Like mutually independent events \tn % Row Count 31 (+ 2) \end{tabularx} \par\addvspace{1.3em} \vfill \columnbreak \begin{tabularx}{5.377cm}{x{2.38896 cm} x{2.58804 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{Discrete Random Variables and Expectation (cont)}} \tn % Row 5 \SetRowColor{LightBackground} Expectation (mean) & It is a weighted average of the values assumed by the random variable, taking into account the probability of getting that value.\{\{nl\}\}The expectation of a discrete random variable X, denoted by E{[}X{]} is given by\{\{nl\}\}E{[}X{]} = sum(i=x,X)(x*P{[}X = x{]}) \tn % Row Count 13 (+ 13) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} % That's all folks \end{multicols*} \end{document}