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. 
 A: 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:

*

*$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).$


*$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).$


*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.$


*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.$

Comments
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

A: 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
