Category Archives: Game Theory

Algorithms based on Game Theory

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 charge. Simultaneously, the prosecutors… Read More »

Choice of Area

Consider a game, in which you have two types of powers, A and B and there are 3 types of Areas X, Y and Z. Every second you have to switch between these areas, each area has specific properties by which your power A and power B increase or decrease. We need to keep choosing… Read More »

Minimax Algorithm in Game Theory | Set 5 (Zobrist Hashing)

Previous posts on this topic : Minimax Algorithm in Game Theory, Evaluation Function in Game Theory, Tic-Tac-Toe AI – Finding optimal move, Alpha-Beta Pruning. Zobrist Hashing is a hashing function that is widely used in 2 player board games. It is the most common hashing function used in transposition table. Transposition tables basically store the… Read More »

Minimax Algorithm in Game Theory | Set 4 (Alpha-Beta Pruning)

Prerequisites: Minimax Algorithm in Game Theory, Evaluation Function in Game Theory Alpha-Beta pruning is not actually a new algorithm, rather an optimization technique for minimax algorithm. It reduces the computation time by a huge factor. This allows us to search much faster and even go into deeper levels in the game tree. It cuts off… Read More »

Implementation of Tic-Tac-Toe game

Rules of the Game The game is to be played between two people (in this program between HUMAN and COMPUTER). One of the player chooses ‘O’ and the other ‘X’ to mark their respective cells. The game starts with one of the players and the game ends when one of the players has one whole… Read More »

Minimax Algorithm in Game Theory | Set 1 (Introduction)

Minimax is a kind of backtracking algorithm that is used in decision making and game theory to find the optimal move for a player, assuming that your opponent also plays optimally. It is widely used in two player turn based games such as Tic-Tac-Toe, Backgamon, Mancala, Chess, etc. In Minimax the two players are called… Read More »

Combinatorial Game Theory | Set 4 (Sprague – Grundy Theorem)

Prerequisites : Grundy Numbers/Nimbers and Mex We have already seen in Set 2 (, that we can find who wins in a game of Nim without actually playing the game. Suppose we change the classic Nim game a bit. This time each player can only remove 1, 2 or 3 stones only (and not any… Read More »

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,… Read More »