1 / 15

Sum Games - The MEX Function

Sum Games - The MEX Function. AE1APS Algorithmic Problem Solving John Drake. Notice. Coursework 3 due on Thursday at 1pm (i.e. before the start of the tutorial). Submit either hard-copy (including name/student number), or e-mail soft-copy to me.

denise
Download Presentation

Sum Games - The MEX Function

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Sum Games -The MEX Function AE1APS Algorithmic Problem Solving John Drake

  2. Notice • Coursework 3 due on Thursday at 1pm • (i.e. before the start of the tutorial). • Submit either hard-copy (including name/student number), or e-mail soft-copy to me. • Normal university regulations apply to late submissions • Please let me know if you have any problems! • Office SEB325 • John.drake@nottingham.edu.cn

  3. Consider the sum of two games

  4. Symmetry in sum games • The position in a given sum game is (l, r). • A move affects one component (i.e one game) • An assignment can either be l := l’ or r :=r’ • (i.e. the left or right component is affected) • Define two functions L and R on the left and right positions such that; (l, r) is a losing position exactly when L(l) = R(r)

  5. Analysis • L and R must have equal values on end positions • All moves from a losing position should result in a winning position satisfying L(l) != R(r) • Applying the winning strategy from a winning position, should result in a losing position

  6. Analysis • We require that: • For end positions L(l) = R(r) = 0 • For every l’ such that there is a move from l to l’ - L(l) != L(l’) • For any number m < R(r), it is possible to move from r to r’ such that R(r’) = m (similar for left).

  7. Mex Function • Fortunately for us such a function exists  • The MEX function, short for “minimal excludant”, satisfies these conditions and is therefore used as the functions L and R

  8. Definition of Mex Function • Let p be a position in a game. The mex value of p (mex(p)), is defined as the smallest natural number, n, such that • There is no move in the game from p to position q satisfying mex(q) = n • For m < n, there is a move from p to q satisfying mex(q)= m. • This is a recursive definition.

  9. Definition of Mex Function • Informally, mex(p) is the minimum number that is excluded from the mex numbers of positions q to which a move can be made from p (i.e. q is a successor of p).

  10. Using the MEX function • The graphs do not have regular structure, so the mex numbers must be calculated by hand • End positions have a mex number of 0 • A mex number can be give to a node when all its successors have been assigned a mexnumber • The number is the smallest number that is not included in the mex numbers of its successors

  11. Calculating the Mex Function

  12. Calculating the Mex Function

  13. Playing the game • Suppose we start with “ok” (o,k) as our position • This is a winning position because the mex numbers are different • The winning strategy is to move the right graph to node i which has the same mex number as “O” i.e. we are restoring the balance (R(r ) = L(l)) • The opponent will then disrupt the balance (making this an inequality) • The first player the repeats the strategy of making the mex numbers equal, moving in the game with the highest mex number, until the opponent can move no further

  14. Lack of Structure • Note that due to the lack of structure, the mex number of the 15 left and 11 right positions were calculated individually • In total we only did 15+11 (=24) calculations, and not 15*11 (=165) calculations 

  15. Past Exam Question – 2011/12 a) (20) (15) b) b)

More Related