% 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}

\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 \\
    Homework \#1, Rev. B, due Tuesday, 2021-09-27 }
\end{center}

\vspace{.3 in}

{\bf 1-d. Average of Uniform Deviates}---By the \href{https://en.wikipedia.org/wiki/Central_limit_theorem}{\it Central Limit Theorem} (CLT), the average $\bar x$ of $n$ samples from a random variable $X$ with almost any distribution tends to the Gaussian distribution as $n\to\infty$.

{\bf \quad a)} Calculate the mean $\mu$ and standard deviation $\sigma$ of the {\it uniform} random variable $X$ with probability distribution $p_{u}(x)= 1$ if $0<x<1$ and 0 otherwise.

{\bf \quad b)} Histogram the distribution of 100,000 averages of $n=1$, 2, 3, 5, 10, and 100 uniform deviates each.  Calculate the mean $\langle \bar x \rangle$ and standard deviation $s_{\bar x}$ of each sample distribution, and compare with $\mu_{\bar x}=\mu$, $\sigma_{\bar x}=\sigma/\sqrt{n}$ from the parent distribution.  Plot the Gaussian distribution function $p_{G}(\bar x; \mu_{\bar x},\sigma_{\bar x})$ together with each histogram.

{\bf \quad c)} Calculate $p_{\chi}(u;1)$ for the $\chi^{2}$ distribution with $\nu=1$ degree of freedom by using the {\it invariant} $p_{\chi}(u;1)du = 2 p_{G}(z)dz$, where $u=\chi^{2}=z^{2}$.  The factor of two comes from combining the left and right tails.

{\bf \quad d)} For $n=100$, histogram $u=z^{2}$, where $z=(\bar x-\mu)/(\sigma/\sqrt{n})$, and plot together with the $\chi^{2}$ distribution $p_{\chi}(u;1)$ with $\nu=1$ degree of freedom.

{\bf 2-d. Gaussian Generator}---The $\chi^{2}$ distribution with $\nu=2$ degrees of freedom can be used to create a more efficient and accurate Gaussian generator.

{\bf \quad a)} Integrate joint Gaussian distribution $p(\vec\chi)=p_{G}(z_{1}) p_{G}(z_{2})$ of the vector $\vec\chi=(z_{1},z_{2})=(\chi\cos\phi,\chi\sin\phi)$ over $\phi$ in cylindrical coordinates $(\chi,\phi)$ to obtain the $\chi^{2}$ distribution $p_{\chi}(u;2)$ where $u=\chi^{2}=\vec\chi\cdot\vec\chi=z_{1}{}^{2}+z_{2}{}^{2}$.

{\bf \quad b)} Histogram the distribution of $u=z_{1}{}^{2}+z_{2}{}^{2}$ into 1000 bins over $0\leq u\leq 10$, using 100,000 pairs ($z_{1},z_{2}$) from 1b) with $n=100$ again, and plot together with $p_{\chi}(u;2)$ from 2a).

{\bf \quad c)} Working backwards, use the fact that $p_{u}(x)dx=p_{e}(u)du$ to determine the function $u(x)$ which transforms the uniform deviate $x$ into $u$ following the exponential distribution $p_{e}(u)=\frac12\exp(-u/2)$ defined on $0\leq u <\infty$.

{\bf \quad d)} Generate a 100,000 pairs of Gaussian deviates $\vec\chi=(z_{1},z_{2})$ by generating $\chi=\sqrt{u}$ from the exponential deviate $u$ of 2c) and a uniform deviate $\phi$ in the range $0\leq \phi < 2\pi$, and finally transforming $(\chi,\phi)$ back to rectangular coordinates $(z_{1},z_{2})$.  Histogram both $z$'s in 1000 bins over $-5\leq z < 5$ and plot each together with the normalized Gausssian distribution.

\newpage

{\bf 3-d.} [bonus: The {\bf \href{}{Maxwell distribution}} of the energy of atoms in an ideal gas is just the $\chi^{2}$ distribution for $\nu=3$ degrees of freedom because each component of $\vec v=(v_{x},v_{y},v_{z})$ is normally distributed accoring to its Boltzmann factor $p_{B}(v_{x})=e^{-E/kT}$, where $E=v_{x}^{2}/2m$, etc.

{\bf \quad a)} Integrate the 3-d velocity distribution over spherical shells of thickness $dv$ to derive the Maxwell distribution of velocities $p_{M}(v)$.  Use the Gaussian generator of 2d) to generate 100,000 velocities in units of $\sqrt{mkT}$ and histogram them together with a plot of $p_{M}(v)$.  Calculate the mode $v_{max}$, median $v_{1/2}$ mean $\bar v$, and RMS $v_{rms}=\sqrt{\langle v^{2}\rangle}$.

{\bf \quad b)} Integrate the joint normal distribution $p(\vec\chi)=p_{G}(z_{1})p_{G}(z_{2})p_{G}(z_{2})$ over spherical shells of radius $du$ for $u=\vec\chi\cdot\vec\chi$ in the vector space $\vec\chi=(z_{1},z_{2},z_{3})$ to obtain $p_{\chi}(u;3)$.  Show that the Maxwell energy distribution equals $p_{\chi}(v^{2}/mkT;3)$. ]

\ldots

{\bf $n$-d.} [bonus: Higher dimensional $\chi^{2}$ distributions are used to test the consistency of distributions, as in labs X03 and X04, or fit functions.  In this case $\nu$ equals the number of Gaussian distributions (for example, the bins you are comparing) minus the number of constraints (for example, the parameters of a distribution or fit function).

{\bf \quad a)} Using the volume of a \href{https://en.wikipedia.org/wiki/Volume_of_an_n-ball}{$\nu$-dimensional ball} $V_{\nu}(\chi)=\pi^{n/2}\chi^{n}/\Gamma(n/2+1)$, integrate the $\nu$-d joint Gaussian distribution over hypershells to derive the $\chi^{2}$ distribution $p_{\chi}(u;\nu)$.  Plot the distribution for $\nu=1,2,3,\ldots,10$.

{\bf \quad b)} Show that as $\nu\to\infty$, $p_{\chi}(u;\nu)$ tends to the Gaussian distribution $p_{G}(u;\nu;2\nu)$. ]




\end{document}

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