% SIMIODETemplate-TeacherORStudent.tex and simiode.cls for LaTeX2e
% Version 29 July 2015.
%
% This class (simiode.cls) is a modification of that used by
% the journal PRIMUS - Problems, Resources, and Issues in
% Mathematics Undergraduate Studies.
%
% See http://www.tandfonline.com/loi/upri .
%
% The class was developed by  Marc Frantz with suggestions of the
% PRIMUS Editorial Board, especially John Thoo.
%
% This template is to be used with the  class file "simiode.cls".
%
% The latest version of this class and template files
% can be found at
%
%       <http://www.SIMIODE.org> in the Author section.
%
% A "Quick Start Guide" appears below.
%
% This file must be processed with version LaTeX2e or higher.
%
\documentclass{simiode}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% With this version of the tex file and the associated SIMIODE.cls file you can produce BOTH a Student Version and a Teacher Version of your modeling scenario or technique narrative.
%
% Basically the Student Version contains the title STUDENT VERSION along with the NAME OF SCENARIO, with no abstract, no keywords, no tags, no author identifiers, and no COMMENTS section. The Student Version contains only the STATEMENT of the modeling scenario with appropriate figures, data, instructions, and perhaps a bibliography appropriate for student resourcing, but nothing in the bibliography which would "give away" the nature of the modeling scenario, etc.
%
%The Teacher Version contains the material in the Student Version, namely the title NAME OF SCENARIO, now headed with   TEACHER VERSION, but also full author  identification, abstract, key words, tag words, and, following the STATEMENT, a section of COMMENTS which can be discussion of presentation  ideas, "solutions," techniques, etc.
%
% Authors can prepare a full Teacher Version using the notions immediately below  to create a pdf for review (but in review please eliminate all information about the author as we use a double-blind referee system. Such information will be restored when accepted and published in SIMIODE at www.simiode.org.
%
%***********   Toggle the following line to turn the teacher version on (1) or off (0). ***********
%
%
\def\TeacherEdition{0} % Toggle this line's value.
\newcommand{\teacher}[1]{\ifnum\TeacherEdition=1 #1 \fi}
%
%
% The \teacher{ } command wraps any text that will appear only in the teacher version of
% the document. See this file for examples. This has been done for you in the document below.
% Rename the pdf after you compile each final version.
% This option was created  by Eric Sullivan, Carroll College, Helena MT.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\usepackage{amsmath,amssymb}
\usepackage{color}
\usepackage{graphicx}
\usepackage{hyperref}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% NOTE regarding double spacing %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Manuscripts should be submitted doubled spaced.  This is
% accomplished via the \baselinestretch command below.
% However, you may obtain an idea of how your article will
% look in final form, so that you can better plan your
% presentation.  To see your manuscript formatted very
% similarly to the on-line published format of  SIMIODE,
% comment the following line out by inserting a percent sign % (%) at its beginning.

\renewcommand{\baselinestretch}{1.3}

%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% NOTE regarding macros %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Any macros defined for your paper should be contained in
% the top matter. Likewise, any environment definitions such
% as \newtheorem or \newenvironment should also go in the
% top matter.
%
% Do not \input your macros as separate files within your
% final version because more files make it harder for the
% editors and users to keep track of and/or modify and
% append your paper.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Top matter is above and
% the beginning of the document below.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{document}

\newpage

\title{\ifnum\TeacherEdition=1 TEACHER VERSION  \else STUDENT VERSION \fi\\TOSSING}



\markboth{Tossing}{Tossing}






\author{Brian Winkel,
Director SIMIODE\\
Chardon OH 44024  USA\\
BrianWinkel@simiode.org}

\makeStitlePDFLaTex


\begin{abstract}
We offer students simulation experience or data from a simulation and ask them to model the simulation using several approaches, to include exponential decay fit, difference equation, and differential equation.
\end{abstract}


\section*{SCENARIO DESCRIPTION}

The mathematics lesson uses forty 10-sided dice. Working in groups, students first roll the dice. They remove all dice that land showing a 1 on top and record the number. They then repeat the process, continuing to record the number of dice remaining after each roll until no dice remain.

Sets of 10-sided dice may be purchased in gaming and education offerings either in stores or on-line.  However, if there is no convenient way to conduct this simulation then we offer in Table \ref{table:data}  a result from such an experimental run.  We also offer a plot of this data in Figure~\ref{fig:1-2-dataPlot}.


\begin{itemize}
\item [a)] Build a reasoned model for $R(n)$, the number of dice remaining after $n$ tosses, where $R(0) = 40$. State your assumptions clearly and show how they are used in the model building process. Finally, compare your model predictions with the data.
\item [b)] Build a reasoned model with a difference equation for $R(n)$, the number of dice remaining after $n$ tosses, where $R(0) = 40$. State your assumptions clearly and show how they are used in the model building process. Solve the model to produce a predicting function, $R(n)$. Finally, compare your model predictions with the data.
\item [c)] Build a reasoned model for a differential equation for $R(t)$, the number of dice remaining after $t$ tosses, where  we make a toss every minute - so $t$ is time in minutes or generation of toss and $R(0) = 40$. State your assumptions clearly and show how they are used in the model building process. Solve the model to produce a predicting function, $R(t)$. Finally, compare your model predictions with the data.
 \end{itemize}


