# Dice and Normal Distribution

• Apr 2nd 2008, 07:44 AM
Nyoxis
Dice and Normal Distribution
Hey, I was trying to model a system that would calculate the probabilities of moves in a game, but was stumped by one thing so I thought I'd turn it into an exam type question:

If Julie has 4, 8 sided dice; and Hasish has 3, 8 sided dice, what is the probability that when they both roll their dice, the sum of Julie's dice is greater?

If I roll $x$, 8 sided dice; what is the probability that the sum of $y$ 8 sided dice is greater?

^^I'm hoping there isn't a ridiculously simple answer to it, but there may well be as I'm knackered at the moment. (Sleepy)

Also I was wondering, does anyone have any real life applications of the normal (or Gaussian) distribution, and what type of things can be modelled with it?

Thanks! (Rock)
• Apr 4th 2008, 07:39 PM
awkward
Hi Nyoxsis,

The easiest way I know to answer your question about the dice is to use a normal approximation! The answer is that the probability that Julie’s sum is greater is about 0.745.

First let’s consider the result of rolling one 8-sided die. Let’s say the result is U. U has a “discrete uniform distribution” (see Uniform distribution (discrete) - Wikipedia, the free encyclopedia) so its mean is (1+8)/2 = 4.5 and its variance is (8^2 – 1) / 12 = 5.25.

Julie’s roll, say J, is the sum of 4 of the U random variables, so the mean of J is 4 * 4.5 = 18 and its variance is 4 * 5.25 = 21.

Hasish’s roll, say H, is the sum of 3 of the U random variables, so the mean of H is 3 * 4.5 = 13.5 and its variance is 3 * 5.25 = 15.75.

Define Y = J-H. We are interested in Pr(Y > 0). The exact distribution of Y is hard to work with, so let’s try a normal approximation. This seems reasonable because Y is the sum of several independent random variables (the U’s or their negatives). We know the mean of Y is 18 – 13.5 = 4.5 and its variance is 21 + 15.75 = 36.75, so its standard deviation is sqrt(36.75) = 6.06. Define Z = (Y – 4.5) / 6.06; then Z has mean 0 and standard deviation 1, so if we assume Z has a normal distribution (it doesn’t really, but it’s close) then we can look up the cumulative distribution in a table. Here we use a little trick to improve the accuracy of the approximation: we want to know Pr(Y>0), which is the same as Pr(Z > -4.5/6.06). But the distribution of Y is discrete and the distribution of Z is continuous, so let’s consider Pr(Y > 0.5) instead. This trick is so common that it has a name, the “correction for continuity”. Pr(Y > 0.5) = Pr(Z > -4.0/6.06 = -0.660), and looking up the cumulative normal distribution in a table we find this probability is 0.745. That’s the answer to your problem, approximately.

You might ask how accurate is the approximation. I used more advanced methods involving generating functions to find the exact distribution of Y and found that Pr(Y>0) = 1,554,908 / 8^7, which is about 0.7414. This would have been very tedious and time-consuming to find except that I used a computer algebra system to do the hard work. So in this case the normal approximation is pretty good, with a relative error of only about 0.5%.

jw
• Apr 5th 2008, 02:00 AM
Nyoxis
That's ingenious, thanks! (Clapping)

But I don't understand why you added the variance instead of subtracting it, Im sure it makes perfect logical sense, but I'm tired atm.

Yeah, thanks again, brilliant work- I'll get started on something for n and p dice. =)
• Apr 5th 2008, 02:41 AM
mr fantastic
Quote:

Originally Posted by Nyoxis
That's ingenious, thanks! (Clapping)

But I don't understand why you added the variance instead of subtracting it, Im sure it makes perfect logical sense, but I'm tired atm.

Yeah, thanks again, brilliant work- I'll get started on something for n and p dice. =)

Theorem: Var(aX + bY) = a^2 Var(X) + b^2 Var(Y) + 2ab Cov(X, Y).

If X and Y are independent, Cov(X, Y) = 0 and Var(aX + bY) = a^2 Var(X) + b^2 Var(Y).

In particular, if X and Y are independent, a = 1 and b = -1: Var(X - Y) = Var(X) + Var(Y).

By the way, it makes perfect sense that you DON'T subtract variances - otherwise you could have a distribution with zero variance. Would that make sense .....?
• Apr 5th 2008, 04:29 AM
Nyoxis
Many thanks mr.f, it makes a little more sense now, although we haven't looked into covariance yet, if anyone was interested in how you would apply this work then take a look here: Unlock the Mines of Moria.
• Apr 5th 2008, 04:48 AM
mr fantastic
Quote:

Originally Posted by Nyoxis
Many thanks mr.f, it makes a little more sense now, although we haven't looked into covariance yet, if anyone was interested in how you would apply this work then take a look here: Unlock the Mines of Moria.

Aha I might have guessed!

By the way, regarding the distribution of sums of random variables,

http://www.dartmouth.edu/~chance/tea...k/Chapter7.pdf

is of background interest (it even has an example of the sum of two uniform distributions).