Computer Science, asked by gayathriarunrao, 7 months ago

There are 83 match sticks on the floor, and you have to clean them up with a friend. To make it fun (instead of the chore that it is), you decide to make a game out of it. You take turns to pick up the matches and put it back in the box. The rule is that each turn, the player must take at least one match stick, but not more than 4. Both you and your opponent can see the exact number of matches that were taken. The one who picks up the last match stick wins. You flip a coin and it’s decided that you get to make the first move.
It looks like a game, but this “game” is actually flawed: Player 1 of this game has a sure-win strategy. Explain the theory behind the strategy, and write an algorithm that ensures you will win this game.

Answers

Answered by Anonymous
1

Answer:

To win at Nim-game, always make a move, whenever possible, that leaves a configuration with a ZERO “Nim sum”, that is with ZERO unpaired multiple(s) of 4, 2 or 1. Otherwise, your opponent has the advantage, and you have to depend on his/her committing an error in order to win.

.=  =  =  >

Similar questions