11

What is the expected value of the max of two dice?

I just wonder if there's a better way to get the answer to this question than listing out all possible outcomes and determining the expected value from there as this is actually an interview question?

Thanks

Jojo
  • 1,013
  • 3
    There are $36$ ways to roll 2 dice. $11$ ways have a $6$ as the max, $9$ ways to have $5,$ $\cdots (2n-1)$ ways to have the max equal $n.$ $\frac {1}{36} \sum_\limits{n=1}^6 (2n-1)n$ since this is an interview question. $\frac 13$ the the numbers in the range should be less than the smaller of the 2, and $\frac 13$ bigger than the large of the 2, and $\frac 13$ in between. – Doug M Sep 21 '17 at 16:29
  • Well, without "listing out all possible outcomes", You can simply calculate that, since there are 6 equally likely outcomes with a single die, there are 6*6= 36 possible outcomes with two dice. In one of those, the max is 1, in three the max is 2, etc. – user247327 Sep 21 '17 at 16:33
  • @DougM, short answers are still answers. In fact they're often better answers than the long answers. I like the simplicity of your approach. – Wildcard Sep 21 '17 at 21:29
  • See https://en.wikipedia.org/wiki/Order_statistic#Dealing_with_discrete_variables for an explicit formula. – amd Sep 21 '17 at 22:15

3 Answers3

13

Denote outcomes $(X_1,X_2)$ and $Z=\max\{X_1,X_2\}$. Then just use that the outcomes are independent and break the event "$Z=a$" into "$(X_1=a \text{ and }X_2\leq a)\text{ or }(X_2=a\text{ and }X_1<a)$": $$E(Z)=\sum_{a=1}^6 a\cdot P(Z=a)=\sum_{a=1}^6 a\cdot (P(X_1=a \text{ and }X_2\leq a )+P(X_2=a \text{ and }X_1<a))$$ $$=\sum_{a=1}^6 a\cdot \left(\frac{1}{6}\cdot\frac{a}{6}+\frac{1}{6} \cdot \frac{a-1}{6}\right)=\frac{161}{36}$$

dromastyx
  • 2,796
  • 1
    Thanks. I actually find your answer very intuitive. Could I just ask why when you break the event "Z=a" into two cases, in the second case its "X_1<a" rather than "X_1<=a"? – Jojo Sep 21 '17 at 18:18
  • 5
    @Jojo The events where both outcomes are equal, i.e "$X_1=a\text{ and } X_2=a$" are already counted in the event "$X_1=a\text{ and } X_2\leq a$". – dromastyx Sep 21 '17 at 19:15
11

Suppose the dices have $n$ faces. Let $X=\max(a,b)$

Note that:

$X=1$ only in the case (1,1), i.e. $p_X(1)=1/n^2$

$X=2$ in the cases (1,2), (2,2), (2,1), i.e. $p_X(2)=3/n^2$

$\vdots$

$X=k$ in $k+k-1=2k-1$ cases, i.e. $p_X(k)=(2k-1)/n^2$(this is easy to see when you draw all the cases).

$$E(X)=\frac{1}{n^2} \sum_{x=1}^{n}x(2x-1)=\frac{1}{n^2} \sum_{x=1}^{n}(2x^2-1)=\\ \frac{1}{n^2}\left(\frac{n(n+1)(2n+1)}{3}-\frac{n(n+1)}{2}\right)=\frac{4n^3+3n^2-n}{6n^2} = \dfrac{4n^2 + 3n - 1}{6n}$$

Nash J.
  • 1,235
  • 8
  • 18
ictibones
  • 1,914
6

Reasoning as for the time allowed to answer to an interview:
a) in a square $6 \times 6$, the number of cases with max no greater than $m$, will be the square $m \times m$.
b) so $m^2/36$ gives the CDF.
c) the median will be at $CDF = 1/2$ that is for a square of area $=18$, i.e. about $4.2$.
d) to be a bit more precise, the pmf is $(m^2-(m-1)^2)=(2m-1)/36$, which is linear and the average is therefore $$ \sum\limits_{1\, \le \,m\, \le \,6} {m\left( {2m - 1} \right)} /36 = 161/36 \approx 4.47 $$

G Cab
  • 35,272