\begin{table}[h]\label{table:data}
\small
\begin{center}
\begin{tabular}{|c|c||c|c||c|c||} \hline
\multicolumn{1}{|c|}{Iteration} & \multicolumn{1}{|c||}{Dice Alive} & \multicolumn{1}{|c|}{Iteration} & \multicolumn{1}{|c||}{Dice Alive} & \multicolumn{1}{|c|}{Iteration} & \multicolumn{1}{|c||}{Dice Alive}\\ \hline
0& 40 & 15& 8& 30& 3\\ \hline
1& 35& 16& 8& 31& 2\\ \hline
2& 30& 17& 6& 32& 2\\ \hline
3& 28 &18& 5& 33& 2\\ \hline
4& 26& 19& 5& 34& 2\\ \hline
5& 24 & 20& 5& 35& 2\\ \hline
6& 19& 21& 5& 36& 1\\ \hline
7& 18& 22& 4& 37& 1\\ \hline
8& 17& 23& 4& 38& 1\\ \hline
9& 14& 24& 4& 39& 1\\ \hline
10& 12& 25& 4& 40& 0\\ \hline
11& 10& 26& 4&&\\ \hline
12& 10 & 27& 3&&\\ \hline
13& 9 & 28& 3&&\\ \hline
14& 8& 29& 3&&\\ \hline
\end{tabular}

\parbox{10.5 true cm}{\caption{\label{table:data} Results of simulation in which forty 10-sided dice are tossed and at each iteration when a 1 lands on top the die is removed at that iteration. The simulation is conducted until there are no more dice remaining.}}
\end{center}
\vspace*{-.8 true cm}
\end{table}


\begin{figure}[h!]
\centering

\includegraphics[width=10.5cm]{1-2-dataPlot.eps}



\parbox{8.5 true cm}{\caption{\label{fig:1-2-dataPlot}  Plot of the data from Table~\ref{table:data} in which $n$ is the iteration and $R(n)$ is the number of remaining die.}}
\end{figure}


