Three six-sided dice are rolled. Denote the greatest value rolled to be x and the smallest value rolled to be y. What is the expected value of x-y?

161 Views Asked by At

Three six-sided dice are rolled. Denote the greatest value rolled to be $x$ and the smallest value rolled to be $y$. What is the expected value of $x-y$?

Any help is greatly appreciated. I'm not sure how to go about this.

I listed out all the possible differences. One 5, two 4's, three 3's, four 2's, five 1's, and six 0's. The total of these values is $35$ and there are $21$ different outcomes. Does this make sense?

3

There are 3 best solutions below

7
On

To get a maximum value of $1$ you need to get all $1's$ with probability $\frac{1}{6}^3$.

To get a maximum value of $2$ you need to either get all $2$'s, one $2$ and two $1$'s, or two $2$'s and one $1$ with probability $$\frac{1+{3\choose{2}}+{3\choose{1}}}{6^3}$$

To get a maximum of $3$, you need to either get all $3$'s, two of the other two numbers and a $3$, two of one of the other two numbers and a $3$, or two $3$'s and one of the other two numbers, giving a probability of $$\frac{1+3!{2\choose{2}}+{3\choose{2}}{2\choose{1}}+{3\choose{1}}{2\choose{1}}}{6^3}$$

To get a maximum of $4$, you need to either get all $4$'s, two of the other three numbers and a $4$, two of one of the other three numbers and a $4$, or two $4$'s and one of the other three numbers, giving a probability of

$$\frac{1+3!{3\choose{2}}+{3\choose{2}}{3\choose{1}}+{3\choose{1}}{3\choose{1}}}{6^3}$$

To get a maximum of $5$, you need to either get all $5$'s, two of the other four numbers and a $5$, two of one of the other four numbers and a $5$, or two $5$'s and one of the other four numbers, giving a probability of $$\frac{1+3!{4\choose{2}}+{3\choose{2}}{4\choose{1}}+{3\choose{1}}{4\choose{1}}}{6^3}$$

To get a maximum of $6$, you need to either get all $6$'s, two of the other five numbers and a $6$, two of one of the other five numbers and a $6$, or two $6$'s and one of the other five numbers, giving a probability of

$$\frac{1+3!{5\choose{2}}+{3\choose{2}}{5\choose{1}}+{3\choose{1}}{5\choose{1}}}{6^3}$$

Summing these I get $$E(X)=\left(1\cdot\frac{1}{6^3}\right)+\left(2\cdot\frac{7}{6^3}\right)+\left(3\cdot\frac{19}{6^3}\right)+\left(4\cdot\frac{37}{6^3}\right)+\left(5\cdot\frac{61}{6^3}\right)+\left(6\cdot\frac{91}{6^3}\right)\approx 4.958$$

Checking that the numerators sum to $6^3 = 216$, I get

$$1+7+19+37+61+91=216$$

By symmetry, the expected value of the minimum is $$4.958-3.5\approx2.0417$$

Thus $$E(X-Y)=E(X)-E(Y)\approx4.958-2.0417 \approx 2.916$$

Note: Needs to be checked!

An excel simulation with about $1$,$000$ trials gives an expected value of the minimum as being $2.048$, an expected value of the maximum as being $4.99$, and a mean difference of $2.88$ which I would say agrees with my result.

0
On

I can't put this in comment, but was asked by @Remy to show my empirical solution, which is in C.

#include <stdio.h>
#include <stdlib.h>

#define RUNS 12000

int main()
{
    int i, a, b, c, maxv, minv, diff, tot = 0;
    int count[6] = { 0 };
    for(i=0; i<RUNS; i++) {
        a = 1 + rand() % 6;
        b = 1 + rand() % 6;
        c = 1 + rand() % 6;

        maxv = a;
        if(maxv < b) maxv = b;
        if(maxv < c) maxv = c;

        minv = a;
        if(minv > b) minv = b;
        if(minv > c) minv = c;

        diff = maxv - minv;
        count[diff]++;
        tot += diff;
    }
    printf("Average %f\n", (double)tot / RUNS);

    for(i=0; i<6; i++)
        printf("%d %4d\n", i, count[i]);
    return 0;
}

Program output:


Average 2.915833
0  331
1 1673
2 2634
3 3019
4 2723
5 1620

Edit: since I overlooked that there are 216 combinations, I modified the code to include them all instead of pseudo random throws.

#include <stdio.h>

int main()
{
    int i, a, b, c, maxv, minv, diff, tot = 0, runs = 0;
    int count[6] = { 0 };
    for(a=1; a<=6; a++) {
        for(b=1; b<=6; b++) {
            for(c=1; c<=6; c++) {

                maxv = a;
                if(maxv < b) maxv = b;
                if(maxv < c) maxv = c;

                minv = a;
                if(minv > b) minv = b;
                if(minv > c) minv = c;

                diff = maxv - minv;
                count[diff]++;
                tot += diff;
                runs++;
            }
        }
    }
    printf("Average %f\n", (double)tot / runs);

    for(i=0; i<6; i++)
        printf("%d %4d\n", i, count[i]);
    return 0;
}

Average 2.916667
0    6
1   30
2   48
3   54
4   48
5   30
4
On

A slightly easier way of counting:

Rolling the dice one at a time, there are $216$ possible outcomes (sequences of three numbers), each of which has $\frac{1}{216}$ probability to occur.

Of the $216$ possible outcomes there is exactly $1^3 = 1$ in which all rolls are less than $2,$ and in that outcome the maximum is $1.$

There are exactly $2^3 = 8$ outcomes in which all rolls are less than $3.$ Of those outcomes, we have already found $1$ with maximum $1$; the other $7$ have maximum $2.$

There are exactly $3^3 = 27$ outcomes in which all rolls are less than $4.$ Of those outcomes, we have already found $8$ in which the maximum is either $1$ or $2$; the other $19$ have maximum $3.$

Similarly, we have $4^3 - 3^3 = 64 - 27 = 37$ outcomes with maximum $4,$ $5^3 - 4^3 = 125 - 64 = 61$ outcomes with maximum $5,$ and $6^3 - 5^3 = 216 - 125 = 89$ outcomes with maximum $6.$

The expected value of the maximum roll comes out to \begin{align} E(\max) &= \frac{1}{216}(1(1^3) + 2(2^3 - 1^3) + 3(3^3 - 2^3) + 4(4^3 - 3^3) + 5(5^3 - 4^3) + 6(6^3 - 5^3))\\ &= \frac{1}{216}((1-2)1^3 + (2-3)2^3 + (3-4)3^3 + (4-5)4^3 + (5-6)5^3 + 6\cdot6^3)\\ &= \frac{1}{216}(6^4 - (1^3 + 2^3 + 3^3 + 4^3 + 5^3))\\ &= \frac{1}{216}\left(6^4 - \frac14\cdot 5^2\cdot 6^2\right)\\ &= \frac{6^4 - 225}{216}\\ &= \frac{1071}{216}\\ &\approx 4.958333. \end{align}

Note that this method is easily extended to larger numbers of dice or larger numbers of faces on each die.

As already observed in another answer, the expected value of the minimum is $E(\min) = 7 - E(\max),$ so we have \begin{align} E(\max - \min) &= E(\max) - E(\min)\\ &= E(\max) - (7 - E(\max))\\ &= 2E(\max) - 7\\ &\approx 2.916666. \end{align}