Tree Data Structures & Minimax Algorithm for Games

Click For Summary

Discussion Overview

The discussion revolves around the application of tree data structures and the minimax algorithm in the context of a game involving sticks. Participants explore the conditions under which players can win and the implications of optimal play.

Discussion Character

  • Homework-related, Conceptual clarification, Debate/contested

Main Points Raised

  • One participant suggests that if both players play optimally, the game will end in a draw, but questions the validity of this claim.
  • Another participant challenges the idea of a draw, stating that the player who removes the last match wins, except in a specific case where only one match remains.
  • A third participant acknowledges a misunderstanding and reflects on the strategy of analyzing the game by working backwards from the end situation, noting that player 2 can always aim for multiples of 5.
  • It is proposed that the starting player has a disadvantage unless the number of sticks is a multiple of 5 plus 2 or 3.

Areas of Agreement / Disagreement

Participants express disagreement regarding the possibility of a draw in the game, with some asserting it cannot happen while others suggest it might under certain conditions. The discussion remains unresolved on the winning strategies and conditions for both players.

Contextual Notes

There are limitations in the understanding of game outcomes based on the number of sticks, and the implications of optimal play are not fully explored. The discussion also reflects varying interpretations of game rules and strategies.

wololo
Messages
27
Reaction score
0

Homework Statement


Capture.PNG


Homework Equations


Tree data structures.
I think it might also have something to do with minimax algorithm, but it was only mentioned once and never discussed extensively in class so I doubt it is required.

The Attempt at a Solution


[/B]
If both players play as well as they can, the game will end in a draw. Player 1 will always have the option of choosing to draw rather than lose.
Capture.PNG

However I can't find a function that given n sticks will tell me who will win. For 5, 10 and other multiples of 5, player 2 necessarily wins but what about the other cases? How can I find a single formula that will necessarily tell me who will win, given that they play well?
 
Physics news on Phys.org
Misunderstanding: you can't end in a draw.
 
BvU said:
Misunderstanding: you can't end in a draw.
"The player who removes the last match wins, except if there is only one match left, in which case the game is a draw." All the paths that end in 1 in the game tree are draws.
 
Oops, sloppy reading... o:)
I remember something about analyzing games like this: start from the end situation and work backwards...
Your "multiples of 5" points that way. So player 2 will always work towards multiples of 5. So will 1. That way you have pinned down "playing well". Apparently you really want the other to start when playing this game, unless n is a multiple of 5 plus 2 or 3.
 

Similar threads

  • · Replies 7 ·
Replies
7
Views
2K
  • · Replies 9 ·
Replies
9
Views
5K
Replies
29
Views
5K
  • · Replies 3 ·
Replies
3
Views
3K
Replies
12
Views
2K
  • · Replies 195 ·
7
Replies
195
Views
24K
  • · Replies 6 ·
Replies
6
Views
5K
  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 2 ·
Replies
2
Views
3K
Replies
9
Views
3K