Say I am playing a difficult videogame where the goal is to get to the highest level possible without dying. Now say the chance I have of beating a level is x%. What would the average level achieved by? I assumed that the average would come when getting to a certain level has an exactly 50% chance of happening, so I used the equation $\log_{x/100}0.5$. In the case of an 80% chance, the average level is 3.1062837195054. However, when I coded an algorithm to brute force 1000000 different games, I get the actual average score 4.050343.
What is wrong with my average calculation, or is it correct and my brute-forced average a fluke?