Skip to content

"Game Theory - F question"#20

Open
ArihantGarg wants to merge 1 commit intoy23-24from
ArihantGarg-MiniGame
Open

"Game Theory - F question"#20
ArihantGarg wants to merge 1 commit intoy23-24from
ArihantGarg-MiniGame

Conversation

@ArihantGarg
Copy link

I observed that that the sequence of players repeats after every 6 moves . Hence we can convert this into a Grundy game with 6*n states ( 6 states for each vertex in the graph) .

Then I set all vertices with no outgoing edges as Losing States for the team of the player who has to move on that turn.

Now using these as the base states , I built the other states based on 4 cases : -

  1. Current player on this node has an edge to a vertex with his team winning and he is not a joker. In this case this node is also winning for his team.

  2. Current player on this node has an edge to a vertex with opposite team winning and he is a joker. In this case this node is losing for his team.

  3. Current player on this node has all adjacent vertices with opposite team winning . In this case this node is losing for his team.

  4. Current player on this node has all adjacent vertices with his team winning . In this case this node is winning for his team.

After evaluating this, we will have some nodes winning , some nodes losing , and the remaining nodes will be draws.

@sg60692
Copy link
Contributor

sg60692 commented Sep 26, 2023

The code seems well implemented. However, as this is the first game theory question it would be a good exercise to add a proof as well of why the algorithm works in the first place.

@ArihantGarg
Copy link
Author

Should I add the proof to the repository , or just in the pull request?

@sg60692
Copy link
Contributor

sg60692 commented Sep 26, 2023

In the pr description itself

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants