4.1.2 Purpose and design of project

The purpose of this project is to estimate the expected value of a random variable (called \(Y\)) which is generated by an experiment that is described in the above problem statement. Each experiment generates one random variable \(y\). The experiment is described well in the above problem statement and no need to repeat it here again.

In addition, we are asked to determine the interval over which we are 95% confident the estimated expected value will lie within. We are asked that the interval should not be wider than 1% of the true mean from either side of the estimated expected value.

The simulation involve a two stage process. In the first stage, an initial simulation was made for \(20,000\) experiments in which we obtained an estimate of the population standard deviation \(s\) and estimate of the population mean given by the sample mean \(\bar {X}\). These 2 values are used to determined the sample size (number of experiments) needed for the second simulation performed to meet the above stated requirement for relative accuracy in expected value of \(Y\). Therefore, once the first simulation is completed, the sample size for the second simulation was found by solving for \(n\) (sample size) by setting the expression for the standard error to be \(1\%\) of the population mean (in which we are using an estimate of which is \(\bar {X}\) as generated by the first simulation). Therefore, we solve for \(n\) from

\[ 1.96\frac {s}{\sqrt {n}}=0.01\bar {X}\]

Finally, the second simulation was now run using the above computed \(n\), and the confidence interval was found from

\[ C.I.=\left \{ \bar {X}-1.96\frac {s}{\sqrt {n}}\ \cdots \ \bar {X}+1.96\frac {s}{\sqrt {n}}\right \} \]

Where in the above equation the \(s\) and \(\bar {X}\) are the sample standard deviation and the sample mean resulting from this second simulation (and not the first simulation run used to estimate \(n\)).

Next, the histogram \(Y\) was plotted to obtain an estimated of the probability density function of \(Y\).