# How does rerolling one of two dice affect the expected value?

This problem came to my head this morning and now I've just been curious since. Say you have two fair dice and you roll both of them after you must reroll the lowest die, if the dice are equal one gets chosen at random to be rerolled. What would be the expected outcome of this?

Example: I roll two dice and get $$\left\{2,3\right\}$$ because $$2 \lt 3$$ I reroll the first die and then I get $$\left\{4,3\right\}$$.

The expected value of two die rolls is $$7$$ because you add all the outcomes then divide by $$12$$. However in this case there the data is negatively skewed therefore we have to times the outcomes by their chance of appearing. In this case the chances for each number are:

Roll Outcome Chance
$$2$$ $$1/216$$
$$3$$ $$4/216$$
$$4$$ $$9/216$$
$$5$$ $$16/216$$
$$6$$ $$25/216$$
$$7$$ $$36/216$$
$$8$$ $$35/216$$
$$9$$ $$32/216$$
$$10$$ $$27/216$$
$$11$$ $$20/216$$
$$12$$ $$11/216$$

The $$x$$ in $$216$$ comes from $$6$$ cubed as we are effectively rolling three six-sided dice. Multiplying the rows together and then adding them we get $$7.9\overline{2}$$ as the expected value. Is this number correct? If not, how can I get the value? If so, is there a more mathematical way to prove this?

• Your table is correct but you should end up with $7.97\overline{2}$ instead (you may have made a typo or a mistake in the multiplication/addition). I left an answer with an arguably simpler approach below. Commented Dec 20, 2022 at 3:44

Let $$A$$ and $$B$$ be the first two dice rolls. Let $$C$$ be the re-roll. The final value is $$X\equiv\max(A,B)+C.$$ By linearity of expectation, $$\mathbb{E}X=\mathbb{E}\max(A,B)+\mathbb{E}C.$$ Since $$A$$ and $$B$$ are IID, $$\mathbb{P}(\max(A,B)\leq u)=\mathbb{P}(A \leq u, B\leq u)=\mathbb{P}(A\leq u)\mathbb{P}(B\leq u)=\mathbb{P}(A\leq u)^{2}.$$ Note that $$\mathbb{P}(A\leq u)=u/6$$ for $$u=0,1,\ldots,6$$. Using a well-known identity for the expectation of a nonnegative random variable, $$\begin{multline*} \mathbb{E}\left[\max(A,B)\right]=\sum_{u\geq0}\mathbb{P}(\max(A,B)>u)=\sum_{u\geq0}1-\mathbb{P}(\max(A,B)\leq u)\\ =\sum_{u\geq0}1-\mathbb{P}(A\leq u)^{2}=\sum_{u=0}^{6}1-\frac{u^{2}}{36}=7-\frac{1}{36}\sum_{u=1}^{6}u^{2}=\frac{161}{36}. \end{multline*}$$ The final solution is thus $$\mathbb{E}X=\frac{161}{36}+\frac{7}{2}=\frac{287}{36}=\boxed{7.97\overline{2}}.$$
>>> import numpy as np