[Math] Choosing a number between $1$ and $100$, and randomly guessing it. What is the expected value of the number of guesses

probabilityprobability distributionsrandom variables

I was watching Steve Balmer’s interview and he was talking about questions they’d ask from candidates. This is a question he gave, he says-

I choose a number between $1$ to $100$, the other person has to guess the number. If he gets it right the first time he gets $5$ bucks, if he misses the first time steve tells you whether the number is higher or lower( he does this every time you miss), if he gets it right the second time he gets $4$ bucks, third time $3$, fourth $2$ and so on and if he gets it right in the seventh guess the person has to give a buck to Steve and so on, the value goes decreasing. I am trying to calculate the expected value of this game, how can I solve this, I can’t seem to come up with a way.

P.S. I have edited the question with a slight variation, in the previous version steve doesn’t tell you anything after you have guessed the wrong number.

Best Answer

The answer posted by Jorge is right. Just to add some clarifications.

In the first try you have $\frac 1 {100}$ chance of guessing it right. On the second guess, your chance increases to $\frac 1 {99}$ as you know the answer isn't your guess and you aren't going to make the same guess. However, the probability that you are going to make the second guess (i.e. you guess the first one wrong) is $\frac {99} {100}$ so the probability is again, $\frac 1 {99}$ * $\frac {99} {100}$ = $\frac 1 {100}$. With same logic, your probability of guessing it right on the nth try is always $\frac 1 {100}$

The rest of the calculation checks out.

$$\sum\limits_{i=1}^{100} \frac{6-i}{100} = 6 - \frac{100\times 101}{2\times 100}=6-50.5=-45.5$$