\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{jack1982} \pdfinfo{ /Title (omsa-midterm-exam-2.pdf) /Creator (Cheatography) /Author (jack1982) /Subject (OMSA Midterm Exam 2 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}{A3A3A3} \definecolor{LightBackground}{HTML}{F3F3F3} \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{OMSA Midterm Exam 2 Cheat Sheet}}}} \\ \normalsize{by \textcolor{DarkBackground}{jack1982} via \textcolor{DarkBackground}{\uline{cheatography.com/216403/cs/47268/}}} \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}jack1982 \\ \uline{cheatography.com/jack1982} \\ \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 31st October, 2025.\\ 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} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{5.377cm}}{\bf\textcolor{white}{Arena Templates}} \tn \SetRowColor{LightBackground} \mymulticolumn{1}{p{5.377cm}}{\vspace{1px}\centerline{\includegraphics[width=5.1cm]{/web/www.cheatography.com/public/uploads/jack1982_1761861223_Bildschirmfoto 2025-10-30 um 22.53.31.png}}} \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{x{2.04057 cm} x{2.93643 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{Arena Variables and Function}} \tn % Row 0 \SetRowColor{LightBackground} DISC(0.3, 1, 0.8, 2, 1.0, 3) & DISC generates random discrete values based on cumulative probabilities; pair each probability with its corresponding value. \tn % Row Count 6 (+ 6) % Row 1 \SetRowColor{white} TNOW & Current simulated time \tn % Row Count 7 (+ 1) % Row 2 \SetRowColor{LightBackground} NR(Res) & Res Servers currently in service \tn % Row Count 9 (+ 2) % Row 3 \SetRowColor{white} NQ(Queue) & Number of customers in Queue \tn % Row Count 11 (+ 2) % Row 4 \SetRowColor{LightBackground} Mod.NumberOut & Customers who have left the mode \tn % Row Count 13 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{x{1.69218 cm} x{3.28482 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{messy cdf}} \tn % Row 0 \SetRowColor{LightBackground} See F(X) & Replace with Uniform(0,1) \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} Multiply by 3 & U(0,3) \tn % Row Count 2 (+ 1) % Row 2 \SetRowColor{LightBackground} Subtract 1 & U(−1,2) \tn % Row Count 3 (+ 1) % Row 3 \SetRowColor{white} Mean & (-1+2)/2 = 1/2 \tn % Row Count 4 (+ 1) \hhline{>{\arrayrulecolor{DarkBackground}}--} \SetRowColor{LightBackground} \mymulticolumn{2}{x{5.377cm}}{What is the mean of the random variable 3F(X)−1?} \tn \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{x{1.54287 cm} x{3.43413 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{Inverse Transformation}} \tn % Row 0 \SetRowColor{LightBackground} Given U, find Z & invNorm(U, 0, 1) \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} Given Z, find U & normCdf(-9999, Z, 0, 1) \tn % Row Count 4 (+ 2) % Row 2 \SetRowColor{LightBackground} \seqsplit{Exponential(λ)} & X = -ln(1-U)/λ \tn % Row Count 6 (+ 2) % Row 3 \SetRowColor{white} Uniform(a,b) & X = a + (b-a)·U \tn % Row Count 7 (+ 1) % Row 4 \SetRowColor{LightBackground} Weibull(a,b) & X = a * (-ln(U))\textasciicircum{}1/b\textasciicircum{} \tn % Row Count 8 (+ 1) % Row 5 \SetRowColor{white} Triangular & If U\textless{}0.5: √(2U); If U≥0.5: 2-√(2(1-U)) \tn % Row Count 10 (+ 2) % Row 6 \SetRowColor{LightBackground} \seqsplit{Bernoulli(p)} & If U \textless{} 1-p → 0; Else → 1 \tn % Row Count 12 (+ 2) % Row 7 \SetRowColor{white} Poisson(λ) & Build CDF, match U \tn % Row Count 13 (+ 1) % Row 8 \SetRowColor{LightBackground} Discrete Unif(1,n) & {[}n·U{]} \tn % Row Count 15 (+ 2) % Row 9 \SetRowColor{white} Erlang(k,λ) & -(1/λ)ln(∏Ui) \tn % Row Count 16 (+ 1) % Row 10 \SetRowColor{LightBackground} Geometric & ln(1-U)/ln(1-p) \tn % Row Count 17 (+ 1) \hhline{>{\arrayrulecolor{DarkBackground}}--} \SetRowColor{LightBackground} \mymulticolumn{2}{x{5.377cm}}{For discrete: Find smallest x where F(x) ≥ U \newline For continuous: Use inverse CDF formulas \newline Box-Muller generates TWO Normal(0,1) values from TWO Uniform(0,1) values} \tn \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{p{0.54747 cm} x{4.42953 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{XOR}} \tn % Row 0 \SetRowColor{LightBackground} XOR & is only true if different \tn % Row Count 1 (+ 1) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{x{2.83689 cm} x{2.14011 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{Expected Value, Variance, ...}} \tn % Row 0 \SetRowColor{LightBackground} Discrete E{[}X{]} & SUM{[}x * f(x){]} \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} Continous E{[}X{]} & SUM{[}x * f(x) dx{]} \tn % Row Count 2 (+ 1) % Row 2 \SetRowColor{LightBackground} Variance of X & E{[}X\textasciicircum{}2{]} - (E{[}X{]})\textasciicircum{}2 \tn % Row Count 3 (+ 1) % Row 3 \SetRowColor{white} Standard Deviation of X & SQRT{[}Var(X){]} \tn % Row Count 5 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{x{1.84149 cm} x{3.13551 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{Random Number Generators}} \tn % Row 0 \SetRowColor{LightBackground} Bad generators & Midsquare number generator, Random number tables, von Neumann's mid-square method, Fibonacci generator, Additive congruential generator, RANDU \tn % Row Count 6 (+ 6) % Row 1 \SetRowColor{white} Good generators & Linear Congruential Generators (modern cycle length \textgreater{} 2\textasciicircum{}191\textasciicircum{}; Mersenne Twister (2\textasciicircum{}19937\textasciicircum{}) \tn % Row Count 10 (+ 4) % Row 2 \SetRowColor{LightBackground} Randu & 65539Xi mod(2\textasciicircum{}31\textasciicircum{}) \tn % Row Count 11 (+ 1) % Row 3 \SetRowColor{white} Desert island & 16807Xi mod(2\textasciicircum{}31\textasciicircum{}-1) mod(2147483647) \tn % Row Count 13 (+ 2) % Row 4 \SetRowColor{LightBackground} Desert island technique & Z = {[}SUM(Ui)-n/2{]} / {[}SQRT(n * 1/12{]} \tn % Row Count 15 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{x{2.4885 cm} x{2.4885 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{Inverse Transform Method Key Problems}} \tn % Row 0 \SetRowColor{LightBackground} If X \textasciitilde{} Normal(0,1), what's the distribution of Φ(X)? & Unif(0,1) \tn % Row Count 3 (+ 3) % Row 1 \SetRowColor{white} If U∼Uniform(0,1) and Φ(x) is the CDF of the standard normal, what is the distribution of 2Φ −1 (U)+3? & Φ−1(U) turns a Uniform(0,1) into a Normal(0,1). Multiply by 2 → scales the standard deviation by 2 = Normal(0,4). Add 3 → shifts the mean to 3. = Normal(3,4) \tn % Row Count 12 (+ 9) % Row 2 \SetRowColor{LightBackground} -3ℓn(U$^{\textrm{2}}$V$^{\textrm{2}}$) where U, V \textasciitilde{} i.i.d. Unif(0,1) & = -6ℓn(U) - 6ℓn(V) \textbackslash{}\textasciitilde{} Exp(1/6) + Exp(1/6) \textasciitilde{} Erlang₂(1/6) \tn % Row Count 16 (+ 4) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{p{0.84609 cm} x{4.13091 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{Joint Probability Mass Function}} \tn % Row 0 \SetRowColor{LightBackground} E{[}XY{]} & Summe von x * y * f(xy) \tn % Row Count 1 (+ 1) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{x{1.54287 cm} x{3.43413 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{Joint p.m.f.}} \tn % Row 0 \SetRowColor{LightBackground} Are independent if & X and Y are independent if and only if pX,Y​(x,y) = pX​(x) ⋅ pY​(y) \tn % Row Count 3 (+ 3) % Row 1 \SetRowColor{white} For example & P(X=1, Y=0) = P(Y=0) * P(X=1) \tn % Row Count 5 (+ 2) % Row 2 \SetRowColor{LightBackground} E{[}XY{]} & Example: (1)(0)(0.2) + (1)(1)(0.0.0) + ... \tn % Row Count 7 (+ 2) % Row 3 \SetRowColor{white} Cov(X,Y) & E{[}XY{]} - E{[}Y{]}E{[}X{]} \tn % Row Count 8 (+ 1) % Row 4 \SetRowColor{LightBackground} Variance X + Y & Var(X) + Var(Y) + 2Cov(X,Y) \tn % Row Count 10 (+ 2) % Row 5 \SetRowColor{white} Variance X - Y & Var(X) + Var(Y) - 2Cov(X,Y) \tn % Row Count 12 (+ 2) % Row 6 \SetRowColor{LightBackground} Theorem & Cov(X,Y) = 0 if X, Y indepedent. Converse not true. \tn % Row Count 14 (+ 2) % Row 7 \SetRowColor{white} Correlation & p = Cov(X,Y) / SQRT(Var(X) * Var(Y)) \tn % Row Count 16 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{x{1.29402 cm} x{3.68298 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{pdf, cdf}} \tn % Row 0 \SetRowColor{LightBackground} pdf -\textgreater{} cdf & integrate with x, 0 as limit \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} cdf F-1(U) & solve(F(x)=U, x) \tn % Row Count 2 (+ 1) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{5.377cm}}{\bf\textcolor{white}{Given CDF with two cases, generate X}} \tn \SetRowColor{LightBackground} \mymulticolumn{1}{p{5.377cm}}{\vspace{1px}\centerline{\includegraphics[width=5.1cm]{/web/www.cheatography.com/public/uploads/jack1982_1761869107_Bildschirmfoto 2025-10-31 um 01.04.33.png}}} \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{5.377cm}}{\bf\textcolor{white}{Complete Distribution Reference Table}} \tn \SetRowColor{LightBackground} \mymulticolumn{1}{p{5.377cm}}{\vspace{1px}\centerline{\includegraphics[width=5.1cm]{/web/www.cheatography.com/public/uploads/jack1982_1761863907_Bildschirmfoto 2025-10-30 um 23.36.38.png}}} \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{p{0.64701 cm} x{4.32999 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{Box Muller Method}} \tn % Row 0 \SetRowColor{LightBackground} Z1 & √(-2·ln(U₁)) · cos(2π·U₂) \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} Z2 & √(-2·ln(U₁)) · sin(2π·U₂) \tn % Row Count 4 (+ 2) % Row 2 \SetRowColor{LightBackground} Z1/Z2 & cot(2π·U₂) \textasciitilde{}Cauchy \tn % Row Count 5 (+ 1) % Row 3 \SetRowColor{white} Z2/Z1 & tan(2π·U₂) \textasciitilde{}Cauchy \tn % Row Count 6 (+ 1) \hhline{>{\arrayrulecolor{DarkBackground}}--} \SetRowColor{LightBackground} \mymulticolumn{2}{x{5.377cm}}{Radian-Modus einschalten!} \tn \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{5.377cm}}{\bf\textcolor{white}{Chi-Square Distribution}} \tn \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{If Z₁, Z₂, Z₃ are i.i.d. Nor(0,1), find c such that P(Z₁$^{\textrm{2}}$ + Z₂$^{\textrm{2}}$ + Z₃$^{\textrm{2}}$ \textless{} c) = 0.99 \newline % Row Count 2 (+ 2) Calculator: chiSqInv(0.99, 3) → 11.34% Row Count 3 (+ 1) } \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{5.377cm}}{\bf\textcolor{white}{Find distribution of U1 and U2}} \tn % Row 0 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{Find distribution of -4(U₁ + U₂) - 2} \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{U₁ + U₂ \textasciitilde{} Tria(0, 1, 2)} \tn % Row Count 2 (+ 1) % Row 2 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{Apply the transformation -4(U₁ + U₂) = 4(Tria(0, 1, 2) )} \tn % Row Count 4 (+ 2) % Row 3 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{The minimum becomes: -4(2) = -8; The mode becomes: -4(1) = -4; The maximum becomes: -4(0) = 0} \tn % Row Count 6 (+ 2) % Row 4 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{4·Tria(0, 1, 2) = Tria(-8, -4, 0)} \tn % Row Count 7 (+ 1) % Row 5 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{Subtract 2} \tn % Row Count 8 (+ 1) % Row 6 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{Tria(-10, -6, -2)} \tn % Row Count 9 (+ 1) \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{p{0.74655 cm} x{4.23045 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{Acceptance-Rejection}} \tn % Row 0 \SetRowColor{LightBackground} Goal & Generate random samples from a hard-to-sample distribution (f(x)). \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} Idea & Sample from an easier distribution (h(x)), then accept or reject each sample based on how well it fits f(x). \tn % Row Count 6 (+ 4) % Row 2 \SetRowColor{LightBackground} \seqsplit{Example} & If a random variable X has the beta distribution, then its p.d.f. is of the form f(x) = Γ(α+β) Γ(α)Γ(β) xα−1(1−x)β−1, 0 \textless{}x\textless{}1, for parameters α and β \textgreater{}0, and where Γ(·) is the gamma function. How might you generate such a random variate? Pick the best answer. \tn % Row Count 15 (+ 9) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{x{1.59264 cm} x{3.38436 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{Goodness of fit}} \tn % Row 0 \SetRowColor{LightBackground} Find critical value & Inverse X2; Area = 1-alpha; df = n-1; invx2(0.9,3) \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} & If critical value is bigger than accept H0 \tn % Row Count 4 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} % That's all folks \end{multicols*} \end{document}