Wednesday, October 27, 2010

Winner Winner Chicken Dinner - One puzzle a day - Puzzle Buddies

Puzzle: Your friend suggests a betting game. The rules are:

  1. Each person has to call a number after each another until someone calls 50. 
  2. Person who calls 50 wins.
  3. The player who starts has to call a number between 1 and 10 (inclusive).
  4. The new number must be at least 1 greater than the previous number. 
  5. It should not be more than 10 to the previous number.

You have bet 100 dollars on this game. You got the first turn. Which number would you call and why?

Note: Don't forget to visit us again. Answer to the puzzle will be posted tomorrow.
Solution:
This is a good example of backtracking algorithms
Winner says 50.
Looser has to say a number between: 40-49
Winner says 39
Looser has to say a number between: 29-38
Winner says 28
Looser has to say a number between 18-27
Winner says 17
Looser has to say a number between 7 and 16
Winner has to say 6 to start this.
So the answer is 6.
Winner: Kasturi is the Winner

1 comment:

  1. I would call 6 and the game would proceed in the following manner:

    Me: 6
    Friend: Any number between 7 and 16 inclusive
    Me: 17
    Friend: 18-27
    Me: 28
    Friend: 29-38
    Me: 39
    Friend: 40-49
    Me: 50 Winner :)

    ReplyDelete