The Wayback Machine - https://web.archive.org/web/20240627104137/https://www.geeksforgeeks.org/practice-problems-on-game-theory/
Open In App

Practice Problems on Game Theory

Last Updated : 28 Sep, 2023
Improve
Improve
Like Article
Like
Save
Share
Report

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 range querying or greedy or dynamic programming.

Objectives Game Theory for Competitive Programming:

  • Here we will focus on two-player games that do not contain random elements.
  • Our goal is to find a strategy we can follow to win the game no matter what the opponent does if such a strategy exists. 
  • Game theory or combinatorics game theory in which we have perfect information (that is no randomization like a coin toss) such as game rules, player’s turn, minimum and maximum involved in the problem statements, and some conditions and constraints.
  • There will be three possible cases/ state win, loss or tie.
  • A terminal condition is well-defined/ specified clearly.
    E.g. player who picks the last coin will win the game, or a player who picks the second last time coin will win the game or something like that.
  • It is assumed that the game will end at some point after a fixed number of moves. Unlike chess, where you can have an unlimited number of moves possible especially when you are left with the only king, but if you add an extra constraint that says “game should be ended within ‘n’ numbers of moves”, that will be a terminal condition. This is the kind of assumption a game theory is looking for.
  • It turns out that there is a general strategy for such games, and we can analyze the games using the nim theory.
  • Initially, we will analyze simple games where players remove sticks from heaps, and after this, we will generalize the strategy used in those games to other games.

Practice Problems on Game Theory:

Problem
Find the winner in nim-game
Game of N stones where each player can remove 1, 3 or 4
Choice of Area
Finding optimal move in Tic-Tac-Toe using Minimax Algorithm in Game Theory
Optimal Strategy for a Game
Find the player who will win by choosing a number in range [1, K] with sum total N
Optimal Strategy for the Divisor game using Dynamic Programming
Chessboard Pawn-Pawn game
Find the winner of the game with N piles of boxes
Coin game of two corners
Josephus Problem
Variation in Nim Game
Game of replacing array elements
Combinatorial Game Theory
Find winner in game of N balls, in which a player can remove any balls in range [A, B] in a single move
Find the winner of a game of removing any number of stones from the least indexed non-empty pile from given N piles
A Binary String Game
Two player game in which a player can remove all occurrences of a number
Make a palindromic string from given string
Find the player who will win the Coin game
Find the winner of the Game
Optimal Strategy for a Game
Find the winner of the Game to Win by erasing any two consecutive similar alphabets
Find the winner of a game of removing at most 3 stones from a pile in each turn
Pen Distribution Problem
Find the winner of game of repeatedly removing the first character to empty given string
Find the player who wins the game by removing the last of given N cards
Winner in the Rock-Paper-Scissor game using Bit manipulation
Optimal Strategy for a Game | Special Gold Coin
Predict the winner of the game on the basis of absolute difference of sum by selecting numbers
Find probability that a player wins when probabilities of hitting the target are given
Find winner when players remove multiples of A or B from Array in each turn
Predict the winner of a card game of removing K cards in each turn such that Bitwise AND of K and size of pile is 0
Optimal strategy for a Game with modifications
Number of ways for playing first move optimally in a NIM game
Probability of A winning the match when individual probabilities of hitting the target given
Predict the winner of the game | Sprague-Grundy
Game of Chocolates | Wythoff’s Game
Minimum operations to reduce N to a prime number by subtracting with its highest divisor
Find the winner of a game of donating i candies in every i-th move
Largest odd divisor Game to check which player wins

Similar Reads

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 3. Step 1: Find row minimum values for each row a
2 min read
Game Theory (Normal-form game) | Set 3 (Game with Mixed Strategy)
Consider the following payoff matrix with respect to player A and solve it optimally. Solution: If a game has no saddle point then the game is said to have mixed strategy. Step 1: Find out the row minimum and column maximum. Step 2: Find out the minimax and maximin values. Since minimax and maximin value of this game are not equal, this game has no
4 min read
Game Theory (Normal-form Game) | Set 7 (Graphical Method [M X 2] Game)
The payoff matrix of an M * 2 game consists of M rows and two columns. This article will discuss how to solve an M * 2 game by graphical method. Also, this article will discuss if more than two lines intersect the same point in the graph then how can a 2 * 2 payoff matrix be formed. Consider the below problem: Solution: First check whether the prob
3 min read
Game Theory (Normal-form Game) | Set 6 (Graphical Method [2 X N] Game)
The payoff matrix of a 2 * N game consists of 2 rows and N columns . This article will discuss how to solve a 2 * N game by graphical method. Consider the below 2 * 5 game: Solution: First check the saddle point of the game. This game has no saddle point. Step 1: Reduce the size of the payoff matrix by applying dominance property, if it exists. Thi
3 min read
Game Theory (Normal - form game) | Set 1 (Introduction)
Game theory is a mathematical model used for decision making. It has applications in all fields of social science, as well as in logic and computer science. Game theory has come to play an increasingly important role in logic and in computer science. To be fully defined, a game must specify the following elements: the players of the game, the infor
4 min read
Game Theory (Normal-form Game) | Set 5 (Dominance Property-Mixed Strategy)
This article discusses how to solve a game by the dominance property with mixed strategy. Consider the below game: Solution: Find out the row minimum and column maximum values. Here Minimax value is not equal to Maximin so this game has no saddle point. Now proceed with dominance property to reduce the rows and the columns. Reducing the row and the
2 min read
Combinatorial Game Theory | Set 2 (Game of Nim)
We strongly recommend to refer below article as a prerequisite of this. Combinatorial Game Theory | Set 1 (Introduction) In this post, Game of Nim is discussed. The Game of Nim is described by the following rules- “ Given a number of piles in which each pile contains some numbers of stones/coins. In each turn, a player can choose only one pile and
15+ min read
Game Theory (Normal-form Game) | Set 4 (Dominance Property-Pure Strategy)
In some of the games, it is possible to reduce the size of the payoff matrix by eliminating rows (or columns) that are dominated by other rows (or columns) respectively. Dominance property for rows: X ≤ Y i.e. if all the elements of a particular row X are less than or equal to the corresponding elements of another row Y then delete row X (row X is
4 min read
Mathematics | Graph theory practice questions
Problem 1 - There are 25 telephones in Geeksland. Is it possible to connect them with wires so that each telephone is connected with exactly 7 others. Solution - Let us suppose that such an arrangement is possible. This can be viewed as a graph in which telephones are represented using vertices and wires using the edges. Now we have 25 vertices in
4 min read
Practice Problems on Hashing
In this article, we will discuss the types of questions based on hashing. Before understanding this, you should have idea about hashing, hash function, open addressing and chaining techniques (see: Introduction, Separate chaining, Open addressing). These are some key points in hashing: The purpose of hashing is to achieve search, insert and delete
8 min read
Article Tags :
Practice Tags :
three90RightbarBannerImg