[Math] Generate a set of random numbers with a normal distribution

normal distributionrandomstandard deviation

I am trying to generate a set of N random numbers where the set has a normal distribution.

I'm currently using a brute force approach:

  1. Randomly select N numbers from a normal distribution.
  2. Check the set's standard deviation (more important than mean).
  3. If it is the best set so far, keep it.
  4. Repeat 10000 times, and use the best set.

Is there any better approach? Anyone know where I could look?

Thanks in advance!

Best Answer

Assume we are talking about a standard normal distribution with zero mean and unit variance. For the observer to be able to answer the question "is this sample from a standard normal distribution?" with a high probability of correctness, he needs to know the distribution of distributions from which the sample may have been generated. The probability that the observer will guess "yes" is maximized when the sample is generated from a standard normal distribution, assuming that is possible. So according to my interpretation, you should use the values generated by Box-Muller in step 1 without inspecting them.

Related Question