Lecture_Feb8

Lecture_Feb8 - 9. The Sprague-Grundy Function. Definition....

Info iconThis preview shows pages 1–8. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: 9. The Sprague-Grundy Function. Definition. The Sprague-Grundy function of a graph, (X,F), is a function, g, defined on X and taking non-negative integer values, such that g(x) =min{ n ≥ 0 : n ≠ g(y) for y ∈ F(x)}. (1) In words, g(x) the smallest non-negative integer not found among the Sprague-Grundy values of the followers of x. If we define the minimal excludant , or mex , of a set of non-negative integers as the smallest non-negative integer not in the set, then we may write simply g(x) =mex{ g(y) : y ∈ F(x)} Note that g(x) is defined recursively. That is, g(x) is defined in terms of g(y) for all followers y of x. Moreover, the recursion is self-starting. For terminal vertices, x, the definition implies that g(x) = 0, since F(x) is the empty set for terminal x. Positions x for which g(x) = 0 are P-positions and all other positions are N-positions. The winning procedure is to choose at each move to move to a vertex with Sprague- Grundy value zero. (1) If x is a terminal position, g(x) = 0. (2) At positions x for which g(x) = 0, every follower y of x is such that g(y) ≠ 0, and (3) At positions x for which g(x) ≠ 0, there is at least one follower y such that g(y) = 0. Example: Subtraction Game S= {1, 2, 3}? The terminal vertex, 0, has SG- value 0. The vertex 1 can only be moved to 0 and g(0) = 0, so g(1) = 1. Similarly, 2 can move to 0 and 1 with g(0) = 0 and g(1) = 1, so g(2) = 2, and 3 can move to 0, 1 and 2, with g(0) = 0, g(1) = 1 and g(2) = 2, so g(3) = 3. But 4 can only move to 1, 2 and 3 with SG-values 1, 2 and 3, so g(4) = 0. Continuing in this way we see x 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14. . . g(x) 0 1 2 3 0 1 2 3 0 1 2 3 0 1 2. . . In general g(x) = x (mod 4), i.e. g(x) is the remainder when x is divided by 4. Example: At-Least-Half. Consider the one-pile game with the rule that you must remove at least half of the counters. The only terminal position is zero. We may compute the Sprague-Grundy function inductively as x 0 1 2 3 4 5 6 7 8 9 10 11 12 . . ....
View Full Document

Page1 / 23

Lecture_Feb8 - 9. The Sprague-Grundy Function. Definition....

This preview shows document pages 1 - 8. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online