added
authorChristian Urban <christian dot urban at kcl dot ac dot uk>
Tue, 03 Dec 2013 14:48:21 +0000
changeset 150 15f82d14093d
parent 149 66623e169581
child 151 f8dc3dbdaa5c
added
slides/slides09.pdf
slides/slides09.tex
Binary file slides/slides09.pdf has changed
--- a/slides/slides09.tex	Tue Dec 03 14:22:04 2013 +0000
+++ b/slides/slides09.tex	Tue Dec 03 14:48:21 2013 +0000
@@ -489,6 +489,36 @@
 \begin{frame}[c]
 \frametitle{Random Number Generators}
 
+\begin{itemize}
+\item Computers are deterministic. How do they generate random numbers?\bigskip\pause
+
+\item The most popular method to generate random numbers between \bl{$0$} and \bl{$m$} is: choose
+three integers
+
+\begin{center}
+\begin{tabular}{ll}
+\bl{$a$} & multiplier\\
+\bl{$c$} & increment\\
+\bl{$X_0$} & start value
+\end{tabular}
+\end{center}
+
+and calculate
+
+\begin{center}
+\bl{$X_{n+1} = (a * X_n + c) \;mod\; m$}
+\end{center}
+\end{itemize}
+
+\only<3->{
+\begin{textblock}{7}(11,9)
+\begin{tabular}{ll|l}
+\bl{$m =$}    & \bl{$16$} & \bl{$16$}\\
+\bl{$X_0 =$} &  \bl{$1$} & \bl{$1$}\\
+\bl{$a = $}    & \bl{$5$} & \bl{$5$}\\
+\bl{$c =$}     & \bl{$1$} & \bl{$0$}\\
+\end{tabular} 
+\end{textblock}}
 
 \end{frame}}
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%