arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 1804.06515cs.DSmath.NT
收藏

减法游戏的快速评估

Faster Evaluation of Subtraction Games

David Eppstein

摘要:

减法游戏是用一堆或多堆代币进行的,玩家轮流从一堆代币中取出属于指定减法集合的一定数量的代币;最后一个移动的玩家获胜。我们描述了如何在单堆减法游戏中计算获胜堆大小的集合(对于由减法集合和最大堆大小$n$组成的输入),在时间上为$\tilde O(n)$,其中$\tilde O$省略了对数因子。对于多堆游戏,最佳的游戏是由每个堆的nim值确定的,我们描述了如何计算所有堆的nim值的大小达到~ $n$的时间$\tilde O(mn)$,其中$m$是最大的nim值发生在这些堆大小。这些时间界限改进了朴素动态规划算法与时间的关系$O(n|S|)$,因为所有这些游戏的$m\le|S|$。我们将这些结果应用到减平方的游戏中,其获胜位置的集合是数论中与Furstenberg-Sárközy定理有关的一种类型的最大平方差自由集。我们提供的实验证据表明,对于这个游戏,一组获胜的位置具有密度相媲美的dennessy已知的平方差自由集,并具有模块化的结构相关的已知结构,这些稠密集。此外,这个游戏的nim值(实验)显着小于其减法集的大小,这意味着我们的算法实现了一个多项式加速比动态规划。

英文摘要:

Subtraction games are played with one or more heaps of tokens, with players taking turns removing from a single heap a number of tokens belonging to a specified subtraction set; the last player to move wins. We describe how to compute the set of winning heap sizes in single-heap subtraction games (for an input consisting of the subtraction set and maximum heap size $n$), in time $\tilde O(n)$, where the $\tilde O$ elides logarithmic factors. For multi-heap games, the optimal game play is determined by the nim-value of each heap; we describe how to compute the nim-values of all heaps of size up to~$n$ in time $\tilde O(mn)$, where $m$ is the maximum nim-value occurring among these heap sizes. These time bounds improve naive dynamic programming algorithms with time $O(n|S|)$, because $m\le|S|$ for all such games. We apply these results to the game of subtract-a-square, whose set of winning positions is a maximal square-difference-free set of a type studied in number theory in connection with the Furstenberg-Sárközy theorem. We provide experimental evidence that, for this game, the set of winning positions has a density comparable to that of the densest known square-difference-free sets, and has a modular structure related to the known constructions for these dense sets. Additionally, this game's nim-values are (experimentally) significantly smaller than the size of its subtraction set, implying that our algorithm achieves a polynomial speedup over dynamic programming.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