Some basic stuff for Class 2

Random numbers and PDFs

Tom Solomon, February 2021

Get a random integer and a random floating point number

Now let's look at distributions. First, uniform, then Gaussian, then Poisson

Now for the Gaussian (normal distribution). $p(x) = \frac{1}{\sigma \sqrt{2\pi}}exp\left[-\frac{(x-\bar{x})^2}{2\sigma^2}\right]$

Now for Poisson: $p(N) = \frac{exp(-a)a^N}{N!}$ where $a$ is the mean value of $N$.

Let's try plotting the previous two graphs together