Two dice problems

Nick Berry asks: you roll a pair of six-sided dice and sum that to get a total. Your good friend does the same. What are the chances that you both get the same total?

My instinct is to say that it should be somewhere between 1/6 and 1/11 – you’d get 1/6 if the question were about one die and 1/11 if it were about picking uniformly a number from 2, 3, …, 12.

Let’s generalize. What if you roll two n-sided dice? In that case, the probabilities of getting 2, 3, …, n+1 are 1/n^2, 2/n^2, \ldots, n/n^2, and the probabilities of getting n+2, n+3, …, 2n are (n-1)/n^2, (n-2)/n^2, \cdots, 1/n^2 – generalizing the well-known triangular distribution. The probability that you and your friend both roll 2, then, is

\displaystyle \left( {1 \over n^2} \right)^2 + \left( {2 \over n^2} \right)^2 + \cdots + \left( {n-1 \over n^2} \right)^2 + \left( {n \over n^2} \right)^2 + \left( {n-1 \over n^2} \right)^2 + \cdots + \left( {1 \over n^2} \right)^2

or, putting everything over a common denominator,

\displaystyle {1^2 + 2^2 + \cdots + (n-1)^2 + n^2 + (n-1)^2 + \cdots + 1^2 \over n^4}

At this point we can already see that there are order-of-n terms in the numerator, of order n^2, so we should get a result of order 1/n. We can peservere and do the algebra and we get

\displaystyle {2n^3 + n \over 3n^4}

or just a hair over 2/3n.

Berry also asks what happens if you have more dice. For k six-sided dice he gives the results of a Monte Carlo simulation which has roughly 1/{6\sqrt{k}}. He writes that “the percentage chance of a match score falls off a lot slower than I would have predicted.”

Why does it fall off so slowly? The mean result from a single die is 7/2, with variance 35/12. So the mean result from k dice is 7k/2, with variance 35k/12 – so only values within a few multiples of \sqrt{35k/12} are possible with any appreciable frequency. There are on the order of a few square roots of k of these, so the answer should be 1/\sqrt{Ck} for some k. Like Berry, I am too lazy to find the constant C.

Edited to add: Matthew Aldridge gives in the comments an argument (for approximating that for k six-sided dice, with $k$ large, the probability of both getting the same total is approximately 1/\sqrt{pi \times 35k/3}, by approximating both sums as normal and applying the central limit theorem. This is about 1/(6.054 \sqrt {k}). If we bear in mind that the variance of a single roll of an n-sided die is (n^2-1)/12, then we get 1/\sqrt{pi/3 \times (n^2-1)k} for rolling k n-sided dice.

This approximation is surprisingly good even for k = 1, where it has no business being good. It gives 1/\sqrt{pi/3 \times (n^2-1)}. This reduces to 1/n, the correct answer, if you let \pi = 3 and ignore the -1.