Skip to content
geeksforgeeks
  • Courses
    • DSA to Development
    • Get IBM Certification
    • Newly Launched!
      • Master Django Framework
      • Become AWS Certified
    • For Working Professionals
      • Interview 101: DSA & System Design
      • Data Science Training Program
      • JAVA Backend Development (Live)
      • DevOps Engineering (LIVE)
      • Data Structures & Algorithms in Python
    • For Students
      • Placement Preparation Course
      • Data Science (Live)
      • Data Structure & Algorithm-Self Paced (C++/JAVA)
      • Master Competitive Programming (Live)
      • Full Stack Development with React & Node JS (Live)
    • Full Stack Development
    • Data Science Program
    • All Courses
  • Tutorials
    • Data Structures & Algorithms
    • ML & Data Science
    • Interview Corner
    • Programming Languages
    • Web Development
    • CS Subjects
    • DevOps And Linux
    • School Learning
  • Practice
    • Build your AI Agent
    • GfG 160
    • Problem of the Day
    • Practice Coding Problems
    • GfG SDE Sheet
  • Contests
    • Accenture Hackathon (Ending Soon!)
    • GfG Weekly [Rated Contest]
    • Job-A-Thon Hiring Challenge
    • All Contests and Events
  • DSA
  • Practice Game Theory
  • Game Theory in DSA
  • Nash Equilibrium
  • Normal form games
  • Minimax Algorithm
  • Impartial games
  • Combinatorial Game Theory
  • Nim Game
  • Grundy Numbers
  • Sprague Grundy Theorem
  • Minimax Algo
  • Alpha Beta Pruning
  • Zorbist Hashing
  • Coin Game
  • DP in Game Theory
  • Problems on Game Theory for CP
Open In App
Next Article:
Interactive Problems in Competitive Programming
Next article icon

Practice Problems on Game Theory

Last Updated : 28 Sep, 2023
Comments
Improve
Suggest changes
Like Article
Like
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

Next Article
Interactive Problems in Competitive Programming

A

anilkumarsingh0160
Improve
Article Tags :
  • Game Theory
  • DSA
Practice Tags :
  • Game Theory

Similar Reads

  • 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
  • Interactive Problems in Competitive Programming
    Interactive Problems are those problems in which our solution or code interacts with the judge in real time. When we develop a solution for an Interactive Problem then the input data given to our solution may not be predetermined but is built for that problem specifically. The solution performs a se
    6 min read
  • Some Tricks to solve problems on Impartial games
    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 'Impart
    4 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 foll
    4 min read
  • Organizing Tournament Problem
    Given a positive integer N representing the count of players playing the game. The game is played between two teams such that each team consists of at least one player but the total count of players in the game must be N. The game lasts in exactly 30 minutes, the task is to check if all players will
    8 min read
  • 21 Matchsticks Problem
    Given 21 Matchsticks and 2 users, A and B (computer and user respectively). Users can pick matchsticks not more than four at a time. The one who is forced to pick the last matchstick loses. Given an array arr[] which contains the moves of the computer. The task is to print the moves of the user so t
    4 min read
  • 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
    15+ min read
  • Game of Matchsticks
    Two friends, A and B, are playing the game of matchsticks. In this game, a group of N matchsticks is placed on the table. The players can pick any number of matchsticks from 1 to 4 (both inclusive) during their chance. The player who takes the last match stick wins the game. If A starts first, how m
    6 min read
  • Combinatorial Game Theory | Set 4 (Sprague - Grundy Theorem)
    Prerequisites : Grundy Numbers/Numbers and MexWe have already seen in Set 2 (https://cdn.geeksforgeeks.org/combinatorial-game-theory-set-2-game-nim/), 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
    15 min read
  • 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, Backgammon, Mancala, Chess, etc.In Minimax the tw
    9 min read
geeksforgeeks-footer-logo
Corporate & Communications Address:
A-143, 7th Floor, Sovereign Corporate Tower, Sector- 136, Noida, Uttar Pradesh (201305)
Registered Address:
K 061, Tower K, Gulshan Vivante Apartment, Sector 137, Noida, Gautam Buddh Nagar, Uttar Pradesh, 201305
GFG App on Play Store GFG App on App Store
Advertise with us
  • Company
  • About Us
  • Legal
  • Privacy Policy
  • In Media
  • Contact Us
  • Advertise with us
  • GFG Corporate Solution
  • Placement Training Program
  • Languages
  • Python
  • Java
  • C++
  • PHP
  • GoLang
  • SQL
  • R Language
  • Android Tutorial
  • Tutorials Archive
  • DSA
  • Data Structures
  • Algorithms
  • DSA for Beginners
  • Basic DSA Problems
  • DSA Roadmap
  • Top 100 DSA Interview Problems
  • DSA Roadmap by Sandeep Jain
  • All Cheat Sheets
  • Data Science & ML
  • Data Science With Python
  • Data Science For Beginner
  • Machine Learning
  • ML Maths
  • Data Visualisation
  • Pandas
  • NumPy
  • NLP
  • Deep Learning
  • Web Technologies
  • HTML
  • CSS
  • JavaScript
  • TypeScript
  • ReactJS
  • NextJS
  • Bootstrap
  • Web Design
  • Python Tutorial
  • Python Programming Examples
  • Python Projects
  • Python Tkinter
  • Python Web Scraping
  • OpenCV Tutorial
  • Python Interview Question
  • Django
  • Computer Science
  • Operating Systems
  • Computer Network
  • Database Management System
  • Software Engineering
  • Digital Logic Design
  • Engineering Maths
  • Software Development
  • Software Testing
  • DevOps
  • Git
  • Linux
  • AWS
  • Docker
  • Kubernetes
  • Azure
  • GCP
  • DevOps Roadmap
  • System Design
  • High Level Design
  • Low Level Design
  • UML Diagrams
  • Interview Guide
  • Design Patterns
  • OOAD
  • System Design Bootcamp
  • Interview Questions
  • Inteview Preparation
  • Competitive Programming
  • Top DS or Algo for CP
  • Company-Wise Recruitment Process
  • Company-Wise Preparation
  • Aptitude Preparation
  • Puzzles
  • School Subjects
  • Mathematics
  • Physics
  • Chemistry
  • Biology
  • Social Science
  • English Grammar
  • Commerce
  • World GK
  • GeeksforGeeks Videos
  • DSA
  • Python
  • Java
  • C++
  • Web Development
  • Data Science
  • CS Subjects
@GeeksforGeeks, Sanchhaya Education Private Limited, All rights reserved
We use cookies to ensure you have the best browsing experience on our website. By using our site, you acknowledge that you have read and understood our Cookie Policy & Privacy Policy
Lightbox
Improvement
Suggest Changes
Help us improve. Share your suggestions to enhance the article. Contribute your expertise and make a difference in the GeeksforGeeks portal.
geeksforgeeks-suggest-icon
Create Improvement
Enhance the article with your expertise. Contribute to the GeeksforGeeks community and help create better learning resources for all.
geeksforgeeks-improvement-icon
Suggest Changes
min 4 words, max Words Limit:1000

Thank You!

Your suggestions are valuable to us.

What kind of Experience do you want to share?

Interview Experiences
Admission Experiences
Career Journeys
Work Experiences
Campus Experiences
Competitive Exam Experiences