Can You Level Up Your Armor?

Riddler Classic

From Jenny Mitchell comes a matter of shoring up your defenses:

In the hit online game World of Riddlecraft, players can level up their armor. Armor levels range from 0 to 5. Now, attempting to level up your armor requires a cerulean gem, which is destroyed in the process. If the attempt is successful, your armor’s level goes up by one; if not, it goes down by one.

Fortunately, it’s impossible to fail when attempting to upgrade your armor from level 0 to level 1. However, the likelihood of success goes down the higher level the armor is before the upgrade. More specifically:

On average, how many cerulean gems can you expect to use up in order to upgrade your armor from level 0 to level 5?

Solution

Look at each step independently.

Level 0 to 1

Upgrading from level 0 to level 1 uses exactly 1 gem.

The expected number of gems is thus 1.

Level 1 to 2

Upgrading from level 1 to level 2 uses:


The expected value is the sum of these terms,
$$ 1\cdot\dfrac{4}{5} + 2\cdot\dfrac{1}{5}\cdot\dfrac{4}{5} + \dots + g\cdot\left(\dfrac{1}{5}\right)^{g-1}\cdot\dfrac{4}{5}$$
$$ = \dfrac{4}{5} \cdot \left( \sum_{g = 0}^\infty \left(\dfrac{1}{5}\right)^g + \sum_{g = 1}^\infty \left(\dfrac{1}{5}\right)^g + \sum_{g = 2}^\infty \left(\dfrac{1}{5}\right)^g + \cdots \right)$$
Using infinite geometric sum,
$$ = \dfrac{4}{5} \cdot \left(\dfrac{1}{1-\frac{1}{5}} + \dfrac{\frac{1}{5}}{1-\frac{1}{5}} + \dfrac{\left(\frac{1}{5}\right)^2}{1-\frac{1}{5}} + \cdots \right)$$ Using infinite geometric sum again,
$$ = \dfrac{4}{5} \cdot \dfrac{\dfrac{1}{1-\frac{1}{5}}}{\dfrac{4}{5}} = \dfrac{5}{4}$$

Level 2 to 3

Upgrading from level 2 to level 3 uses:


Similar to above yields,
$$ = \dfrac{3}{5} \cdot \left( \sum_{g = 0}^\infty \left(\dfrac{2}{5}\right)^g + \sum_{g = 1}^\infty \left(\dfrac{2}{5}\right)^g + \sum_{g = 2}^\infty \left(\dfrac{2}{5}\right)^g + \cdots \right)$$
Using infinite geometric sum,
$$ = \dfrac{3}{5} \cdot \left(\dfrac{1}{1-\frac{2}{5}} + \dfrac{\frac{2}{5}}{1-\frac{2}{5}} + \dfrac{\left(\frac{2}{5}\right)^2}{1-\frac{2}{5}} + \cdots \right)$$ Using infinite geometric sum again,
$$ = \dfrac{3}{5} \cdot \dfrac{\dfrac{1}{1-\frac{2}{5}}}{\dfrac{3}{5}} = \dfrac{5}{3}$$

Level 3 to 4

Upgrading from level 3 to level 4 uses:


Similar to above yields,
$$ = \dfrac{2}{5} \cdot \left( \sum_{g = 0}^\infty \left(\dfrac{3}{5}\right)^g + \sum_{g = 1}^\infty \left(\dfrac{3}{5}\right)^g + \sum_{g = 2}^\infty \left(\dfrac{3}{5}\right)^g + \cdots \right)$$
Using infinite geometric sum,
$$ = \dfrac{2}{5} \cdot \left(\dfrac{1}{1-\frac{3}{5}} + \dfrac{\frac{3}{5}}{1-\frac{3}{5}} + \dfrac{\left(\frac{3}{5}\right)^2}{1-\frac{3}{5}} + \cdots \right)$$ Using infinite geometric sum again,
$$ = \dfrac{2}{5} \cdot \dfrac{\dfrac{1}{1-\frac{3}{5}}}{\dfrac{2}{5}} = \dfrac{5}{2}$$

Level 4 to 5

Upgrading from level 4 to level 5 uses


Similar to above yields,
$$ = \dfrac{4}{5} \cdot \left( \sum_{g = 0}^\infty \left(\dfrac{1}{5}\right)^g + \sum_{g = 1}^\infty \left(\dfrac{4}{5}\right)^g + \sum_{g = 2}^\infty \left(\dfrac{4}{5}\right)^g + \cdots \right)$$
Using infinite geometric sum,
$$ = \dfrac{1}{5} \cdot \left(\dfrac{1}{1-\frac{4}{5}} + \dfrac{\frac{4}{5}}{1-\frac{4}{5}} + \dfrac{\left(\frac{4}{5}\right)^2}{1-\frac{4}{5}} + \cdots \right)$$ Using infinite geometric sum again,
$$ = \dfrac{1}{5} \cdot \dfrac{\dfrac{1}{1-\frac{4}{5}}}{\dfrac{1}{5}} = \dfrac{5}{1}$$

Answer

The expected value of all 5 upgrades is thus,

$$1 + \dfrac{5}{4} + \dfrac{5}{3} + \dfrac{5}{2} + \dfrac{5}{1}$$


$$= \dfrac{274}{24} \approx 11.417 \text{ cerulean gems}$$

Rohan Lewis

2022.04.16