Question: Consider a dice game in which you try to obtain the largest number (*e.g.* you win a prize based on the final dice roll).

1. You roll an 8-sided die, with numbers 1–8 on the sides.
2. You may either keep the value you rolled, or choose to roll a 12-sided die, with numbers 1–12 on the sides.

What's the best strategy for choosing what to do in step #2? 

I know the 8-sided die has expected payoff of 4.5, and the 12-sided die has expected payoff of 6.5. So I think relying on the 12-sided die is better — but how do I show the probability of this?

Answer: 
If you are trying to maximise the expected score, then since the expected value of the 12-sided die is $6.5$, it makes sense to stop when the 8-sided die shows greater than $6.5$, i.e. when it shows $7$ or $8$, each with probability $\frac18$. So with probability $\frac34$ you throw the 12-sided die.

The expected score is then $$7 \times \frac18 + 8 \times \frac18 + 6.5 \times \frac34 = 6.75.$$
There are 256 possible strategies. To know which one to choose we would need to know the criteria for deciding how good the result is.

On the assumption that the utility of the result is nondecreasing (either a 2 is just as good as a 1, or better, etc.) there are only eight sensible strategies: keep a 2 or higher but reroll 1s, keep a 3 or higher but reroll 1s and 2s, ..., keep 8 but reroll 1-7, or reroll always.

Of those strategies "keep 7 or higher, reroll 6 or lower" is the one which maximizes the average, as explained by Henry. But others could make sense. If you're playing a Russian Roulette variant where 1 means bullet and 2 or higher means blank, you want to reroll a 1 and keep everything else. If you win $\$n^2$ on a roll of $n$ (and are risk-neutral), you should keep 8 but reroll everything lower.