Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

What is the expected value of the absolute difference between 2 N faced dice? What about the difference between 2 dice one with N faces and one with M faces?

While finding the expected value of 2 random variable sums or differences are simple enough, how do you deal with absolute value of differences?


share|cite|improve this question
Have you tried listing all the possibilities in some simple cases? – Mark Bennet May 20 '12 at 20:50
up vote 5 down vote accepted

Split into cases.

For the first, $$\sum_{i=1}^n \sum_{j=1}^n \dfrac{|i-j|}{n^2} = 2 \sum_{i=1}^n \sum_{j=1}^i \frac{i-j}{n^2} = \frac{n^2-1}{3n}$$

For the second, if $n < m$, $$ \sum_{i=1}^n \sum_{j=1}^m \dfrac{|i-j|}{nm} = \sum_{i=1}^n \sum_{j=1}^i \frac{i-j}{nm} + \sum_{i=1}^{n} \sum_{j=i}^m \frac{j-i}{nm} = \frac{2 n^2 - 3 n m + 3 m^2 - 2}{6m}$$

share|cite|improve this answer
Is it surprising that the second formula is so unsymmetric in $m$ and $n$, with $m$ but not $n$ in the denominator? – Gerry Myerson May 21 '12 at 3:54
Maybe it would be if I could figure out what $n=0$ would mean. – Robert Israel May 21 '12 at 5:31

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.