comparing probability of two polyhedron dice

I'm trying to figure out the probabilities associated with rolling two different types of dice and one coming out higher than the other.

Example:

Rolling a 4 sided die vs a 6 sided die, what's the probability that the 6 sider will roll higher?

Rolling a 6 sided die vs an 8 sided die, what's the probability that the 8 sider will roll higher?

Rolling an 8 sided die vs a 10 sided die, what's the probablity that the 10 sider will roll higher?

I haven't done any statistics in way too many years and am really rusty.

• As per the first example: there are $4\times 6=24$ possibilities. If on a 4-sider (assuming it goes from 1 to 4) you get 1, then $2-6$ on a 6-sider (assuming it goes from 1 to 6) are higher (i.e., 5 out of 6 possibilities). Analogously, 2 on 4-sider yields $3-6$ (4/6 possibilities), next 3/6 and 2/6. Summing up, $5+4+3+2=14$, so the probability is $14/24=7/12\approx 58\%$. Commented Feb 17, 2019 at 15:38

We can look at the brute force way of calculating this, then we derive a simpler formula

The amount of combinations for outcomes in a 4-side vs 6-side is 4 * 6 = 24

D4 1 1 1 1 1 1 2 2 2 2 2 2 3 3 3 3 3 3 4 4 4 4 4 4
D6 1 2 3 4 5 6 1 2 3 4 5 6 1 2 3 4 5 6 1 2 3 4 5 6


The occurrences where D4 >= D6 is:

D4 1 2 2 3 3 3 4 4 4 4
D6 1 1 2 1 2 3 1 2 3 4


$$1 + 2 + 3 + 4 = 10$$ Note this pattern

Therefore the occurrences for D4 < D6 is $$24 - 10 = 14$$

So the chances of you rolling a D4 < D6 is $$14/24 = 7/12$$

We can interpret from the example that you can effectively calculate this by a general formula:

Rolling a X sided die vs a Y sided die, what's the probability that the Y sider will roll higher?

We want to find the chance of DX < DY

The amount of combinations for outcomes in a X-side vs Y-side is $$X * Y = XY$$

Occurrences of DX >= DY is $$1 + 2 + 3 + ... + X$$

Therefore DX < DY is $$XY - (1 + 2 + 3 + ... + X)$$

Finally, the chance of DX < DY is $$[XY - (1 + 2 + 3 + ... + X)] / XY$$

Or, $$1 - [(1 + 2 + 3 + ... + X) / XY]$$

Therefore

D4 < D6 $$1 - [(1 + 2 + 3 + 4) / (4 * 6)] = 1 - [10/24] = 14/24 = 7/12$$ D6 < D8 $$1 - [(1 + 2 + 3 + 4 + 5 + 6) / (6 * 8)] = 1 - [21/48] = 27/48 = 9/16$$ D8 < D10 $$1 - [(1 + 2 + 3 + 4 + 5 + 6 + 7 + 8) / (8 * 10)] = 1 - [36/80] = 44/80 = 11/20$$

Sorry about the formatting, I'm still new to using this

Edit: Wrong Substitution for the last examples, sorry

• awesome. I figured out the brute force method, but I couldn't quite nail the calculations. Commented Feb 17, 2019 at 15:56
• One can also easily derive a general formula for $X,Y=X+2$ as $P=\frac{3+X}{4+2X}$, from which $\lim\limits_{X\rightarrow\infty}P=\frac{1}{2}$, and for arbitrary $X,Y$: $P=\frac{2Y-X-1}{2Y}$. Commented Feb 17, 2019 at 16:41
• Ah, sorry, forgot about changing $XY$ in the last few substitutions @TH1981, please note about the errata Commented Feb 17, 2019 at 20:52
• @Evening - np. I understood the principal of the formula and actually missed the error in the details :) Commented Feb 18, 2019 at 15:11

Analysis

Let's answer all the questions at once by supposing you are independently throwing an $$m$$-sided die (call it $$X$$) and an $$n$$-sided die (call it $$Y$$), where each die has faces numbered 1, 2, 3, etc. and all faces have equal probabilities of occurring.

