% begin preamble
\documentclass[11pt,titlepage]{article}
\usepackage[margin=1in,noheadfoot]{geometry}
\usepackage[parfill]{parskip}
\usepackage{graphicx}
\usepackage[colorlinks,urlcolor=blue]{hyperref}
\usepackage{amssymb}
\usepackage{amsbsy}
\usepackage{wrapfig}
\usepackage{amsmath}

\newcommand{\e}[1]{\times 10^{#1}}
\newcommand{\q}{\mathrm}
\newcommand{\where}[1][where]{\qquad\mbox{#1}\qquad}
\newcommand{\bs}[1]{\boldsymbol{#1}}
\newcommand{\bh}[1]{\hat{\boldsymbol{#1}}}
\newcommand{\bv}[1]{\vec{\boldsymbol{#1}}}
\newcommand{\bt}[1]{\tilde{\boldsymbol{#1}}}
\newcommand{\ad}{^{\dagger}}
\newcommand{\flow}[1]{\mathcal{E}_{#1}}
\newcommand{\flux}[1]{\Phi_{#1}}
\newcommand{\dslash}{d \hspace{-0.5ex}\rule[1.2ex]{0.6ex}{.1ex}}
\newcommand{\ts}{\textsuperscript}
\def\rcurs{{\mbox{$\resizebox{.16in}{.08in}{\includegraphics{ScriptR}}$}\!\!}}
\def\brcurs{{\mbox{$\resizebox{.16in}{.08in}{\includegraphics{BoldR}}$}\!\!}}
\def\hrcurs{{\mbox{$\hat \brcurs$}\!}}
%end preamble

\begin{document}
\begin{center}
  {\bf University of Kentucky, Physics 335 \\
    Laboratory \#3, Rev. A, due Wednesday, 2023-09-13 }
\end{center}

\vspace{.3 in}

This lab explores the distribution of the random variable $X$ representing the number of fish caught in 100 minutes, assuming a 5\% chance of catching a fish per minute, using Prof. Straley's simulation \url{https://www.pa.uky.edu/~crawford/phy335_fa23/poisson.htm}.  Draw your plots using \href{https://www.python.org}{Python} in \href{https://colab.research.google.com}{Google Colab} or another IDE following the example \href{https://drive.google.com/file/d/1GlYVMQHSg26vtdKrZIyJRJNcAe14dRsz/view?usp=sharing}{X01.ipynb} from Laboratory \#1.

{\bf 1.} Theoretical estimation of the {\bf Parent Distribution}
 
{\bf \quad a)} What is the expected number $\lambda$ of fishes to be caught in 100 min?  Tabulate the Poisson distribution given $\lambda$ for $x=0,1,2,\ldots 10$.

{\bf \quad b)} Draw step plot of the Poisson distribution $P(x)$ out to $x=10$, labeling your axes in the figure, which should span the entire width of your sheet.  Plot the binomial distribution for $n=10$, $np=\lambda$ (X02) on the same graph with the symbol $\times$.  Why are the two distributions slightly different?  [{\it bonus: plot the binomial distribution for $n=100$, which was used in the actual simulation.}]

{\bf \quad c)} Calculate the $\mu=\lambda$ and $\sigma=\sqrt{\lambda}$ from the distribution.  Why are they slightly different?  Plot the mean as a vertical line on the distribution and indicate the $\mu\pm\sigma$ interval in each direction.

{\bf 2.} Experimental measurement of a {\bf Sample Distribution}

{\bf \quad a)} Perform an experiment to estimate $P(x)$ by running the simulation $N=25$ times, recording the numerical value of each result in a list.  Calculate the mean $\bar x$ and standard deviation $s$ of this sample. Make a new plot of each point $x_{i}\pm\delta x_{i}$ with error bars versus $i$ on the abscissa.  Draw a horizontal line at height $\bar x$ running through all points. How many error bars touch the line?

{\bf \quad b)} Add the frequency of occurrences of each value of $x$ to a new line of the table in 1a).  Normalize the distribution to 1 and plot $(h_{x}\pm \sqrt{h_{x}})/N$ with a solid circle and error bars in each bin on the graph of 1b).  Draw a horizontal error bar representing the mean $\bar x \pm \delta \bar x$.

{\bf \quad c)} Calculate {\it chi-squared} $\chi^{2} = \sum_{x}\left(\frac{h_{x}- N P(x)}{\delta h_{x}}\right)^{2} = \sum_{x}\frac{(h_{x}- N P(x))^{2}}{h_{x}}$.  Since terms with $h_{x}=0$ are undefined, and bins with $h_{x}<5$ have poor statistics, group $x$ bins together to obtain super-bins of at least $\sum h_{x}\geq 5$ for each term in $\chi^{2}$.  What is the average normalized deviation in each bin?

{\bf 3.} Calculation of the {\bf Combined Distribution}

{\bf \quad a)} Tabulate your frequency distribution, mean, and standard deviation on the white board along with each other group.  Calculate the combined sample distribution, its mean, and standard deviation $\bar s$ on a new line in the table of 1a).

{\bf \quad b)} Add the combined distribution $(h_{x}\pm \sqrt{h_{x}})/N$ from 3a) to the plot of 1b) using unfilled square makers with error bars.  Plot the mean ${\bar x}_{i}$ from each group with ticks on the horizontal error bar of 2b).  Add a horizontal error bar for the combined mean $\bar{\bar x}\pm\delta\bar{\bar x}$ above the previous one.  Recalculate $\chi^{2}$.  How did it change with higher statistics?

{\bf \quad c)} Qualitatively compare the plots and statistics of each of these distributions.

\end{document}

%%% Local Variables:
%%% mode: latex
%%% TeX-master: t
%%% End:
