{
  "index": "1995-B-5",
  "type": "COMB",
  "tag": [
    "COMB",
    "ALG"
  ],
  "difficulty": "",
  "question": "and 6 beans. The two players move alternately. A move consists of\ntaking \\textbf{either}\n\\begin{itemize}\n\\item[a)] one bean from a heap, provided at least two beans are\nleft behind in that heap, \\textbf{or}\n\n\\item[b)] a complete heap of two or three beans.\n\\end{itemize}\nThe player who takes the last heap wins. To win the game, do you\nwant to move first or second? Give a winning strategy.",
  "solution": "This problem is dumb if you know the Sprague-Grundy theory of normal\nimpartial games (see Conway, Berlekamp and Guy, {\\it Winning Ways},\nfor details). I'll describe how it applies here. To each position you\nassign a {\\em nim-value} as follows. A position with no moves (in\nwhich case the person to move has just lost) takes value 0. Any other\nposition is assigned the smallest number not assigned to a valid move\nfrom that position.\n\nFor a single pile, one sees that an empty pile has value 0, a pile of\n2 has value 1, a pile of 3 has value 2, a pile of 4 has value 0, a\npile of 5 has value 1, and a pile of 6 has value 0.\n\nYou add piles just like in standard Nim: the nim-value of the\ncomposite of two games (where at every turn you pick a game and make\na move there) is the ``base 2 addition without carries'' (i.e.\\\nexclusive OR) of the nim-values of the constituents. So our starting\nposition, with piles of 3, 4, 5, 6, has nim-value $2 \\oplus 0 \\oplus\n1 \\oplus 0 = 3$.\n\nA position is a win for the player to move if and only if it has a\nnonzero value, in which case the winning strategy is to always move to\na 0 position. (This is always possible from a nonzero position and\nnever from a zero position, which is precisely the condition that\ndefines the set of winning positions.) In this case, the winning move\nis to reduce the pile of 3 down to 2, and you can easily describe the\nentire strategy if you so desire.",
  "vars": [
    "n"
  ],
  "params": [
    "a",
    "F",
    "Y",
    "l",
    "b",
    "s",
    "C",
    "B",
    "h",
    "t",
    "S",
    "r",
    "o",
    "p",
    "N",
    "v",
    "f",
    "w",
    "O",
    "m",
    "u",
    "j",
    "I",
    "c",
    "k",
    "A",
    "y",
    "g",
    "z",
    "d",
    "T",
    "G",
    "W",
    "R",
    "x"
  ],
  "sci_consts": [
    "i",
    "e"
  ],
  "variants": {
    "descriptive_long": {
      "map": {
        "n": "countsize",
        "a": "alphaparam",
        "F": "forceconst",
        "Y": "yieldconst",
        "l": "lengthvar",
        "b": "betaparam",
        "s": "scaleparm",
        "C": "capacity",
        "B": "baseline",
        "h": "heightpar",
        "t": "timeparm",
        "S": "shiftparm",
        "r": "radiuspar",
        "o": "offsetpar",
        "p": "pressure",
        "N": "normalvec",
        "v": "velocity",
        "f": "frequency",
        "w": "widthpar",
        "O": "originpt",
        "m": "massparm",
        "u": "uplimit",
        "j": "jerkparm",
        "I": "inertia",
        "c": "costparm",
        "k": "springk",
        "A": "areaamt",
        "y": "ycoordval",
        "g": "gravconst",
        "z": "depthpar",
        "d": "density",
        "T": "tempparm",
        "G": "gainparm",
        "W": "weightprm",
        "R": "resistanc",
        "x": "xposvalue"
      },
      "question": "and 6 beans. The two players move alternately. A move consists of\ntaking \\textbf{either}\n\\begin{itemize}\n\\item[a)] one bean from a heap, provided at least two beans are\nleft behind in that heap, \\textbf{or}\n\n\\item[b)] a complete heap of two or three beans.\n\\end{itemize}\nThe player who takes the last heap wins. To win the game, do you\nwant to move first or second? Give a winning strategy.",
      "solution": "This problem is dumb if you know the Sprague-Grundy theory of normal\nimpartial games (see Conway, Berlekamp and Guy, {\\it Winning Ways},\nfor details). I'll describe how it applies here. To each position you\nassign a {\\em nim-value} as follows. A position with no moves (in\nwhich case the person to move has just lost) takes value 0. Any other\nposition is assigned the smallest number not assigned to a valid move\nfrom that position.\n\nFor a single pile, one sees that an empty pile has value 0, a pile of\n2 has value 1, a pile of 3 has value 2, a pile of 4 has value 0, a\npile of 5 has value 1, and a pile of 6 has value 0.\n\nYou add piles just like in standard Nim: the nim-value of the\ncomposite of two games (where at every turn you pick a game and make\na move there) is the ``base 2 addition without carries'' (i.e.\\\nexclusive OR) of the nim-values of the constituents. So our starting\nposition, with piles of 3, 4, 5, 6, has nim-value $2 \\oplus 0 \\oplus\n1 \\oplus 0 = 3$.\n\nA position is a win for the player to move if and only if it has a\nnonzero value, in which case the winning strategy is to always move to\na 0 position. (This is always possible from a nonzero position and\nnever from a zero position, which is precisely the condition that\ndefines the set of winning positions.) In this case, the winning move\nis to reduce the pile of 3 down to 2, and you can easily describe the\nentire strategy if you so desire."
    },
    "descriptive_long_confusing": {
      "map": {
        "n": "compassrose",
        "a": "tablespoon",
        "F": "riverbank",
        "Y": "stonework",
        "l": "wheelhouse",
        "b": "springtime",
        "s": "watermelon",
        "C": "parchment",
        "B": "playground",
        "h": "coppermine",
        "t": "blacksmith",
        "S": "breezeway",
        "r": "candlewick",
        "o": "whistlecap",
        "p": "silverdust",
        "N": "honeycomb",
        "v": "paintbrush",
        "f": "cloverleaf",
        "w": "rainshadow",
        "O": "overflight",
        "m": "timberline",
        "u": "floodplain",
        "j": "breadcrumb",
        "I": "undergrowth",
        "c": "creekwater",
        "k": "mousetrap",
        "A": "afterglows",
        "y": "ridgepole",
        "g": "meadowlark",
        "z": "lemonpeels",
        "d": "marshgrass",
        "T": "crosswinds",
        "G": "dragonfire",
        "W": "riverstone",
        "R": "lighthouse",
        "x": "coffeebean"
      },
      "question": "and 6 beans. The two players move alternately. A move consists of\ntaking \\textbf{either}\n\\begin{itemize}\n\\item[a)] one bean from a heap, provided at least two beans are\nleft behind in that heap, \\textbf{or}\n\n\\item[b)] a complete heap of two or three beans.\n\\end{itemize}\nThe player who takes the last heap wins. To win the game, do you\nwant to move first or second? Give a winning strategy.",
      "solution": "This problem is dumb if you know the Sprague-Grundy theory of normal\nimpartial games (see Conway, Berlekamp and Guy, {\\it Winning Ways},\nfor details). I'll describe how it applies here. To each position you\nassign a {\\em nim-value} as follows. A position with no moves (in\nwhich case the person to move has just lost) takes value 0. Any other\nposition is assigned the smallest number not assigned to a valid move\nfrom that position.\n\nFor a single pile, one sees that an empty pile has value 0, a pile of\n2 has value 1, a pile of 3 has value 2, a pile of 4 has value 0, a\npile of 5 has value 1, and a pile of 6 has value 0.\n\nYou add piles just like in standard Nim: the nim-value of the\ncomposite of two games (where at every turn you pick a game and make\na move there) is the ``base 2 addition without carries'' (i.e.\\\nexclusive OR) of the nim-values of the constituents. So our starting\nposition, with piles of 3, 4, 5, 6, has nim-value $2 \\oplus 0 \\oplus\n1 \\oplus 0 = 3$.\n\nA position is a win for the player to move if and only if it has a\nnonzero value, in which case the winning strategy is to always move to\na 0 position. (This is always possible from a nonzero position and\nnever from a zero position, which is precisely the condition that\ndefines the set of winning positions.) In this case, the winning move\nis to reduce the pile of 3 down to 2, and you can easily describe the\nentire strategy if you so desire."
    },
    "descriptive_long_misleading": {
      "map": {
        "n": "nonnumeric",
        "a": "ultimateval",
        "F": "dysfunction",
        "Y": "negatory",
        "l": "shortness",
        "b": "apexpoint",
        "s": "difference",
        "C": "variablee",
        "B": "smallness",
        "h": "deepness",
        "t": "spatially",
        "S": "emptiness",
        "r": "diametric",
        "o": "terminus",
        "p": "composite",
        "N": "unnatural",
        "v": "stillness",
        "f": "malfunction",
        "w": "narrowness",
        "O": "finishline",
        "m": "masslessness",
        "u": "intersection",
        "j": "realnumber",
        "I": "alterity",
        "c": "variablez",
        "k": "minutiae",
        "A": "perimeter",
        "y": "xcoordinate",
        "g": "weightless",
        "z": "baseline",
        "d": "proximity",
        "T": "coldness",
        "G": "levitation",
        "W": "playtime",
        "R": "nonradius",
        "x": "ycoordinate"
      },
      "question": "and 6 beans. The two players move alternately. A move consists of\n taking \\textbf{either}\n \\begin{itemize}\n \\item[a)] one bean from a heap, provided at least two beans are\n left behind in that heap, \\textbf{or}\n\n \\item[b)] a complete heap of two or three beans.\n \\end{itemize}\n The player who takes the last heap wins. To win the game, do you\n want to move first or second? Give a winning strategy.",
      "solution": "This problem is dumb if you know the Sprague-Grundy theory of normal\n impartial games (see Conway, Berlekamp and Guy, {\\it Winning Ways},\n for details). I'll describe how it applies here. To each position you\n assign a {\\em nim-value} as follows. A position with no moves (in\n which case the person to move has just lost) takes value 0. Any other\n position is assigned the smallest number not assigned to a valid move\n from that position.\n\n For a single pile, one sees that an empty pile has value 0, a pile of\n 2 has value 1, a pile of 3 has value 2, a pile of 4 has value 0, a\n pile of 5 has value 1, and a pile of 6 has value 0.\n\n You add piles just like in standard Nim: the nim-value of the\n composite of two games (where at every turn you pick a game and make\n a move there) is the ``base 2 addition without carries'' (i.e.\\\n exclusive OR) of the nim-values of the constituents. So our starting\n position, with piles of 3, 4, 5, 6, has nim-value $2 \\oplus 0 \\oplus\n 1 \\oplus 0 = 3$.\n\n A position is a win for the player to move if and only if it has a\n nonzero value, in which case the winning strategy is to always move to\n a 0 position. (This is always possible from a nonzero position and\n never from a zero position, which is precisely the condition that\n defines the set of winning positions.) In this case, the winning move\n is to reduce the pile of 3 down to 2, and you can easily describe the\n entire strategy if you so desire."
    },
    "garbled_string": {
      "map": {
        "n": "qzxwvtnp",
        "a": "hjgrksla",
        "F": "mxptzqse",
        "Y": "wdkrlona",
        "l": "bvcxsdfe",
        "b": "kqjdhtzu",
        "s": "plmnrytu",
        "C": "hjfkdlsa",
        "B": "xmskrnqa",
        "h": "zrplgnwc",
        "t": "gdbfqnvy",
        "S": "klmvhqpr",
        "r": "nfqgzvye",
        "o": "ylprkcqx",
        "p": "ctzvaqwe",
        "N": "vtyqrnps",
        "v": "ljdmsewt",
        "f": "drnqspav",
        "w": "qpzoldmw",
        "O": "skldnqpr",
        "m": "fdpzkwry",
        "u": "azmqprls",
        "j": "tqslvnrd",
        "I": "rsdplvqx",
        "c": "amqzrlpt",
        "k": "slprndgw",
        "A": "fwmzqptr",
        "y": "gnwqplsd",
        "g": "qmfzrdlp",
        "z": "prlqmdsw",
        "d": "xqzvplmr",
        "T": "rpldqvns",
        "G": "tvdqslpr",
        "W": "lmqrvdps",
        "R": "pmqrlvds",
        "x": "vqnslmpr"
      },
      "question": "and 6 beans. The two players move alternately. A move consists of\ntaking \\textbf{either}\n\\begin{itemize}\n\\item[a)] one bean from a heap, provided at least two beans are\nleft behind in that heap, \\textbf{or}\n\n\\item[b)] a complete heap of two or three beans.\n\\end{itemize}\nThe player who takes the last heap wins. To win the game, do you\nwant to move first or second? Give a winning strategy.",
      "solution": "This problem is dumb if you know the Sprague-Grundy theory of normal\nimpartial games (see Conway, Berlekamp and Guy, {\\it Winning Ways},\nfor details). I'll describe how it applies here. To each position you\nassign a {\\em nim-value} as follows. A position with no moves (in\nwhich case the person to move has just lost) takes value 0. Any other\nposition is assigned the smallest number not assigned to a valid move\nfrom that position.\n\nFor a single pile, one sees that an empty pile has value 0, a pile of\n2 has value 1, a pile of 3 has value 2, a pile of 4 has value 0, a\npile of 5 has value 1, and a pile of 6 has value 0.\n\nYou add piles just like in standard Nim: the nim-value of the\ncomposite of two games (where at every turn you pick a game and make\na move there) is the ``base 2 addition without carries'' (i.e.\\\nexclusive OR) of the nim-values of the constituents. So our starting\nposition, with piles of 3, 4, 5, 6, has nim-value $2 \\oplus 0 \\oplus\n1 \\oplus 0 = 3$.\n\nA position is a win for the player to move if and only if it has a\nnonzero value, in which case the winning strategy is to always move to\na 0 position. (This is always possible from a nonzero position and\nnever from a zero position, which is precisely the condition that\ndefines the set of winning positions.) In this case, the winning move\nis to reduce the pile of 3 down to 2, and you can easily describe the\nentire strategy if you so desire."
    },
    "kernel_variant": {
      "question": "Six heaps contain 2, 3, 5, 8, 11 and 14 beans, respectively.  \nOn every turn a player must choose exactly one heap and perform precisely one of the following operations (whenever it is legal for the chosen heap size n):\n\n(A) n → n − 1 (provided n ≥ 7);  \n(B) n → n − 2 (provided n ≥ 6);  \n(C) n → n − 4 (provided n ≥ 9);  \n(D) n → 0   (the whole heap may be taken only when n∈{2, 3, 5, 11});  \n(E) split the heap into two non-empty heaps whose sizes differ by any amount, subject to the restriction that neither of the two new heaps is of size 1 or 4  \n    (n → (a,b) with a+b=n is legal ⇔ a,b≥2 and a,b≠4).\n\nPlayers alternate; the player making the last legal move wins.  \nShould you play first or second, and what is a concrete winning strategy?\n\n_________________________________________________________",
      "solution": "1.  Sprague-Grundy set-up  \n   • g(0)=0.  \n   • For a heap of size n, let  \n  g(n)=mex{g(P) : P is reachable from n in one legal move}.  \n   • The nim-value of a position consisting of several heaps is the bitwise XOR (⊕) of the individual g-values.  \n   • A position is cold (P-position) if its nim-value is 0, hot (N-position) otherwise.\n\n2.  Computing g(n) for 0 ≤ n ≤ 14  \n\nWe list for every n the set S(n) of nim-values reachable in one move and then take g(n)=mex S(n).\n\nn=0 S=∅   → g(0)=0  \nn=1 no legal move       → g(1)=0  \n\nn=2 2→0     S={0} → g(2)=1  \n\nn=3 3→0     S={0} → g(3)=1  \n\nn=4 split 4→(2,2) (allowed) gives 1⊕1=0  \n  S={0}     → g(4)=1  \n\nn=5 5→0 or 5→(2,3),(3,2) all give nim-value 0  \n  S={0}     → g(5)=1  \n\nn=6 6→4 (rule B) gives 1 ; split 6→(3,3) gives 0  \n  S={0,1}    → g(6)=2  \n\nn=7 7→6 (2), 7→5 (1), split 7→(2,5),(5,2) gives 0  \n  S={0,1,2}   → g(7)=3  \n\nn=8 8→7 (3), 8→6 (2), split 8→(2,6),(6,2) gives 3,  \n      8→(3,5),(5,3) gives 0  \n  S={0,2,3}   → g(8)=1  \n\nn=9 9→8 (1), 9→7 (3), 9→5 (1),  \n  split 9→(2,7),(7,2) gives 2, 9→(3,6),(6,3) gives 3  \n  S={1,2,3}   → g(9)=0  \n\nn=10 10→9 (0), 10→8 (1), 10→6 (2),  \n  split 10→(2,8),(8,2) gives 0,  \n     10→(3,7),(7,3) gives 2, 10→(5,5) gives 0  \n  S={0,1,2}   → g(10)=3  \n\nn=11 11→0 (0), 11→10 (3), 11→9 (0), 11→7 (3),  \n  split 11→(2,9),(9,2) gives 1, 11→(3,8),(8,3) gives 0,  \n     11→(5,6),(6,5) gives 3  \n  S={0,1,3}   → g(11)=2  \n\nn=12 12→11 (2), 12→10 (3), 12→8 (1),  \n  split 12→(2,10),(10,2) gives 2,  \n     12→(3,9),(9,3) gives 1,  \n     12→(5,7),(7,5) gives 2,  \n     12→(6,6) gives 0  \n  S={0,1,2,3}  → g(12)=4  \n\nn=13 13→12 (4), 13→11 (2), 13→9 (0),  \n  split 13→(2,11),(11,2) gives 3,  \n     13→(3,10),(10,3) gives 2,  \n     13→(5,8),(8,5) gives 0,  \n     13→(6,7),(7,6) gives 1  \n  S={0,1,2,3,4} → g(13)=5  \n\nn=14 14→13 (5), 14→12 (4), 14→10 (3),  \n  split 14→(2,12),(12,2) gives 5,  \n     14→(3,11),(11,3) gives 3,  \n     14→(5,9),(9,5) gives 1,  \n     14→(6,8),(8,6) gives 3,  \n     14→(7,7) gives 0  \n  S={0,1,3,4,5} → g(14)=2  \n\nThe complete table is therefore\n\nn :   0  1  2  3  4  5  6  7  8  9  10 11 12 13 14  \ng(n): 0  0  1  1  1  1  2  3  1  0  3  2  4  5  2\n\n3.  Nim-value of the initial position  \ng(2)⊕g(3)⊕g(5)⊕g(8)⊕g(11)⊕g(14)  \n=1⊕1⊕1⊕1⊕2⊕2  \n=(1⊕1)⊕1=1          (first three)  \n1⊕1=0             (include g(8))  \n0⊕2=2  \n2⊕2=0  \n\nThe nim-sum is 0, so the starting position is cold.  \nConsequently the first player is at a theoretical disadvantage, and the correct choice is to move second.\n\n4.  Concrete winning strategy for the second player  \n• Decline the first move (i.e. choose to play second).  \n• After your opponent’s move the position will inevitably have nim-sum ≠ 0 (because every legal move from a cold position changes at least one heap and hence changes the XOR).  \n• Compute the current nim-sum T (T≠0).  There must be at least one heap whose g-value contains the highest-order 1 in the binary expansion of T.  \n  Within that heap perform a legal move that changes its g-value from t to t′=t⊕T, thereby restoring the global XOR to 0.  \n  (The existence of such a move is guaranteed by the definition of g(n); if several exist, pick any one of them.)\n\nPersisting in the “always return the nim-sum to 0’’ programme keeps the position cold after each of your turns.  Eventually the first player will be confronted with an empty list of legal moves and will lose the game, giving you the win.\n\n_________________________________________________________",
      "metadata": {
        "replaced_from": "harder_variant",
        "replacement_date": "2025-07-14T19:09:31.745764",
        "was_fixed": false,
        "difficulty_analysis": "1.  Added move types: three different “partial-removal’’ sizes (−1, −2, −4), a restricted “take-all’’ that works for four scattered heap sizes, and a constrained **split** operation.  The latter converts one heap into two, so the number of heaps is no longer invariant, greatly enlarging the game tree.\n\n2.  The split restriction forbidding sizes 1 and 4 makes SG values highly irregular; no short periodic pattern emerges, so one must execute (or program) a genuine recursive mex computation rather than guess from small data.\n\n3.  Correct play demands knowledge of\n • Sprague-Grundy theory,  \n • handling of impartial games that branch into sums (via splitting), and  \n • systematic use of nim-sum zeroing, not just simple “remove‐the-heap’’ tricks.\n\n4.  The original problem involved only deletions; the current kernel variant still had a fixed number of heaps.  The enhanced variant introduces higher‐dimensional state (variable heap count), more cases in the move set, and subtler legality constraints.  Computing the SG table and locating a zero-move therefore require substantially more work and deeper understanding than in either earlier version."
      }
    },
    "original_kernel_variant": {
      "question": "Six heaps contain 2, 3, 5, 8, 11 and 14 beans, respectively.  \nOn every turn a player must choose exactly one heap and perform precisely one of the following operations (whenever it is legal for the chosen heap size n):\n\n(A) n → n − 1 (provided n ≥ 7);  \n(B) n → n − 2 (provided n ≥ 6);  \n(C) n → n − 4 (provided n ≥ 9);  \n(D) n → 0   (the whole heap may be taken only when n∈{2, 3, 5, 11});  \n(E) split the heap into two non-empty heaps whose sizes differ by any amount, subject to the restriction that neither of the two new heaps is of size 1 or 4  \n    (n → (a,b) with a+b=n is legal ⇔ a,b≥2 and a,b≠4).\n\nPlayers alternate; the player making the last legal move wins.  \nShould you play first or second, and what is a concrete winning strategy?\n\n_________________________________________________________",
      "solution": "1.  Sprague-Grundy set-up  \n   • g(0)=0.  \n   • For a heap of size n, let  \n  g(n)=mex{g(P) : P is reachable from n in one legal move}.  \n   • The nim-value of a position consisting of several heaps is the bitwise XOR (⊕) of the individual g-values.  \n   • A position is cold (P-position) if its nim-value is 0, hot (N-position) otherwise.\n\n2.  Computing g(n) for 0 ≤ n ≤ 14  \n\nWe list for every n the set S(n) of nim-values reachable in one move and then take g(n)=mex S(n).\n\nn=0 S=∅   → g(0)=0  \nn=1 no legal move       → g(1)=0  \n\nn=2 2→0     S={0} → g(2)=1  \n\nn=3 3→0     S={0} → g(3)=1  \n\nn=4 split 4→(2,2) (allowed) gives 1⊕1=0  \n  S={0}     → g(4)=1  \n\nn=5 5→0 or 5→(2,3),(3,2) all give nim-value 0  \n  S={0}     → g(5)=1  \n\nn=6 6→4 (rule B) gives 1 ; split 6→(3,3) gives 0  \n  S={0,1}    → g(6)=2  \n\nn=7 7→6 (2), 7→5 (1), split 7→(2,5),(5,2) gives 0  \n  S={0,1,2}   → g(7)=3  \n\nn=8 8→7 (3), 8→6 (2), split 8→(2,6),(6,2) gives 3,  \n      8→(3,5),(5,3) gives 0  \n  S={0,2,3}   → g(8)=1  \n\nn=9 9→8 (1), 9→7 (3), 9→5 (1),  \n  split 9→(2,7),(7,2) gives 2, 9→(3,6),(6,3) gives 3  \n  S={1,2,3}   → g(9)=0  \n\nn=10 10→9 (0), 10→8 (1), 10→6 (2),  \n  split 10→(2,8),(8,2) gives 0,  \n     10→(3,7),(7,3) gives 2, 10→(5,5) gives 0  \n  S={0,1,2}   → g(10)=3  \n\nn=11 11→0 (0), 11→10 (3), 11→9 (0), 11→7 (3),  \n  split 11→(2,9),(9,2) gives 1, 11→(3,8),(8,3) gives 0,  \n     11→(5,6),(6,5) gives 3  \n  S={0,1,3}   → g(11)=2  \n\nn=12 12→11 (2), 12→10 (3), 12→8 (1),  \n  split 12→(2,10),(10,2) gives 2,  \n     12→(3,9),(9,3) gives 1,  \n     12→(5,7),(7,5) gives 2,  \n     12→(6,6) gives 0  \n  S={0,1,2,3}  → g(12)=4  \n\nn=13 13→12 (4), 13→11 (2), 13→9 (0),  \n  split 13→(2,11),(11,2) gives 3,  \n     13→(3,10),(10,3) gives 2,  \n     13→(5,8),(8,5) gives 0,  \n     13→(6,7),(7,6) gives 1  \n  S={0,1,2,3,4} → g(13)=5  \n\nn=14 14→13 (5), 14→12 (4), 14→10 (3),  \n  split 14→(2,12),(12,2) gives 5,  \n     14→(3,11),(11,3) gives 3,  \n     14→(5,9),(9,5) gives 1,  \n     14→(6,8),(8,6) gives 3,  \n     14→(7,7) gives 0  \n  S={0,1,3,4,5} → g(14)=2  \n\nThe complete table is therefore\n\nn :   0  1  2  3  4  5  6  7  8  9  10 11 12 13 14  \ng(n): 0  0  1  1  1  1  2  3  1  0  3  2  4  5  2\n\n3.  Nim-value of the initial position  \ng(2)⊕g(3)⊕g(5)⊕g(8)⊕g(11)⊕g(14)  \n=1⊕1⊕1⊕1⊕2⊕2  \n=(1⊕1)⊕1=1          (first three)  \n1⊕1=0             (include g(8))  \n0⊕2=2  \n2⊕2=0  \n\nThe nim-sum is 0, so the starting position is cold.  \nConsequently the first player is at a theoretical disadvantage, and the correct choice is to move second.\n\n4.  Concrete winning strategy for the second player  \n• Decline the first move (i.e. choose to play second).  \n• After your opponent’s move the position will inevitably have nim-sum ≠ 0 (because every legal move from a cold position changes at least one heap and hence changes the XOR).  \n• Compute the current nim-sum T (T≠0).  There must be at least one heap whose g-value contains the highest-order 1 in the binary expansion of T.  \n  Within that heap perform a legal move that changes its g-value from t to t′=t⊕T, thereby restoring the global XOR to 0.  \n  (The existence of such a move is guaranteed by the definition of g(n); if several exist, pick any one of them.)\n\nPersisting in the “always return the nim-sum to 0’’ programme keeps the position cold after each of your turns.  Eventually the first player will be confronted with an empty list of legal moves and will lose the game, giving you the win.\n\n_________________________________________________________",
      "metadata": {
        "replaced_from": "harder_variant",
        "replacement_date": "2025-07-14T01:37:45.576146",
        "was_fixed": false,
        "difficulty_analysis": "1.  Added move types: three different “partial-removal’’ sizes (−1, −2, −4), a restricted “take-all’’ that works for four scattered heap sizes, and a constrained **split** operation.  The latter converts one heap into two, so the number of heaps is no longer invariant, greatly enlarging the game tree.\n\n2.  The split restriction forbidding sizes 1 and 4 makes SG values highly irregular; no short periodic pattern emerges, so one must execute (or program) a genuine recursive mex computation rather than guess from small data.\n\n3.  Correct play demands knowledge of\n • Sprague-Grundy theory,  \n • handling of impartial games that branch into sums (via splitting), and  \n • systematic use of nim-sum zeroing, not just simple “remove‐the-heap’’ tricks.\n\n4.  The original problem involved only deletions; the current kernel variant still had a fixed number of heaps.  The enhanced variant introduces higher‐dimensional state (variable heap count), more cases in the move set, and subtler legality constraints.  Computing the SG table and locating a zero-move therefore require substantially more work and deeper understanding than in either earlier version."
      }
    }
  },
  "checked": true,
  "problem_type": "proof",
  "iteratively_fixed": true
}