Answers to: Help about game theory.https://discuss.codechef.com/questions/139547/help-about-game-theory<p>Whenever the contest starts with a question including "Alice" and "Bob" with a easy game theory, people get AC's. <br>
I get lot of penalities (6-9) also I take about hours to get logic and get frustrated by looking at ranklist and criticize codechef in my mind about keeping them(Alice and Bob XD) in question (which I know I shouldn't do). </p>
<h1>How can I improve in solving such problems ?</h1>
<p>Obviously, many people will say "practice".<br>
But anything else that you would like to add ? </p>
<h1>And where can I practice these questions ?</h1>
<p>I mean can you provide some links where I can find such questions ?</p>enTue, 13 Nov 2018 17:46:28 +0530Answer by yugandhar_thttps://discuss.codechef.com/questions/139547/help-about-game-theory/140224<p>Here's a link: <a href="http://gen.lib.rus.ec/book/index.php?md5=6ae652504c3278b5f5b9ab0896aa1cb3">http://gen.lib.rus.ec/book/index.php?md5=6ae652504c3278b5f5b9ab0896aa1cb3</a></p>yugandhar_tTue, 13 Nov 2018 17:46:28 +0530https://discuss.codechef.com/questions/139547/help-about-game-theory/140224Answer by lakshay_nasahttps://discuss.codechef.com/questions/139547/help-about-game-theory/140218<p>Please provide a link for the pdf of 'Mathematical Circles' if you have got it.</p>lakshay_nasaTue, 13 Nov 2018 17:32:22 +0530https://discuss.codechef.com/questions/139547/help-about-game-theory/140218Answer by akashbhalotiahttps://discuss.codechef.com/questions/139547/help-about-game-theory/140017<p>There is a book called 'Mathematical Circles.' It's a pretty famous book. I used to practice Game Theory problems from it and it helped improve my logic for Game Theory a lot. I'm sure some online pdf of it too might be available.</p>akashbhalotiaSun, 11 Nov 2018 02:24:43 +0530https://discuss.codechef.com/questions/139547/help-about-game-theory/140017Answer by vijju123https://discuss.codechef.com/questions/139547/help-about-game-theory/139574<p>Did you read my editorial on game theory in September long (TABGAME)? It discussed a general way to tackle these problems in the first note on game theory and Chef Vijju's corner point 2. </p>
<p>Since my below part is based on that, let me copy it for those who didnt-</p>
<div class="hidden-block"> <div class="hide-bar view">View Content</div> <div class="hide-bar hide" style="display:none;">Hide Content</div> <div class="hidden-content" style="display:none;">
<p><strong>"First player is starting from $(x,y)$. A cell is marked $W$ if a player starting from that cell (or who has his turn when stone is on that cell) wins. A cell is marked $L$ if he loses if he has to make a move from that cell.</strong> </p>
<p><strong>Now, assume we already found out which of previous cells (or cells which we might visit in our moves) are $W$ or $L$. If all the cells to which I can move to (from current cell) are $W$, then that means that my opponent will win (because a cell is $W$ if player who gets to make a turn when stone is on that cell wins). This means, I will lose no matter what, as irrespective of <em>how I move, there is a winning strategy possible for my opponent.</em> What if all are not $W$, i.e. I can move to a cell labelled $L$? It means my opponent cannot win no matter what if stone is at that cell when he gets his turn. Now, obviously, I will move the stone to that $L$ labelled cell to win as I move optimally."</strong></p>
<p><strong>At the end of the day, I'd want you to remember the part of $W$ and $L$ which we discussed. You can apply that to any such game. If starting position determines winner, and you know the state of positions which you can visit from current cell, you can derive for this cell as well. A player wins only if he can force his opponent to lose by making sure opponent plays only at "losing" or $L$ cells. Hopefully this will clear the numerous doubts among div2 guys on what "playing optimally" is :)</strong></p>
</div></div>
<p>Now, onto technical stuff.</p>
<ul>
<li>Harder Game-Theory problems are hard, and require knowledge of sprungy number. A case in point is Pishty and Birthday from last year's long. </li>
<li>For cakewalk and easy level game theory, its all about observations.</li>
<li>By observations, I mean, either you discover the optimal strategy followed by them, or you reduce the game into some standard game (like game of NIM) and apply the knowledge we have of these standard games.</li>
<li>Hence, little knowledge of grundy numbers and such games always helps.</li>
<li>In the question in point, for Alice and Bob (XD), we can go this way.Now since player who cannot make a move loses, and Alice and Bob play optimally, i.e. they dont want to lose, and Charlie (the guy who swaps table) is biased to make Alice win, can we define optimal play?</li>
<li>If the sum of stones in piles are unequal, then Charlie can swap Alice to table with larger piles. Now, Alice removes only 1 stone per turn, and wins, no matter what Bob does.</li>
<li>If sums are equal, and the piles Alice and Bob have are "same". By "same" I mean, they are such that Bob can always mirror or copy the move done by Alice. In this case, table swap has no effect and Bob wins.</li>
<li>If this is not so, then there will be a time when Bob wont be able to copy Alice's move. Hence, the piles will have unequal sums. We know in this case Alice wins because of Charlie.</li>
<li>Similar methods to solve practice questions will sharpen your intuition for it. :)</li>
</ul>vijju123Sun, 04 Nov 2018 16:40:10 +0530https://discuss.codechef.com/questions/139547/help-about-game-theory/139574Answer by ashokshaunhttps://discuss.codechef.com/questions/139547/help-about-game-theory/139568<p><a href="https://www.hackerrank.com/contests/5-days-of-game-theory/challenges/">https://www.hackerrank.com/contests/5-days-of-game-theory/challenges/</a> </p>
<p>hope this helps brother..</p>ashokshaunSun, 04 Nov 2018 14:59:46 +0530https://discuss.codechef.com/questions/139547/help-about-game-theory/139568