\teacher{
\section*{NOTES FOR TEACHERS}

We found this material in a lovely article \cite{MallRisinger2013} offered to high school teachers as an example of modeling with exponential decay. We thought it might be a good idea to push students to model this simulation in a more ``active'' manner with difference and differential equations representing the change in each iteration. Upon completion of the three parts (a) - (c) students can then reflect on, as well as compare and contrast, the different approaches to building a mathematical model or explanation for the phenomenon.  We offer some possible approaches for each part (a) - (c).

\subsection*{(a) General Model}

We make two assumptions:
\begin{enumerate}
  \item Each die is fair and each face is equally likely to turn up on top.
  \item None of the dice interfere with each other's random motion, i.e.  they each act independently.
\end{enumerate}

We note that for each toss of each die there is a 90 percent chance of NOT getting a one, because each die acts independently and each is a fair die. Hence for each of the 40 dice there is a 90 percent chance of it staying in the population.  Thus after one toss the number of dice left is approximately $40(0.9)$ and if $R(n)$ is the number of dice remaining after the $n^{\rm th}$  toss, where $R(0)$ is the initial number of dice, then $R(1) = R(0)(0.9)$. Now for each die in the second toss of the remaining dice we have a 90 percent chance of NOT getting a one. Thus $R(2) = R(0)(0.9)(0.9) = R(0)(0.9)^2$. Similarly, $R(3) = R(0)(0.9)(0.9)(0.9) = R(0)(0.9)^3$. Thus after the $n^{\rm th}$  toss we see the function, $R(n) = R(0)(0.9)^n$, is a reasonable  model.

Figure~\ref{fig:1-2-aPlot} shows a plot of our data with our model superimposed. The fit appears to be a good one.

\begin{figure}[h!]
\centering

\includegraphics[width=10.5cm]{1-2-aPlot.eps}



\parbox{11 true cm}{\caption{\label{fig:1-2-aPlot}  Plot of the data (small blue dots) from Table~\ref{table:data} in which $n$ is the iteration and $R(n)$ is the number of remaining die with our exponential decay model (large pink dots) from (a) modeling effort superimposed on the data.}}
\end{figure}


\subsection*{(b) Difference Equation Model}


We make two assumptions:
\begin{enumerate}
  \item Each die is fair and each face is equally likely to turn up on top.
  \item None of the dice interfere with each other's random motion, i.e. they each act independently.
\end{enumerate}


We note our data begins at 40 dice at time $t = 0$, and appears to drop off at about 10 percent per iteration. Thus we consider the following difference equation $R(n+1) = 0.9 R(n)$, $R(0) = 40$. We use this model because each die has a 90 percent chance of surviving and so roughly - in our case exactly - 90 percent of the surviving die at one generation will survive to the next generation.


We solve our difference equation using Mathematica's {\tt RSolve} command, but we could ``see'' the solution form quite easily as repeated multiplications by 0.9 lead to $R(n) = 40 (0.9)^n$. 

However, we offer a general model with parameter $k$ instead of 0.9, i.e. $R(n+1) = k R(n)$, $R(0) = 40$. We seek to determine the rate $k$ which fits the model data best. We can see, again, by iteration or Mathematica's {\tt RSolve} command that the solution to our model is $R(n) = 40 k^n$. 

We set up the sum of square errors as a function of the parameter $k$ ($SSE(k)$) between our data and our model at the relevant iterations, where $\hat{R}_i$ is the observed number of die remaining at iteration $i$.

\begin{equation}\label{eq:SSEdifference}
SSE(k) = \sum_{i=0}^{40}  \left(\hat{R}_i - 40 k^i\right)^2\, , \quad {\rm i.e.}
\end{equation} 

\small
\begin{eqnarray}\label{eq:SSEdifferenceExpand} \nonumber
SSE(k) &=& 
     \left(0-40
   k^{40}\right)^2+\left(1-40
   k^{39}\right)^2+\left(1-40
   k^{38}\right)^2+\left(1-40
   k^{37}\right)^2+\left(1-40
   k^{36}\right)^2\\ \nonumber
&&+\left(2-40
   k^{35}\right)^2+\left(2-40
   k^{34}\right)^2 +\left(2-40
   k^{33}\right)^2+\left(2-40
   k^{32}\right)^2+\left(2-40
   k^{31}\right)^2\\ \nonumber
&&+\left(3-40
   k^{30}\right)^2+\left(3-40
   k^{29}\right)^2+\left(3-40
   k^{28}\right)^2+\left(3-40
   k^{27}\right)^2+\left(4-40
   k^{26}\right)^2\\ \nonumber
&&+\left(4-40
   k^{25}\right)^2+\left(4-40
   k^{24}\right)^2+\left(4-40
   k^{23}\right)^2+\left(4-40
   k^{22}\right)^2+\left(5-40
   k^{21}\right)^2\\
&&+\left(5-40
   k^{20}\right)^2+\left(5-40
   k^{19}\right)^2\left(5-40
   k^{18}\right)^2+\left(6-40
   k^{17}\right)^2+\left(8-40
   k^{16}\right)^2\\ \nonumber
&&+\left(8-40
   k^{15}\right)^2+\left(8-40
   k^{14}\right)^2+\left(9-40
   k^{13}\right)^2+\left(10-40
   k^{12}\right)^2+\left(10-40
   k^{11}\right)^2\\ \nonumber
&&+\left(12-40
   k^{10}\right)^2+\left(14-40
   k^9\right)^2+\left(17-40
   k^8\right)^2+\left(18-40
   k^7\right)^2+\left(19-40
   k^6\right)^2\\ \nonumber
&&+\left(24-40
   k^5\right)^2+\left(26-40
   k^4\right)^2+\left(28-40
   k^3\right)^2+\left(30-40
   k^2\right)^2+(35-40 k)^2 \, .\nonumber
\end{eqnarray}


We use Mathematica's {\tt FindMinimum} command to determine the value of $k$ which minimizes $SSE(k)$ in (\ref{eq:SSEdifferenceExpand}). This gives us a value of $k = 0.895625$, quite close to our preconceived theoretical value of 0.9. 

Figure~\ref{fig:1-2-bPlot} shows a plot of our data with our difference equation solution model superimposed. The fit appears to be a good one.

\begin{figure}[h!]
\centering

\includegraphics[width=10.5cm]{1-2-bPlot.eps}



\parbox{10.5 true cm}{\caption{\label{fig:1-2-bPlot}  Plot of the data (small blue dots) from Table~\ref{table:data} in which $n$ is the iteration and $R(n)$ is the number of remaining die with our difference equation solution model, $R(n) = 40 (0.895625)^n$, (large pink dots) from (b) modeling effort superimposed on the data.}}
\end{figure}

\subsection*{(c) Differential   Equation Model}


We make three assumptions:
\begin{enumerate}
  \item Each die is fair and each face is equally likely to turn up on top.
  \item None of the dice interfere with each other's random motion, i.e.  they each act independently.
  \item We approximate the change in one generation or one unit of time with the instantaneous rate of change at that instant in time.
\end{enumerate}



We note our data begins at 40 dice at time $t = 0$, and appears to drop off exponentially. Thus, perhaps an exponential model of the form $P(t) = 40 e^{-k t}$ would appear to be a good model. Moreover, the fact that at each generation we appear to lose approximately 10 percent of the population suggests  the differential equation $P'(t) = - k P(t)$, $P(0) = 40$ with $k$ being approximately 0.10 for a 10\% loss each generation.

Thus, we examine the exponential decay model, $P(t) = 40 e^{-k t}$, obtained from solving the previous differential equation model formulation. Here we determine the best parameter, $k$,  for this data set using Mathematica's {\tt FindFit} command to fit $P(t) = 40 e^{-k t}$ to the data using the method of minimizing the least square error between the data and the model as a function of the parameter $k$, for $t = 0,1, \ldots , 40$ in our case. We find $k = 0.0921946$ which means we have a decay rate of 9.2194\% or approximately 10\% per unit time.  We show our model in comparison to our data in Figure~\ref{fig:1-2-cPlot}. Again, this is a reasonable predictor.


\begin{figure}[t]
\centering

\includegraphics[width=10.5cm]{1-2-cPlot.eps}



\parbox{12.2 true cm}{\caption{\label{fig:1-2-cPlot}  Plot of the data (small blue dots) from Table~\ref{table:data} in which $t$ is the iteration and $P(t)$ is the number of remaining die with our differential equation $P(t) = 40 e^{-0.0921946\, t}$ model (solid line) from (c) modeling effort superimposed on the data.}}
\end{figure}

\subsection*{Summary Comparison of Models from (a), (b), and (c)}

In Table~\ref{table:compare} we compare the Sum of Square Errors for all three methods.  

\begin{table}[h]\label{table:compare}
\begin{center}
\begin{tabular}{|c|c|} \hline
Method & SSE \\ \hline
(a) & 46.0181\\ \hline
(b) & 38.9294\\ \hline
(c) & 38.9294\\ \hline
\end{tabular}

\parbox{7.5 true cm}{\caption{\label{table:compare} Comparisons of the Sum of Square Errors (SSE) for each of our models in (a), (b), and (c).}}

\end{center}
\end{table}


It appears that our purely exponential guess does not offer as small a SSE as our difference and differential equation model. Incidentally, since in our difference equation model $Rs(n) = 40*(0.895625)^n$ and our differential equation model $P(t) = 10 e^{-0.110233 t}$, where $t = n$ is the iteration, we see that  $e^{-0.110233}  = 0.895813$ is very close to $0.895625$. So, it is not surprising that the SSEb and SSEc are the ``same.''

\subsection*{Final Thoughts}

This activity provides data for modeling. The data is from a physical activity or can be simulated iteratively using random number generators wherein integers between 1 and 10 are selected at random and when a 1 is generated this corresponds to the die having a 1 on the top face, say in Excel or Mathematica. We do this $R(n)$ times at generation $n$ where there are $R(n)$ die left in the population, $40-n$ having died off because a 1 turned up on their top face in one of the previous iterations.

The freedom to select a model of their choice in (a) will most likely result in an exponential decay as \cite{MallRisinger2013} intended for their students. The difference and differential equation models study confirms these approaches as a valid modeling method, especially when comparing the resulting models which give about the same results.

Of course, other software, e.g., MatLab, Maple,  SAGE, spreadsheet,   indeed, other technology, e.g., TI83/84 using the RandInt(a,b) command, may be used to generate data. Even online sites such as \href{www.random.org}{www.random.org} can be used. 



\begin{thebibliography}{1}

\bibitem{MallRisinger2013} Mall, Alison L. and Mike Risinger. 2013.  Modeling Exponential Decay. {\it Mathematics Teacher\/}. 107(5): 400.
 \end{thebibliography}
}
\end{document} 

