Consider a number drawn from $U(1,100)$. When we make an incorrect guess, we are told whether the target number is smaller or larger. So we employ a binary search approach, where the first guess is 50. If that is not the target, then that means our next guess is going to be 25 or 75.
What is the probability that binary search ends in 2 guesses?
At first, I thought it was $P(B|A)P(A)$ where $A$ is the event that the first guess is wrong and $B$ is the event that the second guess is right. We know $P(A) = 99/100$. When $A$ occurs, that means we would either search in the interval $[1,49]$ or $[51, 100]$, which has 49 and 50, elements, respectively. So I believe $P(B | A) = 49/100 * 1/49 + 50/100 * 1/50 = 2/100$.
So $P(B|A)P(A) = 99/100 * 2/100 = 0.198$.
Then I second guessed myself and started wondering why is it not $2/100$? If it ends in 2 guesses, it means the target number is 25 or 75. Since the target number is uniformly chosen, the probability that it being 25 or 75 is $2/100=1/50 = 0.2$.
Both of these answers seem right to me, but 1 one of them must be wrong. Which one is wrong?