Question: There are two people say, $A$, and $B$ playing a guessing game. $A$ takes a number from the set $\{1,2,3,4,...,40\}$. Then $B$ tries to find the number that $A$ chose. At each turn, $B$ tries to guess the number. Provided that $B$'s guess is correct, $B$ wins the game. Otherwise, $A$ arbitrarily either decreases or increases his/her guess by $1$. Does there exists a strategy guaranteeing that $B$ wins the game in a finite number of turns?
Could you provide any starting point for me to continue? Thanks in advance.