What is the number of tries expected value We choose a random number from 1 to 10. We ask someone to find what number it is by asking a yes or no question. Calculate the expected value if the person ask if it is $x$ number till you got it right?
I know the answer is around 5 but i can't find how to get there.
I tried $\frac{1}{10}(1)+\frac{1}{9}(2)+\frac{1}{8}(3)+\frac{1}{7}(4)+\frac{1}{6}(5)+\frac{1}{5}(6)+\frac{1}{4}(7)+\frac{1}{3}(8)+\frac{1}{2}(9)$
but it doesn't work. Any help to point me in the right direction would be greatly appreciated.
Thank you

If you have to guess one from $n$


*

*your first guess has $\frac 1 n$ chance of being right; and

*if it isn't, you are faced with guessing $1$ from $n - 1$. 


So the expected number of guesses
$$ X_ n = \frac 1 n + \frac {n - 1} n (1 + X_{n - 1})$$
kicking off with
$$X_1 = 1$$
The first two or three cases suggest
$$X_n = \frac {n + 1} 2$$
Let's prove it by induction: 
If, for some $n$,
$$X_{n - 1} = \frac n 2 $$
then
$$\begin{align}
X_ n & = \frac 1 n + \frac {n - 1} n (1 + \frac n 2) \\
& = 1 + \frac {n - 1} 2 
\end{align}$$
So
$$ X_n = \frac {n + 1} 2 $$
So it's true for $n + 1$.
For your example, 
$$X_{10} = 5.5$$
