Ankur and Vijay are fond of playing Number games. In one of the games, Ankur has to choose a number X, such that X belongs to [1, 10000] . Vijay has to guess the chosen number as soon as possible. Ankur will let Vijay know whether his guess is smaller than, larger than or equal to the number. The warning is that Vijay loses the game if his guess is larger than Ankur’s chosen number two or more times.
Q1. How to make guesses, and how many guesses are necessary?
Q2. What if Ankur is allowed to pick a very large positive number without any given limits ? .
Both the problems can be treated in the following ways:
When Ankur chooses a number between 1 and n, here n=10000, Vijay should start guessing √n, 2√n, 3√n, 4√n, and so on. The first time his guess exceeds Ankur’s number, the range of numbers has been narrowed down to √n numbers; he then starts guessing sequentially in that range.
Ans2: If Ankur guesses an arbitrarily large number n, then Vijay may guess 1, 4, 9, 16, 25, and so on, to discover k such that Ankur’s number lies between k^2 and (k+1)2. Then guess k2+1, k2+2, k2+3 and so on. On the whole, this requires O(√n) steps.
This puzzle is contributed by Praveer Satyam. Please write comments if you find anything incorrect, or you want to share more information about the topic discussed above
- Puzzle | (Something for the marmalade , Number Game)
- Puzzle 14 | (Strategy for a 2 Player Coin Game)
- Puzzle 73 | The Card Game
- Puzzle | (Round table coin game)
- Puzzle | Game of Brussels Sprouts
- Puzzle | Choose the game of Rolling Dice
- Puzzle 24 | (10 Coins Puzzle)
- Puzzle 27 | (Hourglasses Puzzle)
- Puzzle 28 | (Newspaper Puzzle)
- Puzzle 29 | (Car Wheel Puzzle)
- Puzzle 31 | (Minimum cut Puzzle)
- Puzzle 33 | ( Rs 500 Note Puzzle )
- Puzzle 34 | (Prisoner and Policeman Puzzle)
- Puzzle 36 | (Matchstick Puzzle)
- Puzzle 38 | (Tic Tac Toe Puzzle)
- Puzzle 39 | (100 coins puzzle)
- Puzzle 51| Cheryl’s Birthday Puzzle and Solution
- Puzzle 81 | 100 people in a circle with gun puzzle
- Puzzle 85 | Chain Link Puzzle
- Puzzle | Elevator Puzzle