Getting --Nim game introduces game theory

To be honest, I really see this game is forced to look ignorant, because (I'm too weak) I do not understand the meaning of some variables, it has been very ignorant, but now I understand that it makes me understand game theory (also get money) is profound;

Here is how I think of myself, perhaps not rigorous, but eventually understand.

Here is a rough introduction to the game Nim, a blog entry, since better access to the SG function (because I just learned

About the Game

  Background story I will not say directly introduce rules of the game.

  N-stack articles, there $ a_ {i} $ th items, each player can optionally two pick an arbitrary integer number of pile articles (End can take the whole stack), but can not take, each of the last stack is removed items for the winner.

  This game has a long history, it has been used to gamble, but to be a mathematician to solve binary, got the upper hand and win the upper hand losing theory, then this game will be the GG;

Game routine

  If there are 3 stack items, they are the number 6, 4, then the two players to choose the best strategy, then flip the upper hand wins or wins? (Example (a surprising blue))

  The answer is flip wins. (This can push their own)

  A concept introduced here: a game directed graph;

  Directed graph game

    We define the initial state of a game as a starting point, all states can reach even to the edge, by constantly extending down, get win points (this point is to be the case of victory) and losing points (this is actually my own understanding)

  Consider the $ 6, 4} $ {this collection as a starting point, then double-edge to all states; it is clear that too many states, we can not enumerate;

  Consider endpoint must be $ $ {0,0,0}, then a set of exclusive-OR 0 and clearly.

  Then we define the remaining number of each stack is $ A_ {i} $, by inference we can get: The initial state is set and losing the exclusive OR is 0, and vice versa win.

  Why do you get to this conclusion?

Thinking Games

  Consider the beginning of a set of numbers into binary, that is, $ {} $ 110,100,010, the last state had been replaced by a binary, I do not write out.

  We pushed backwards, XOR and the final solution is zero, then there must be transferred from the state 0 from XOR and non.

  prove

    If the $ A_ {1} Xor A_ {2} Xor A_ {3} ... Xor A_ {i} ... Xor A_ {n} = 0 $, then where $ A_ {i} $ from $ A_ {i } ^ { '} $ transferred from the assumed $ A_ {1} Xor A_ {2} Xor A_ {3} ... Xor A_ {i} ^ {'} ... Xor A_ {n} = 0 $,

    The exclusive-OR operation to give, $ A_ {i} = A_ {i} ^ { '} $, according to the rules of the game, each player is bound to take at least one item, conflict rules, assumption is not established conclusion.

  So consider such a strategy if we are at the beginning of XOR and not 0, then we turn to the opponent when the strategy is to let him get $ A_ {1} Xor A_ {2} Xor A_ {3} ... Xor A_ {i} ... Xor A_ {n} = 0 $.

  So losing node to the other man must, we need to prove what we will be able to implement this strategy

  prove

    Assuming that the collection and XOR is x, this time the maximum number of $ A_ {i} $, then we can make $ A_ {i} $ becomes $ A_ {i} Xor x $, XOR and so on but also for 0 a.

    Obviously, $ A_ {i}> A_ {i} Xor x $, so we can make $ A_ {i} $ becomes $ A {i} Xor can, then we can achieve this strategy.

  But XOR is zero, and the other can in turn use this strategy if we begin, let us into the scene doomed to failure.

  Conclusion again re-emphasized: the initial set of states and the exclusive OR losing 0, and vice versa for the win.

  (More than prove himself a similar simple dictation, did not follow the strict proof format, like him to understand)

Reflection game

  We learn that way of thinking, not just conclusion, we reflect on what we do

  1. First, the analysis model, a collection of summarized each case, to construct a view of a game;

  2. Transfer the way we think about each point. And analyzes the characteristics of losing points, find some special metastasis.

  3. We think a more in-depth transfer scenarios and prove the correctness of the policy.

  4. The algorithm (not assumed here);

  According to this thinking, maybe in the future will be helpful, SG Mex function and operation will be talked about after (the bloggers are struggling to learn T_T)

Guess you like

Origin www.cnblogs.com/waterflower/p/11366144.html
Recommended