Some Tricks to solve problems on Impartial games Last Updated : 05 Apr, 2019 Summarize Comments Improve Suggest changes Share Like Article Like Report How to solve problems that fall in the Finders keepers category in 'Game Theory'? Note- Finders keepers game fall into the category of 'Impartial Games' in 'Game Theory'. What are 'Impartial Games'? Let a game is being played between two players 'A' and 'B'. A game between them is said to be 'Impartial' if both the players have same set of moves. Which move to choose at a particular moment of the game depends on the state of the game. FINDERS KEEPERS GAME Let two players A and B playing a game on a pile of coins. Each player has to remove a minimum of 'a' coins or maximum of 'b' coins from the pile in his turn until there are less than 'a' coins left. Types: Finder-Winner -> In this format the player to play the last move wins. Keeper-Loser -> In this format the player to play the last move loses. STRATEGIES Note- If there are less than 'a' coins available then last player to move must pick all coins. FINDER-WINNER: Let 'A' be the player to start. For a game of FINDER-WINNER the main strategy is to reduce the present number coins to a multiple (a+b) for 'A' to win the game. Else he loses and 'B' wins. KEEPER-LOSER: Let 'A' starts the game. For 'A' to win the game the main condition for winning it is to reduce the pile of coins to - (a+b)k + [1, a], i.e. the number of coins can be reduced to more then a multiple of (a+b) by [1 upto a]. If he can do so he wins else 'B' wins. Examples: Let A and B play a game of FINDER-WINNER on a set of 20 coins. A player in his move can remove a minimum of 5 coins and a maximum of 7 coins. predict the Winner of the Game If A starts first and if both players play optimally. Given number of coins = 20. Minimum coins that can be removed = 5 - Let it be 'a'. Maximum coins that can be removed = 7 - Let it be 'b'. According to given strategy for FINDER-WINNER: For A to win: A must remove the number of coins to a multiple of (a + b). Nearest multiple of (a + b) for 20 is 12. So A can deduct either 5 or 6 or 7 coins from the set so he cant reach 12 anyhow. So for B to make a move, he will be left with 15 or 14 or 13 coins. Now for A's next move corresponding states are (10, 9, 8), (9, 8, 7) and (8, 7, 6). Since B is also playing optimally he will keep the number of coins for A's move greater than 7 so that A cant win. Hence, he will get at least 1 coin to be removed in the last move and WIN. Let A and B play a game of Keeper-Loser on a set of 20 coins. A player in his move can remove a minimum of 2 coins and a maximum of 5 coins. Predict the Winner of the Game If A starts first and if both players play optimally. Given number of coins = 20. Minimum coins that can be removed = 2 - Let it be 'a'. Maximum coins that can be removed = 5 - Let it be 'b'. According to given strategy for KEEPER-LOSER : For A to win: A must remove the number of coins to a multiple of (a + b)k + [1, a]. Here a + b = 7. Now, for playing optimally lets see what A will do in further rounds. If A reduces the set of coins to lets say 15 which is of the form (2 + 5) * 2 + 1 as it is reachable by removing 5 coins from a set of 20 coins. From here B can take any number of coins from [2, 5] lets name it as c. The main strategy of A now will be to remove 7 - c in his moves. Why is it so? Lets say after 15, B reduces the set to 10 by taking away 5 coins. Now optimal strategy for A is to remove 2 coins. If he does so, the set reduces to 8 coins. Now from here B can reduce the set to (6, 5, 4, 3) by removing (2, 3, 4, 5) coins respectively. From here again, the main idea for A is to take away 7 - c coins which will keep 1 coin for B to remove. Hence A wins. Comment More infoAdvertise with us Next Article What are Ad Hoc Problems in Competitive Programming? M Mostafijur Rahaman Follow Improve Article Tags : DSA Similar Reads Secretary Problem (A Optimal Stopping Problem) The Secretary Problem also known as marriage problem, the sultan's dowry problem, and the best choice problem is an example of Optimal Stopping Problem. This problem can be stated in the following form: Imagine an administrator who wants to hire the best secretary out of n rankable applicants for a 12 min read Practice Problems on Game Theory Game Theory is a topic in competitive programming that involves a certain type of problem, where there are some players who play a game based on given rules and the task is often to find the winner or the winning moves. Game Theory is often asked in short contests with a mixture of other topics like 4 min read Minimum Players required to win the game Given N questions and K options for each question, where 1\leq N \leq 1000000000 and 1\leq K \leq 1000000000 . The task is to determine the sum of total number of player who has attempted ith question for all 1 \leq i \leq N to win the game anyhow. You have to minimize the sum of a total number of p 6 min read What are Ad Hoc Problems in Competitive Programming? The Ad Hoc problems are problems that cannot be classified anywhere else in the categories with well-studied solutions since each problem description and its corresponding solution are unique. These problems don't fall under standard categories, there is no specific or general technique exists to so 5 min read The prisoner's dilemma in Game theory Two members of a criminal gang are arrested and imprisoned. Each prisoner is in solitary confinement with no means of communicating with the other. The prosecutors lack sufficient evidence to convict the pair on the principal charge. They hope to get both sentenced to a year in prison on a lesser ch 3 min read Game Theory (Normal form game) | Set 2 (Game with Pure Strategy) Game Theory (Normal â form game) | Set 1 (Introduction) Please go through the above article before proceeding. Given a payoff matrix. The task is to find the optimum strategies of the players. Solution: Player A is having 3 strategies - 1, 2 and 3, and player B is also having 3 strategies - 1, 2 and 2 min read Like