[Original blog] combined game learning

Source: Internet
Author: User

I read "from perceptual knowledge, rational understanding-the answer process of a kind of Combat Games", "Analysis of a kind of combined game", and "A summary of combined game-some extensions and variants of SG Games ". three papers, I have a deeper understanding of combined games and SG functions. This article took off some of the important content of the three papers and some of my understanding of combined games.

Terms and conventions:
  • Games: The Games here refer to not the usual games (dota2 or something), but only the "Puzzle" Combination games such as Nim taking stones. In addition, we are not concerned with the gaming performance, but whether the game has a winning strategy. The following is a detailed description.
  • Status: a game in progress, represented by numbers.
  • Winning status: there is a way to go to a losing status.
  • Failed status: the successor status is a winning status.

* In a combination game, a single State is either a winning or a losing state.

A combined game is a game of the following nature:

  1. The game has only two participants.
  2. The game is in a definite State at any time.
  3. The rule specifies a set of statuses that any State participant can reach.
  4. Participants take turns.
  5. When the game is in a certain state and the current participant cannot perform operations, the game ends. In this case, the rule determines the outcome.
  6. No matter what the participants do, the game can end in a limited number of steps (no draw ).
  7. Information is fair and transparent to both participants.

* We also assume that all participants are smart enough to follow a winning strategy.

Several gamesGame 0:

There are a pile of stones, and the first and second members take turns to get them. They can't take them, but they can't take them. When it's their turn to get one person, they lose.
Obviously, this game can be completed as long as there are stones, and the second time another person will not be able to get them.
Therefore, in this game, {0} is in a bid, and others are in a bid.

Game 1:

There are two piles of stones, and a and B take turns to take them. Each time they can only get one heap of stones, they can't but get them. At most, they can get one heap. When it's their turn to get one person, they lose.
This game is equivalent to the "and" of the first two games ". We can easily find that if the number of stones in the two stacks is the same, the first hand will be defeated, because no matter how the first hand gets the stones, the latter hand can use the same policy in the other stack, I know that the forehand has no stone to fetch. When the number of stones in the two piles is different, the first hand will win, and the first hand will take a pile of stones in the same way.

Game 2:

A and B face several stones, and the number of each pile of stones can be determined at will. Each step should take at least one stone, each step can only take part or all of the stones from a pile. If no one can take the child according to the rules, the loser will be.
This game looks more complicated. Now we need to introduce a powerful tool calledSG FunctionAndSG Theorem.

SG Function:

  • The final State X of a game is SG (x) = 0.
  • SG (x) = min (N | nε N and N in other States X! = SG (f (x )))

F (x) indicates any State in which State X can be transferred.
* The second formula also writes SG (x) = Mex {SG (f (x ))}
The nature of the SG function: All SG (x) = 0 states are defeated, all SG (x )! If it is set to 0, it is always in the winning state.

SG theorem: the SG values of game States composed of several single combined games are the XOR and.
* For proof, see the thesis.
Then, when game 0 has x stones, SG (x) = x, so find the XOR and of the following states to get the SG value of the entire state.

Game 3:

Both parties agree on a Number m in advance, and the number of stones each time cannot exceed M. The remaining rules are the same as Game 2.
Set only one heap and M = 3:
SG (0) = 0, SG (1) = 1, SG (2) = 2, SG (3) = 3, SG (4) = 0, SG (5) = 1...
So SG (x) = x Mod (m + 1 ).
Find the SG value of the entire status to determine.

Game 4:

A and B face several stones, and the number of stones in each row can be determined at will. The two take some stones in turn, and each step must be taken from a certain row.TwoStone, and the two stones must be tightly tied. After they are taken away, the row will break into two rows. If no one can obtain the child according to the rule, the loser is the loser.(Use your imagination)
This question does not look as bare as the previous ones. However, it is similar to the previous questions and can be solved using SG.
It's just not that obvious. From SG (0) = 0, SG (1) = 0, start enumeration of potentially transferred states to calculate the SG function, and the program can perform a memory-based search.

There are still many problems with the combination of Games. The theorem is just the most basic entry and requires further study.

In the process of understanding things, people start to see the phenomena of things. This is the perceptual stage of cognition. At this stage, we cannot draw a logical conclusion. With the deepening of research, these feelings and impressions have been repeated many times, so people have a sudden change in the process of understanding in their minds, and finally come to a logical conclusion. This is the rational stage of understanding.
This is the key to increasing perceptual knowledge to rational understanding. (Abstract)
* This article lacks some proofs. For details, refer to the original paper.

[Original blog] combined game learning

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.