arXiv++ Combinatorics

Browse math.CO papers from arXiv

sprague-grundy function

29 papers tagged with this keyword
Coin Turning Games on Partially Ordered Sets
A finite impartial game is a two-player game in which the players take turns making moves and the game ends after finitely many moves. In this paper, we study a class of finite impartial games introduced by H.~Lenstra, which we call coin turning games. We focus on two typical classes of coin turning games, namely the order ideal games and the rulers, distinguished by their choices of turning sets. For several posets arising from enumerative combinatorics, we determine the Sprague-Grundy functions. In particular, we determine the Sprague-Grundy function of the order ideal game on the ASM poset, introduced by J.~Striker in connection with the alternating sign matrices.
2025-03-29
A convergence technique for the game i-Mark
The game of i-Mark is an impartial combinatorial game introduced by Sopena (2016). The game is parametrized by two sets of positive integers $S$, $D$, where $\min D\ge 2$. From position $n\ge 0$ one can move to any position $n-s$, $s\in S$, as long as $n-s\ge 0$, as well as to any position $n/d$, $d\in D$, as long as $n>0$ and $d$ divides $n$. The game ends when no more moves are possible, and the last player to move is the winner. Sopena, and subsequently Friman and Nivasch (2021), characterized the Sprague-Grundy sequences of many cases of i-Mark$(S,D)$ with $|D|=1$. Friman and Nivasch also obtained some partial results for the case i-Mark$(\{1\},\{2,3\})$. In this paper we present a convergence technique that gives polynomial-time algorithms for the Sprague-Grundy sequence of many instances of i-Mark with $|D|>1$. In particular, we prove our technique works for all games i-Mark$(\{1\},\{d_1,d_2\})$. Keywords: Combinatorial game, impartial game, Sprague-Grundy function, convergence, dynamic programming.
On remoteness functions of k-NIM with k+1 piles in normal and in misère versions
Given integer $n$ and $k$ such that $0 < k \leq n$ and $n$ piles of stones, two players alternate turns. By one move it is allowed to choose any $k$ piles and remove exactly one stone from each. The player who has to move but cannot is the loser. in the normal version of the game and (s)he is the winner in the misère version. Cases $k=1$ and $k = n$ are trivial. For $k=2$ the game was solved for $n \leq 6$. For $n \leq 4$ the Sprague-Grundy function was efficiently computed (for both versions). For $n = 5,6$ a polynomial algorithm computing P-positions was obtained for the normal version. \newline Then, for the case $k = n-1$, a very simple explicit rule that determines the Smith remoteness function was found for the normal version of the game: the player who has to move keeps a pile with the minimum even number of stones; if all piles have odd number of stones then (s)he keeps a maximum one, while the $n-1$ remaining piles are reduced by one stone each in accordance with the rules of the game. \newline Computations show that the same rule works efficiently for the misère version too. The exceptions are sparse and are listed in Section 2. Denote a position by $x = (x_1, \dots, x_n)$. Due to symmetry, we can assume wlog that $x_1 \leq \ldots \leq x_n$. Our computations partition all exceptions into the following three families: $x_1$ is even, $x_1 = 1$, and $x_1 \geq 3$ is odd. In all three cases we suggest explicit formulas that cover all found exceptions, but this is not proven.
Computing Remoteness Functions of Moore, Wythoff, and Euclid's games
We study remoteness function $\mathcal R$ of impartial games introduced by Smith in 1966. The player who moves from a position $x$ can win if and only if $\mathcal R(x)$ is odd. The odd values of $\mathcal R(x)$ show how soon the winner can win, while even values show how long the loser can resist, provided both players play optimally. This function can be applied to the conjunctive compounds of impartial games, in the same way as the Sprague-Grundy function is applicable to their disjunctive compounds. We provide polynomial algorithms computing $\mathcal R(x)$ for games Euclid and generalized Wythoff. For Moore's NIM we give a simple explicit formula for $\mathcal R(x)$ if it is even and show that computing it becomes an NP-hard problem for the odd values.
2023-04-13
On Remoteness Functions of Exact Slow $k$-NIM with $k+1$ Piles
Given integer $n$ and $k$ such that $0 < k \leq n$ and $n$ piles of stones, two player alternate turns. By one move it is allowed to choose any $k$ piles and remove exactly one stone from each. The player who has to move but cannot is the loser. Cases $k=1$ and $k = n$ are trivial. For $k=2$ the game was solved for $n \leq 6$. For $n \leq 4$ the Sprague-Grundy function was efficiently computed (for both the normal and misère versions). For $n = 5,6$ a polynomial algorithm computing P-positions was obtained. Here we consider the case $2 \leq k = n-1$ and compute Smith's remoteness function, whose even values define the P-positions. In fact, an optimal move is always defined by the following simple rule: if all piles are odd, keep a largest one and reduce all other; if there exist even piles, keep a smallest one of them and reduce all other. Such strategy is optimal for both players, moreover, it allows to win as fast as possible from an N-position and to resist as long as possible from a P-position.
More about Exact Slow $k$-Nim
Given $n$ piles of tokens and a positive integer $k \leq n$, the game Nim$^1_{n, =k}$ of exact slow $k$-Nim is played as follows. Two players move alternately. In each move, a player chooses exactly $k$ non-empty piles and removes one token from each of them. A player whose turn it is to move but has no move loses (if the normal version of the game is played, and wins if it is the misére version). In Integers 20 (2020) 1-19, Gurvich et al gave an explicit formula for the Sprague-Grundy function of Nim$^1_{4, =2}$, for both its normal and misére version. Here we extend this result and obtain an explicit formula for the P-positions of the normal version of Nim$^1_{5, =2}$ and Nim$^1_{6, =2}$.
2021-01-19 v3
Game values of arithmetic functions
Published • View PublicationBIB
Arithmetic functions in Number Theory meet the Sprague-Grundy function from Combinatorial Game Theory. We study a variety of 2-player games induced by standard arithmetic functions, such as Euclidian division, divisors, remainders and relatively prime numbers, and their negations.
2020-07-01 v3
Some i-Mark games
Published • View PublicationBIB
Let $S$ be a set of positive integers, and let $D$ be a set of integers larger than $1$. The game $i$-Mark$(S,D)$ is an impartial combinatorial game introduced by Sopena (2016), which is played with a single pile of tokens. In each turn, a player can subtract $s \in S$ from the pile, or divide the size of the pile by $d \in D$, if the pile size is divisible by $d$. Sopena partially analyzed the games with $S=[1, t-1]$ and $D=\{d\}$ for $d \not\equiv 1 \pmod t$, but left the case $d \equiv 1 \pmod t$ open. We solve this problem by calculating the Sprague-Grundy function of $i$-Mark$([1,t-1],\{d\})$ for $d \equiv 1 \pmod t$, for all $t,d \geq 2$. We also calculate the Sprague-Grundy function of $i$-Mark$(\{2\},\{2k + 1\})$ for all $k$, and show that it exhibits similar behavior. Finally, following Sopena's suggestion to look at games with $|D|>1$, we derive some partial results for the game $i$-Mark$(\{1\}, \{2, 3\})$, whose Sprague-Grundy function seems to behave erratically and does not show any clean pattern. We prove that each value $0,1,2$ occurs infinitely often in its SG sequence, with a maximum gap length between consecutive appearances.
2019-12-29 v3
A base-p Sprague-Grundy type theorem for p-calm subtraction games: Welter's game and representations of generalized symmetric groups
Published • View PublicationBIB
For impartial games $Γ$ and $Γ'$, the Sprague-Grundy function of the disjunctive sum $Γ+ Γ'$ is equal to the Nim-sum of their Sprague-Grundy functions. In this paper, we introduce $p$-calm subtraction games, and show that for $p$-calm subtraction games $Γ$ and $Γ'$, the Sprague-Grundy function of a $p$-saturation of $Γ+ Γ'$ is equal to the $p$-Nim-sum of the Sprague-Grundy functions of their $p$-saturations. Here a $p$-Nim-sum is the result of addition without carrying in base $p$ and a $p$-saturation of $Γ$ is an impartial game obtained from $Γ$ by adding some moves. It will turn out that Nim and Welter's game are $p$-calm. Further, using the $p$-calmness of Welter's game, we generalize a relation between Welter's game and representations of symmetric groups to disjunctive sums of Welter's games and representations of generalized symmetric groups; this result is described combinatorially in terms of Young diagrams.
On the Sprague-Grundy function of compound games
The classical game of {\sc Nim} can be naturally extended and played on an arbitrary hypergraph $\cH \subseteq 2^V \setminus \{\emptyset\}$ whose vertices $V = \{1, \ldots, n\}$ correspond to piles of stones. By one move a player chooses an edge $H$ of $\cH$ and reduces arbitrarily all piles $i \in H$. In 1901 Bouton solved the classical {\sc Nim} for which $\cH = \{\{1\}, \ldots, \{n\}\}$. In 1910 Moore introduced and solved a more general game $k$-{\sc Nim}, for which $\cH = \{H \subseteq V \mid |H| \leq k\}$, where $1 \leq k < n$. In 1980 Jenkyns and Mayberry obtained an explicit formula for the Sprague-Grundy function of Moore's {\sc Nim} for the case $k+1 = n$. Recently it was shown that the same formula works for a large class of hypergraphs. In this paper we study combinatorial properties of these hypergraphs and obtain explicit formulas for the Sprague-Grundy functions of the conjunctive and selective compounds of the corresponding hypergraph {\sc Nim} games.
2019-02-17 v2
On the additive period length of the Sprague-Grundy function of certain Nim-like games
We examine the structure of the additive period of the Sprague-Grundy function of Nim-like games, among them Wythoff's Game, and deduce a bound for the length of the period and preperiod.
2018-04-24 v4
The Sprague-Grundy Functions of Saturations of Misere Nim
Published in The Electronic Journal of Combinatorics 28(1), P1.58, 2021 • View PublicationBIB
We consider misère Nim as a normal-play game obtained from Nim by removing the terminal position. While explicit formulas are known for the Sprague-Grundy functions of Nim and Welter's game, no explicit formula is known for that of misère Nim. All three of these games can be considered as position restrictions of Nim. What are the differences between them? We point out that Nim and Welter's game are saturated, but misère Nim is not. Moreover, we present explicit formulas for the Sprague-Grundy functions of saturations of misère Nim, which are obtained from misère Nim by adjoining some moves.
Sprague-Grundy Function of Matroids and Related Hypergraphs
Published • View PublicationBIB
We consider a generalization of the classical game of $NIM$ called hypergraph $NIM$. Given a hypergraph $\cH$ on the ground set $V = \{1, \ldots, n\}$ of $n$ piles of stones, two players alternate in choosing a hyperedge $H \in \cH$ and strictly decreasing all piles $i\in H$. The player who makes the last move is the winner. In this paper we give an explicit formula that describes the Sprague-Grundy function of hypergraph $NIM$ for several classes of hypergraphs. In particular we characterize all $2$-uniform hypergraphs (that is graphs) and all matroids for which the formula works. We show that all self-dual matroids are included in this class.
Sprague-Grundy Function of Symmetric Hypergraphs
Published • View PublicationBIB
We consider a generalization of the classical game of $NIM$ called hypergraph $NIM$. Given a hypergraph $\cH$ on the ground set $V = \{1, \ldots, n\}$ of $n$ piles of stones, two players alternate in choosing a hyperedge $H \in \cH$ and strictly decreasing all piles $i\in H$. The player who makes the last move is the winner. Recently it was shown that for many classes of hypergraphs the Sprague-Grundy function of the corresponding game is given by the formula introduced originally by Jenkyns and Mayberry (1980). In this paper we characterize symmetric hypergraphs for which the Sprague-Grundy function is described by the same formula.
The Sprague-Grundy function for some selective compound games
We analyze the Sprague-Grundy functions for a class of almost disjoint selective compound games played on Nim heaps. Surprisingly, we find that these functions behave chaotically for smaller Sprague-Grundy values of each component game yet predictably when any one heap is sufficiently large.
2018-01-02 v2
Mixed-Radix Nim
We present take-away games whose Sprague-Grundy functions are given by the Nim sum of heap sizes in a mixed base $β$. Let $Δ_β$ be the set of such games. We give a necessary and sufficient condition for the existence of a minimum of $Δ_β$, and a recursive construction of the maximum of $Δ_β$.
2017-02-23
The Sprague-Grundy function for some nearly disjunctive sums of Nim and Silver Dollar games
Published • View PublicationBIB
We introduce and analyse an extension of the disjunctive sum operation on some classical impartial games. Whereas the disjunctive sum describes positions formed from independent subpositions, our operation combines positions that are not completely independent but interact only in a very restricted way. We extend the games Nim and Silver Dollar, played by moving counters along one-dimensional strips of cells, by joining several strips at their initial cell. We prove that, in certain cases, computing the Sprague-Grundy function can be simplified to that of a simpler game with at most two tokens in each strip. We give an algorithm that, for each Sprague-Grundy value g, computes the positions of two-token Star Nim whose Sprague-Grundy values are g. We establish that the sequence of differences of entries of these positions is ultimately additively periodic.
2016-04-25 v3
p-Saturations of Welter's Game and the Irreducible Representations of Symmetric Groups
Published • View PublicationBIB
We establish a relation between the Sprague-Grundy function $\text{sg}$ of a $p$-saturation of Welter's game and the degrees of the ordinary irreducible representations of symmetric groups. In this game, a position can be viewed as a partition $λ$. Let $ρ^λ$ be the irreducible representation of $\text{Sym}(|λ|)$ indexed by $λ$. For every prime $p$, we show the following results: (1) the degree of $ρ^λ$ is prime to $p$ if and only if $\text{sg}(λ) = |λ|$; (2) the restriction of $ρ^λ$ to $\text{Sym}(\text{sg}(λ))$ has an irreducible component with degree prime to $p$. Further, for every integer $p$ greater than 1, we obtain an explicit formula for $\text{sg}(λ)$.
2015-08-24
Slow $k$-Nim
Given $n$ piles of tokens and a positive integer $k \leq n$, we study the following two impartial combinatorial games Nim$^1_{n, \leq k}$ and Nim$^1_{n, =k}$. In the first (resp. second) game, a player, by one move, chooses at least $1$ and at most (resp. exactly) $k$ non-empty piles and removes one token from each of these piles. For the normal and misère version of each game we compute the Sprague-Grundy function for the cases $n = k = 2$ and $n = k+1 = 3$. For game Nim$^1_{n, \leq k}$ we also characterize its P-positions for the cases $n \leq k+2$ and $n = k+3 \leq 6$.
On the Sprague-Grundy function of Exact $k$-Nim
Published • View PublicationBIB
Moore's generalization of the game of {\sc Nim} is played as follows. Let $n$ and $k$ be two integers such that $1 \leq k \leq n$. Given $n$ piles of tokens, two players move alternately, removing tokens from at least one and at most $k$ of the piles. The player who makes the last move wins. The game was solved by Moore in 1910 and an explicit formula for its Sprague-Grundy function was given by Jenkyns and Mayberry in 1980, for the case $n = k+1$ only. We introduce another generalization of {\sc Nim}, called {\sc Exact $k$-Nim}, in which each move reduces exactly $k$ piles. We give an explicit formula for the Sprague-Grundy function of {\sc Exact $k$-Nim} in case $2k \geq n$. In case $n=2k$ our formula is surprisingly similar to Jenkyns and Mayberry's one.