Quote:
Originally Posted by Jimjam
[You must be logged in to view images. Log in or Register.]
The next bit I'm not sure of, but the presence of a mean and standard deviation along with other values suggests a normal distribution is created, the mean for which is set based on the offence mitigation comparisons.
This explains why we have spikes counts of the lower and highest hit values. As a normal distribution has been generated, theoretically there are no limits to the highest and lowest values of d generated, so the values which are out of bounds are getting lumped into the dice as rolls of 1 or 20 (i.e. min or max damage).
Can stats/code fans verify I'm understanding this snippet of code correctly? Are there any details where you can provide deeper understanding either?
|
First off, the presence of a mean and standard deviation doesn't necessarily mean there's a normal distribution. A distribution is just a curve on a chart that shows the frequency with which the various values can occur if you draw a random value from the distribution.
A normal distribution looks the standard bell curve: values near the mean are more common than values near the tails. But there's other curves. For example, a flat line straight across the chart means every value is equally likely. This would correspond to rolling a single d10, for example: all integers from 1 to 10 are equally likely.
The standard deviation (or variance) is a number that describes how "compressed" the curve looks. It's a measure of how close to the mean you can expect a random value to be. A rule of thumb is that about two thirds of the time, you should get a value that's within one standard deviation of the mean. So if you have a mean of 50 and a standard deviation of 5, you should get a value between 45 and 55 two thirds of the time. But a mean of 50 and a standard deviation of 20 would mean you'd get a value between 30 and 70 two thirds of the time - you'd see a lot more variation.
[You must be logged in to view images. Log in or Register.]
Here's a chart that shows means and variance for a bunch of common distributions. We've already discussed normal and uniform distributions. The distribution for flipping a single coin is a Bernoulli. Flipping n coins all together is a Binomial. Nuclear radiation is described by a Poisson; note that it's characterized by lambda, the "half life". If you had a kilogram of Plutonium-238, after 87.7 you'd have only 500 grams, with the rest having undergone radioactive decay into something else.
What's special about normal distributions is the central limit theorem. What it says is that if you draw a large number of samples from any distribution, the distribution that describes the average of all your samples will be normally distributed. That's a really hard thing to understand and explain - I don't feel like I fully understand it.
The simplest way to put it is that although normal distributions describe lots and lots of things, there's other distributions as well, and a mean and standard deviation isn't just about normal distributions.
However, your intuition that "the values which are out of bounds are getting lumped into the dice as rolls of 1 or 20 (i.e. min or max damage)" as an explanation for why we see spikes at the min or max values seems reasonable. That's what I've been assuming, too. It doesn't explain the spike in frequency at the ~average, though.