The independence assumption means that any particular outcome where the first die shows the value $$i$$ (between $$1$$ and $$m$$) and the second die shows the value $$j$$ (between $$1$$ and $$n$$) is $$1/(nm).$$

The Law of Total Probability says you can break down the event "$$Y$$ is greater than $$X$$" into separate events corresponding to the value shown by $$X$$ and sum the probabilities of each separate event. Here goes:

1. $$X$$ shows a 1. For $$Y$$ to exceed $$X,$$ it must therefore show a 2, 3, etc, up to $$n.$$ There are $$n-1$$ ways in which this can happen, each of which with probability $$1/(nm),$$ so the chance is $$(n-1)/(nm).$$

2. $$X$$ shows a 2. For $$Y$$ to exceed $$X,$$ it must therefore show a 3, 4, etc, up to $$n.$$ There are $$n-2$$ ways in which this can happen, each of which with probability $$1/(nm),$$ so the chance is $$(n-2)/(nm).$$

3. The pattern potentially continues up to the case where $$X$$ shows the value $$n,$$ in which case there's no way $$Y$$ can exceed $$X.$$

4. Obviously we need to stop with the case $$X=m,$$ because it cannot result in any larger number. The probability that $$Y$$ exceeds $$X$$ in this case is $$(n-m)/(nm).$$

Solution

Summing all these possibilities and assuming $$n \ge m$$ (as in the question) gives

When $$n \ge m,$$ \eqalign{\Pr(Y \gt X) &= \frac{n-1}{nm} + \frac{n-2}{nm} + \cdots + \frac{n-m}{nm} \\&= \frac{n(n-1) - (n-m)(n-m-1)}{2} \times \frac{1}{nm}.}

The left hand factor counts the number of outcomes where $$Y$$ exceeds $$X$$ while the right hand factor of $$1/(nm)$$ converts that to a probability. (The count can be simplified to $$m(2n-m-1)$$ for computational purposes, but that simpler formula obscures the idea that led to the answer.)

In case $$m$$ is the larger number, the sum stops with $$n-m=0$$ giving a simpler value:

When $$n \lt m,$$ $$\Pr(Y \gt X) = \frac{n(n-1)}{2} \times \frac{1}{nm}.$$

Illustration

For example, the $$4(2(6)-4-1)/2 = 14$$ possible ways in which a d6 can exceed a d4 are

d4 (X): 1 1 1 1 1 | 2 2 2 2 | 3 3 3 | 4 4
d6 (Y): 2 3 4 5 6 | 3 4 5 6 | 4 5 6 | 5 6


and indeed the count is $$5+4+3+2 = 14.$$ The chance therefore is $$14/(4\times 6)= 7/12.$$ Similarly, the answers in the other two cases are $$27/48$$ (d8 vs d6) and $$44/80=11/20$$ (d10 vs d8).

If you're interested in the chance that a d4 will exceed a d6 (an example of where $$n$$ is less than $$m,$$ here are the possibilities:

d6 (X): 1 1 1 | 2 2 | 3
d4 (Y): 2 3 4 | 3 4 | 4


and indeed the count is $$3+2+1 = 6 = 4(4-1)/2.$$

Notice that $$14/24$$ and $$6/24$$ do not sum to $$1,$$ because there's a third possibility of a tie. Evidently there are four ways a tie can occur in the case, giving a chance of $$4/(4\times6).$$ The chances to add to $$1$$: $$14/24 + 6/24 + 4/24 = 24/24=1,$$ as they ought. This is a helpful check of the formulas and the arithmetic.

Brute force calculation

Finally, since you have a good SO reputation, you must have an aptitude for programming. With smallish values of $$m$$ and $$n$$ you can just generate all the possibilities and count them up. Here's an R implementation to illustrate:

f <- function(m, n) nrow(subset(expand.grid(Y=1:n, X=1:m), Y > X))


This does not do the division by $$nm$$ so that you can obtain the count of possibilities directly. Examples:

> f(4,6)
[1] 14

> f(6,8)
[1] 27

> f(8,10)
[1] 44

> f(6,4)
[1] 6

• @Corey I want to thank you for your generous attention to improving this post.
– whuber
Commented Feb 18, 2019 at 20:29
• The pleasure is all mine :) Commented Feb 18, 2019 at 20:31