
TL;DR
This paper introduces faster algorithms for computing winning positions and nim-values in subtraction games, significantly improving efficiency over naive methods and applying these results to the subtract-a-square game with connections to number theory.
Contribution
The authors develop algorithms that compute winning positions and nim-values in near-linear and near-quadratic time, respectively, outperforming traditional dynamic programming approaches.
Findings
Algorithms achieve near-linear and near-quadratic time complexity.
The set of winning positions in subtract-a-square has a structure similar to dense square-difference-free sets.
Nim-values in subtract-a-square are smaller than the subtraction set size, enabling polynomial speedup.
Abstract
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 ), in time , where the 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~ in time , where is the maximum nim-value occurring among these heap sizes. These time bounds improve naive dynamic programming algorithms with time , because for all such games. We apply these results to the game of subtract-a-square, whose set of…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
