Guessing game: what is the wining probability

conditional probabilitygame theoryprobabilitysoft-question

Numbers mean Natural Numbers.

The Game: There are two players A,B and ten numbers $1,2,3,4,5,6,7,8,9,10$. A number is being fixed say $7$ (or say $x$) provided A and B does not know about it. Now they individually guess two numbers say $p$ by A and $q$ by B. Now the one who guessed closed to $x$ (here $7$) wins.

Example: A guessed $5$, B guessed $6$ then since $|7-6|=1<2=|7-5|$ so B won.

Problem: Let us vary $x$ (the number fixed before the match), $p$ (A's guessing) and $q$ (B's guessing). Can we find a formula/ function to find the winning probability for a player?

I am unable to proceed! Where should I start? Can someone give me a detailed explanation/solution? Any help will be appreciated.

P.S.: This is neither a textbook problem nor from any competition/exam. This problem was intentionally created by me after watching some guys guessing the age of Bollywood actors on YouTube.

Thanks in advance!

Best Answer

As Leander Tilsted Kristensen notes, the pertinent probability to compute is the probability of a tie; by symmetry, each player's probability of winning is half the remaining, complementary probability.

Assuming $x$, $p$, and $q$ are chosen uniformly at random among the numbers $1$ to $10$, there are $1000$ different outcomes, all equally likely, and we need only count the number that result in ties. There are two ways a tie can happen: If $p=q$, or if $x=(p+q)/2$ (i.e., if $|x-p|=|x-q|$). The former happens in $100$ different ways; the latter happens in only $50$ different ways, namely when $p$ and $q$ have the same parity, so that $(p+q)/2$ is an integer. So our initial count is $100+50$. However this doublecounts the $10$ cases when $p=q=x$, so the final count for the number of ways a tie can occur is

$$100+50-10=140$$

and thus the probability of a tie is $140/1000=0.14$, giving each player a probability of winning of $0.43$.