Normal Distribution Simulator

Get hands-on experience and develop an intuition for statistics.

We can be over-confident in our statistics: "hey look: the mean is 12.2, it must be true!"

Well, let's start with a theoretical true mean and standard deviation, and use it to create some random data (following a normal distribution) ... then imagine we recorded that data and see how closely our stats lead us back to the truth!

Play with this to get a good "feel" for data. Try different sample sizes and standard deviations, use Generate a lot, and see how the results vary!

images/norm-dist-sim.js
medicine

Example: Testing A New Medicine

You don't know it, but the new medicine actually reduces the risk of heart attack to 0.9 of the usual value, so it is very valuable. But results vary widely (standard deviation of 0.3)

Enter 0.9 and 0.3 and 10 samples (testing is expensive!)

Now click "Generate" and see if your research has shown how valuable this new medicine really is (less than 1 is good)

Try "Generate" many times and imagine each one is a "clinical trial". Notice that some may greatly exaggerate the benefit, others may say the medicine makes things worse.

Try different sample sizes, such as 10, 100, 500.

You can also try a mean of 1.0 (the medicine is useless).

Key Takeaway: Notice how small samples (like 10) jump around wildly and give wide confidence intervals, while large samples (like 500) stay very close to the true mean.

A single small trial can easily fool us!

How to Use

For a population that follows a normal distribution:

This will then give you the sample mean and sample standard deviation, pick a confidence interval (from 80% to 99.9% from the dropdown menu) for that randomly generated sample.

Now see how well that sample's mean and standard deviation compare to your chosen true mean and true standard deviation.

Footnote

The data is created using the "Box-Muller Transformation" and then adjusted for your chosen mean and standard deviation.