Bonus Normal Distribution Post!

From the Wikipedia article on Cauchy distributions:

When U and V are two independent normally distributed random variables with expected value 0 and variance 1, then the ratio U / V has the standard Cauchy distribution.

Since I’m limbered up by making linear combinations of Cauchy distributions, I feel like this one is easy.

Edit 2025-07-20: Dr Drang mentioned this post! He did an analytical solution and found my curve fit wanting! That’s cool, I violated the assumptions, so it should be wrong!

Source code.

I did something like:

  1. Write and run program that generates pairs of normally distributed random numbers, and the ratios of those pairs.
  2. Use the R statistical computing and graphics language to visualize the normal distributions via histograms, and to get midpoints and heights of the ratio’s histogram.
  3. Use gnuplot to get a curve fit for the ratio histogram. I started with the form of a Cauchy distribution, fitting the scale and location parameters.
  4. Use R to create an illustrative diagram with 3 histograms and the curve fit on it.

two normal distributions and their ratio

Above, histograms illustrating two normal distributions, and their ratio as a histogram.

  • green: μ = 0.0, σ = 1.0
  • orange: μ = 1.0, σ = 3.0
  • blue: histogram of the ratios of pairs of distributions that yielded the green and orange histograms, as they were generated.
  • red curve: y = 1/[0.95868(1. + ((x + 0.000786)/ 0.305159)2)]

One of my starting distributions doesn’t meet the criteria of Wikipedia’s assertion. It has a non-zero expected value and a variance of 2.0. I suspect the two normal distributions used the same PRNG seed value, as well.

The curve fit makes the ratio of the elements of the two distributions look exactly like a Cauchy distribution. I judge the ratio assertion to be empirically true.

Secret Extra Bonus: normal distribution from uniform distributions

I find that a lot of discussions of normal distributions have some off the cuff assertion something like: if you sum enough uniform distributions, you get a normal distribution. This seems easy enough to try out.

histogram of sum of uniform distributions

Above, a density histogram of 5 uniform distribution summed together, plus the normal distribution PDF for μ = 2.5, σ = 0.644 in red. There are 100,000 values of the summed uniform distributions. I used the github.com/leesper/go_rng package so that each uniform distribution has its own seed bytes. Even by eye, the theoretical PDF is a good, but not great, fit.

The 2.5 value for the mean of the normal distribution PDF makes sense intuitively. There are 5 independent sequences of random numbers with values uniformly distributed between 0 and 1.0. You’d expect to get most sums of about 2.5

Further, the sum of uniform distributions has Kurtosis 2.758, and 67.28% of the sums fit within one std dev of mean. I judge the sum of uniform distributions to be empirically true.