# What is the distribution for various polyhedral dice all rolled at once?

Take the 5 Platonic solids from a set of Dungeons&Dragons dice. These consist of a 4-sided, 6-sided (conventional), 8-sided, 12-sided, and 20-sided dice. All start at the number 1 and count upwards by 1 to their total.

Roll them all at once, take their sum (minimum sum is 5, max is 50). Do so multiple times. What is the distribution?

Obviously they will tend towards the low end, since there are more lower numbers than higher. But will there be notable inflection points at each boundary of the individual die?

[Edit: Apparently, what seemed obvious isn't. According to one of the commentators, the average is (5+50)/2=27.5. I wasn't expecting this. I'd still like to see a graph.][Edit2: It makes more sense to see that the distribution of n dice is the same as each dice separately, added together.]

• Do you mean what is the distribution of the sum of discrete uniforms $[1,4]+[1,6]+[1,8]+[1,12]+[1,20]$? – gung - Reinstate Monica Oct 15 '15 at 23:27
• One way to examine it is simulation. In R: hist(rowSums(sapply(c(4, 6, 8, 12, 20), sample, 1e6, replace = TRUE))). It doesn't actually tend towards the low end; of the possible values from 5 to 50, the average is 27.5, and the distribution is (visually) not far from normal. – David Robinson Oct 15 '15 at 23:37
• My D&D set has a d10 as well as the 5 you mention (plus a decader, which I presume you don't include) – Glen_b -Reinstate Monica Oct 15 '15 at 23:50
• Wolfram Alpha computes the answer exactly. Here is the probability generating function, from which you can read off the distribution directly. BTW, this question is a special case of one that is asked and thoroughly answered at stats.stackexchange.com/q/3614 and at stats.stackexchange.com/questions/116792. – whuber Oct 16 '15 at 15:27
• @AlecTeal: Easy there, tough guy. If you did your research, you'd see that i didn't have a omputer to run the simulation myself. And rolling 100 times, didn't seem as effective for such a simple question. – Marcos Oct 17 '15 at 14:06

I wouldn't want to do it algebraically, but you can calculate the pmf simply enough (it's just convolution, which is really easy in a spreadsheet).

I calculated these in a spreadsheet*:

i        n(i)   100 p(i)
5         1     0.0022
6         5     0.0109
7        15     0.0326
8        35     0.0760
9        69     0.1497
10      121     0.2626
11      194     0.4210
12      290     0.6293
13      409     0.8876
14      549     1.1914
15      707     1.5343
16      879     1.9076
17     1060     2.3003
18     1244     2.6997
19     1425     3.0924
20     1597     3.4657
21     1755     3.8086
22     1895     4.1124
23     2014     4.3707
24     2110     4.5790
25     2182     4.7352
26     2230     4.8394
27     2254     4.8915
28     2254     4.8915
29     2230     4.8394
30     2182     4.7352
31     2110     4.5790
32     2014     4.3707
33     1895     4.1124
34     1755     3.8086
35     1597     3.4657
36     1425     3.0924
37     1244     2.6997
38     1060     2.3003
39      879     1.9076
40      707     1.5343
41      549     1.1914
42      409     0.8876
43      290     0.6293
44      194     0.4210
45      121     0.2626
46       69     0.1497
47       35     0.0760
48       15     0.0326
49        5     0.0109
50        1     0.0022


Here $n(i)$ is the number of ways of getting each total $i$; $p(i)$ is the probability, where $p(i) = n(i)/46080$. The most likely outcomes happen less than 5% of the time.

The y-axis is probability expressed as a percentage. * The method I used is similar to the procedure outlined here, though the exact mechanics involved in setting it up change as user interface details change (that post is about 5 years old now though I updated it about a year ago). And I used a different package this time (I did it in LibreOffice's Calc this time). Still, that's the gist of it.

• Amazing, I wasn't expecting a symmetrical distribution at all. I'm not sure why my intuition was so far off. – Marcos Oct 16 '15 at 0:07
• The sum of independent symmetric random variables is also symmetric in distribution. – Glen_b -Reinstate Monica Oct 16 '15 at 0:24
• Nice rule. Is that published somewhere? – Marcos Oct 16 '15 at 0:32
• Yes, but my point was it's too trivial to get a journal to publish it, it would only be set as an exercise for a student. You can use the fact that the characteristic function of a random variable that's symmetric around the origin is real and even (which fact you can find it stated at the wikipedia page on the characteristic function) -- well, and I guess you need the one-to-one property of cfs vs pmfs as well, or use the dual relationship to establish that an even cf also implies a symmetric pmf ... – Glen_b -Reinstate Monica Oct 16 '15 at 0:41
• ... and the fact that a product of even functions is even, but it's actually obvious enough just from direct consideration of how convolution works - in a convolution of two symmetric functions (pmfs in this case), for every term in the sum of products at one end there's a corresponding term of the same size at the other end, symmetrically placed around the center. – Glen_b -Reinstate Monica Oct 16 '15 at 0:46

d4 <- 1:4  #the faces on a d4
d6 <- 1:6  #the faces on a d6
d8 <- 1:8  #the faces on a d8
d10 <- 1:10 #the faces on a d10 (not used)
d12 <- 1:12 #the faces on a d12
d20 <- 1:20 #the faces on a d20

N <- 2000000  #run it 2 million times
mysum <- numeric(length = N)

for (i in 1:N){
mysum[i] <- sample(d4,1)+
sample(d6,1)+
sample(d8,1)+
sample(d12,1)+
sample(d20,1)
}

#make the plot
hist(mysum,breaks = 1000,freq = FALSE,ylim=c(0,1))
grid()


The result is this plot. It is quite Gaussian looking. I think we (again) may have demonstrated a variation on the central limit theorem.

• Hmm, the lowest roll in your simulation is 6. The probability of rolling it (or any single roll, preserving die identity) is 1:4*1:6*1:8*1:10*1:12*1:20=1:460800. My procedures would demand a sample size N at least twice (perhaps 4x) this amount (like a Nyquist limit) to reveal any errors in my modeling. – Marcos Oct 16 '15 at 0:22
• My experience with Nyquist also says 4x the minimum. ... done. If 2 million isn't enough, let me know what it should be. – EngrStudent - Reinstate Monica Oct 16 '15 at 0:39
• @EngrStudent It is bell-shaped and symmetric but a fair way from Gaussian (the relatively large variance of the d20 makes it a fair bit shorter tailed than normal), but there is a version of the CLT that would apply if you had a lot of different dice. (Here "a lot" is handwaving; the CLT is really about what happens as $n\to\infty$; however, in finite samples we could invoke something along the lines of Berry-Esseen - or if we set it up right we could invoke that directly - which gives bounds on how far we could be from normal) – Glen_b -Reinstate Monica Oct 16 '15 at 0:52
• @EngrStudent: BTW, doesn't your result confirm CLT? – Marcos Oct 16 '15 at 1:01
• @theDoctor no, it doesn't confirm the CLT for a host of reasons – Glen_b -Reinstate Monica Oct 16 '15 at 1:45

A little help to your intuition:

First, consider what happens if you add one to all the faces of one die, e.g. the d4. So, instead of 1,2,3,4, the faces now show 2,3,4,5.

Comparing this situation to the original, it is easy to see that the total sum is now one higher than it used to be. This means that the shape of the distribution is unchanged, it is just moved one step to the side.

Now subtract the average value of each die from every side of that die.

This gives dice marked

• $-{3\over 2}$,$-{1\over 2}$,${1\over 2}$,${3\over 2}$
• $-{5\over 2}$,$-{3\over 2}$,$-{1\over 2}$,${1\over 2}$,${3\over 2}$,${5\over 2}$
• $-{7\over 2}$,$-{5\over 2}$,$-{3\over 2}$,$-{1\over 2}$,${1\over 2}$,${3\over 2}$,${5\over 2}$,${7\over 2}$

etc.

Now, the sum of these dice should still have the same shape as the original, only shifted downwards. It should be clear that this sum is symmetrical around zero. Therefore the original distribution is also symmetrical.

I will show an approach to do this algebraically, with the aid of R. Assume the different dice have probability distributions given by vectors $$P(X=i)=p(i)$$ where $X$ is the number of eyes seen on throwing the dice, and $i$ is a integer in the range $0,1,\dots,n$. So the probability of two eyes, say, is in the third vector component. Then a standard dice has distribution given by the vector $(0,1/6,1/6,1/6,1/6,1/6,1/6)$. The probability generating function (pgf) is then given by $p(t)=\sum_0^6 p(i) t^i$. Let the second dice have distribution given by the vector $q(j)$ with $j$ in range $0,1,\dots,m$. Then the distribution of the sum of eyes on two independent dice rolls given by the product of the pgf' s, $p(t)q(t)$. Writing out thet product we can see it is given by the convolution of the coefficient sequences, so can be found by the R function convolve(). Lets test this by two throws of standard dice:

> p  <-  q  <-  c(0, rep(1/6,6))
> pq  <-  convolve(p,rev(q),type="open")
> zapsmall(pq)
 0.00000000 0.00000000 0.02777778 0.05555556 0.08333333 0.11111111
 0.13888889 0.16666667 0.13888889 0.11111111 0.08333333 0.05555556
 0.02777778


and you can check that that is correct (by hand calculation). Now for the real question, five dice with 4,6,8,12,20 sides. I will do the calculation assuming uniform probs for each dice. Then:

> p1  <-  c(0,rep(1/4,4))
> p2 <-  c(0,rep(1/6,6))
> p3 <-  c(0,rep(1/8,8))
> p4  <-  c(0, rep(1/12,12))
> p5  <-  c(0, rep(1/20,20))
> s2  <-  convolve(p1,rev(p2),type="open")
> s3 <-  convolve(s2,rev(p3),type="open")
> s4 <-  convolve(s3,rev(p4),type="open")
> s5 <- convolve(s4, rev(p5), type="open")
> sum(s5)
 1
> zapsmall(s5)
 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000 0.00002170
 0.00010851 0.00032552 0.00075955 0.00149740 0.00262587 0.00421007
 0.00629340 0.00887587 0.01191406 0.01534288 0.01907552 0.02300347
 0.02699653 0.03092448 0.03465712 0.03808594 0.04112413 0.04370660
 0.04578993 0.04735243 0.04839410 0.04891493 0.04891493 0.04839410
 0.04735243 0.04578993 0.04370660 0.04112413 0.03808594 0.03465712
 0.03092448 0.02699653 0.02300347 0.01907552 0.01534288 0.01191406
 0.00887587 0.00629340 0.00421007 0.00262587 0.00149740 0.00075955
 0.00032552 0.00010851 0.00002170
> plot(0:50,zapsmall(s5))


The plot is shown below: Now you can compare this exact solution with simulations.

The Central Limit Theorem answers your question. Though its details and its proof (and that Wikipedia article) are somewhat brain-bending, the gist of it is simple. Per Wikipedia, it states that

the sum of a number of independent and identically distributed random variables with finite variances will tend to a normal distribution as the number of variables grows.

Sketch of a proof for your case:

When you say “roll all the dice at once,” each roll of all the dice is a random variable.

Your dice have finite numbers printed on them. The sum of their values therefore has finite variance.

Every time you roll all the dice, the probability distribution of the outcome is the same. (The dice don’t change between rolls.)

If you roll the dice fairly, then every time you roll them, the outcome is independent. (Previous rolls don’t affect future rolls.)

Independent? Check. Identically distributed? Check. Finite variance? Check. Therefore the sum tends toward a normal distribution.

It wouldn’t even matter if the distribution for one roll of all dice were lopsided toward the low end. I wouldn’t matter if there were cusps in that distribution. All the summing smooths it out and makes it a symmetrical gaussian. You don’t even need to do any algebra or simulation to show it! That’s the surprising insight of the CLT.

• While the CLT is relevant, and as the the other posts show, the distributions is roughly gaussian looking, we're only dealing with the sum of 5 independent non-identical distributions. So point 1) 5 is not really big enough to invoke a theorem that applies "at infinity". Point 2) you can't use the vanilla CLt, because the things you sums aren't iid. You need the Lyapunov CLT, I think. – Peter Oct 16 '15 at 9:32
• You do not need the Central Limit Theorem to say that the sum of some independent random variables with distributions symmetric about their respective centres has a symmetric distribution about the sum of the centres. – Henry Oct 16 '15 at 9:48
• @Peter: You’re missing the structure of my proof. The OP says “roll them all at once.” I am taking each roll of all the dice as one random variable. Those random variables do have an identical distribution. No need for Lyapunov. Also, the OP says “do so multiple times,” which I take to mean “in the limit,” so your point #1 is not valid. We aren’t just summing one roll of 5 dice here. – Paul Cantrell Oct 16 '15 at 13:17
• @PaulCantrell Each roll of all the dice is the sum of five independent non-identically distributed variables. The OP is asking about the distribution of that sum. You may do many rolls of the 5 dice, but that's just sampling from the distribution under question, nobody is summing those samples. – Peter Oct 16 '15 at 15:04
• @PaulCantrell I guess it depends on how you interpret "Do so multiple times." Do so multiple times, and them sum again (getting a single value), or do so multiple times and look at the histogram of those samples (getting multiple values). I took the latter interpretation. – Peter Oct 16 '15 at 15:10