Puzzles where both players play optimally

  • Context: Undergrad 
  • Thread starter Thread starter Avichal
  • Start date Start date
Click For Summary
SUMMARY

The discussion focuses on optimal strategies for two-player games involving number manipulation and stone piles. In the first puzzle, Alice and Bob play with a number N, where the player who cannot make a move loses. The analysis concludes that if N is even, Alice wins; if N is odd, Bob wins. The second puzzle involves N piles of stones, where players remove stones based on specific rules. The outcome depends on the configuration of the piles and the ability to force the opponent into a losing position.

PREREQUISITES
  • Understanding of game theory principles
  • Knowledge of proper divisors in mathematics
  • Familiarity with optimal play strategies in two-player games
  • Basic combinatorial game theory concepts
NEXT STEPS
  • Study the Sprague-Grundy theorem for combinatorial games
  • Learn about Nim games and their strategies
  • Explore the concept of winning and losing positions in game theory
  • Investigate algorithms for determining optimal moves in two-player games
USEFUL FOR

Game theorists, competitive programmers, and anyone interested in strategic decision-making in two-player games will benefit from this discussion.

Avichal
Messages
294
Reaction score
0
Puzzles like the following(they are actually programming questions) :-
codechef said:
Alice and Bob play the following game. They choose a number N to play with. The rules are as follows :
1) Alice plays first, and the two players alternate.
2) In his/her turn, a player can subtract from N any proper divisor (not equal to N) of N. The number thus obtained is the new N.
3) The person who cannot make a move in his/her turn loses the game.
Assuming both play optimally, who wins the game ?

codechef said:
Alice and Bob play the following game : There are N piles of stones with Si stones in the ith pile. Piles are numbered from 1 to N. Alice and Bob play alternately, with Alice starting. In a turn, the player chooses any pile i which has at least i stones in it, and removes exactly i stones from it. The game ends when there is no such pile. The player who plays last wins the game. Assuming Alice and Bob play optimally, who will win the game?

How do you solve such puzzles?
Since they say that both play optimally does that mean given the conditions in the game(here let's say number N is given) we already know who will be the winner?
 
Mathematics news on Phys.org
Playing optimally means that both players will have insight into all possible next moves and will play in such a way to maximize their chance of winning without making a mistake. However, if all moves lead to the other player winning, then this player still has to play, and any move would be equivalent.

In the first puzzle, a player loses when their number is 1. This means that the player at 2 can force their opponent to lose by subtracting 1, and a player at 3 will lose since they can only subtract 1. Similarly, a player at 4 can win by subtracting 1, and a player at 5 will lose.

Note that all odd numbers only have odd factors, so a player at an odd number can only get to an even number since he or she can only subtract an odd number from odd. A player at an even number can then subtract 1 to force the opponent to get to an odd number.

Thus if the game begins on an even number, Alice wins. If the game begins on an odd number, Bob wins.
 

Similar threads

  • · Replies 1 ·
Replies
1
Views
8K
  • · Replies 7 ·
Replies
7
Views
3K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 7 ·
Replies
7
Views
2K
  • · Replies 4 ·
Replies
4
Views
3K
Replies
29
Views
5K
  • · Replies 29 ·
Replies
29
Views
7K