[Math] Compute the expected value of median of rolling a die three times.

expected valuemedianprobability

The following is an interview question.

Question: Compute the expected value of median of rolling a die three times.

I solved the question in the following manner:

Let $X$ be the median. Then, for any $1\leq x\leq 6,$ $x$ is a median consists of three possible scanarios: all three dice give $x$, or two dice give $x$ and another dice gives anything or all three dice give different numbers and one of them gives $x$.

By using reasoning above, we have
$$P(X=x) = \frac{1}{216} + \binom{3}{1} \frac{5}{216} + \frac{3! (x-1)(6-x)}{216} = \frac{-3x^2+21x-10}{108}.$$
Therefore,
$$E(X) = \sum_{x=1}^6 xP(X=x) = \sum_{x=1}^6 x\frac{-3x^2+21x-10}{108} = 3.5$$
from wolfram alpha .

What interests me is that the final answer is the same as expected value of a single die.

I am wondering whether there is a shorter way to solve the problem.

Best Answer

As already noted in a comment, the result can be derived from symmetry without any calculation. The probability distribution of the die is invariant under the symmetry transformation $x\to7-x$, a reflection about $x=\frac72$. Thus the median and the mean must also be invariant under this transformation. Thus they must be the centre of the reflection, $x=\frac72$.

Related Question