% 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 \#4, Rev. B, due Monday, 2024-09-30 }
\end{center}

\vspace{.3 in}

This lab explores another example of the Poisson distribution, analyzed numerically in Python.

{\bf 1.} Random distribution of {\bf primes}.
 
{\bf \quad a)} Write a Python function \verb|is_prime(n)| to determine if the number $n$ is a prime.  Use this function inside another function \verb|count_primes(k,d)| to count the number of primes with the interval $kd\leq n <(k+1)d$.

{\bf \quad b)} Histogram the number of primes in $N=1000$ sucessive intervals of $d=100$ integers starting at $kd=1,000,000$, ie. $10,000\leq k < 10,000+N$ and plot the distribution with error bars for each bin.

{\bf \quad c)} Calculate the mean $\bar x$ and standared deviation $s$ of this sample.  What is the probability that a number in the vicinity of $kd$ is a prime?

{\bf \quad d)} Estimate $\lambda$ of the corresponding Poisson distribution, and plot this distribution as a stair plot.

{\bf \quad e)} Estimate $\mu$ and $\sigma$ of the corresonding Gaussian distribution and graph it as a continuous curve.  From these two values, is the distribution approximately Poisson?

{\bf \quad f)} Calculate $\chi^{2}$ assuming a Poisson distribution.  [{\it bonus}: What is the likelihood of these data following the Poisson distribution?]

% {\bf 2.} [bonus: Dark photons on astronomical {\bf image plates}.

% {\bf \quad a)} Record a dark image plate on the telescope camera at the MacAdam Observatory.  Open the file as an array of photons per pixel, and plot the image using Python.

% {\bf \quad b)} Group pixels together such that the average number of dark photons in each group is 10, and histogram the number of dark photons counted in each group.

% {\bf \quad c--f)} Repeat steps 1c)--1f) for this distribution. ]

\end{document}

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