Choosing a number puzzle.

92 Views Asked by At

A and B play a game, where A begins the game. A can start the game by calling a number from 1 to 10, then the game continues by the other person choosing a number. But rule of game is if one picks x, then the other person can only pick integer between [x+1,x+10]. This means if first time A picks 1, B can pick at most 11 and at least 2.

The first person to call 100 wins the game.

My question is what number should A pick in the first trial so that his winning is guaranteed. This was an interview question.

1

There are 1 best solutions below

0
On BEST ANSWER

The answer is one. Because then whatever $B$ picks $A$ can get to 12, then whatever $B$ picks $A$ can get to 23, then whatever $B$ picks $A$ can get to 34, and then whatever $B$ picks $A$ can get to 45, then whatever $B$ picks $A$ can get to 56, then whatever $B$ picks $A$ can get to 67, then whatever $B$ picks $A$ can get to 78, then whatever $B$ picks $A$ can get to 89, then whatever $B$ picks $A$ can get to 100