3

the game is structured like this:

  • two players
  • the players alternate moves
  • 4 heaps $h_1, h_2, h_3, h_4$ with sizes $n_1, n_2, n_3, n_4$
  • at each move, the player can either remove one or two elements from any of the heaps (meaning that if the player takes two elements, those two can either be from the same heap or from two different heaps, as long as the total number of removed elements per turn is 2).
  • the game is played misère-ish, so it stops when the player (who loses the game) is left with 3 heaps of size $0$ and one heap with size greater than $0$.

Is this game a variant of the Index-k Nim (also called $Nim_k$)? The problem is that in the $Nim_k$ (and in every multi-heap Nim) game I can either remove an arbitrary or bounded amount of elements $r$ in each of the (at most) $k$ heaps per turn, while in this game the maximum number of elements that can be removed in total is bounded.

Is it a valid Nim or not? Can you suggest a valid winning strategy?

(thank-you)

  • You should be able to compute Sprague-Grundy numbers for the game, right?' – Jyrki Lahtonen Jan 02 '18 at 18:08
  • Hmm. I don't understand the game ending condition. Why would, say $(4,0,0,0)$, be a losing position because the other player can only reduce it to $(3,0,0,0)$ or $(2,0,0,0)$, and in either case you can leave them with $(1,0,0,0)$ (when they are forced to take the last item and lose by misère rules if I got it right?) – Jyrki Lahtonen Jan 02 '18 at 18:11
  • actually $(4,0,0,0)$ would be already an ending condition. Any case where 3 heaps have size 0 and one has size greater than 0 is an ending condition. – Simone Procaccia Jan 02 '18 at 18:14
  • Anyway, when the number of removed items is limited to 1 or 2 you can always subtract three from the heap by reversing the choice of your opponents move. Therefore $(n_1,n_2,n_3,n_4)$ is equivalent to $(r_1,r_2,r_3,r_4)$ where $r_i$ is the remainder of $n_i$ modulo $3$. I am not 100% sure whether misère means we should let $r_i>0$? – Jyrki Lahtonen Jan 02 '18 at 18:14
  • Ok. I misunderstood the rules. The point about replacing $n_i$ with $n_i-3$ when both are positive does stand though. Meaning that you only have finitely many positions to calculate the Sprague-Grundy numbers for. This should point at a winning strategy. – Jyrki Lahtonen Jan 03 '18 at 09:37
  • @JyrkiLahtonen I honestly don't get the $n_i - 3$. I should reduce by three each heap size, and this should let me get a finite number of states to calculate the Sprague-Grundy number for. I actually tried to $mod 3$ all $n_i$ and then find the SG for that state. I thought that since in normal play I would be expecting an SG number $0$ to be a losing position, in this misère-ish play $0$ would be a winning one. So i did my calculculations and the results were close to random! Before doing this, I also played the game and found some position from which the first player was always losing. – Simone Procaccia Jan 03 '18 at 11:21
  • that i called "fatal". The player was not always losing actually, but he simply let the other player decide for his "faith". As an example $(1,1,1,1)$: first player $\rightarrow (0,1,1,1)$; second player $\rightarrow (0,0,0,1)$ and wins. The second possibility. $(1,1,1,1)$: first player $\rightarrow (0,0,1,1)$; second player $\rightarrow (0,0,0,1)$ and wins. Any moves the first player will make, the second player will be able to win. There are actually many of those $P$ positions (probably using this term improperly but it gives the idea of it) and I was expecting those positions' SG#=1 – Simone Procaccia Jan 03 '18 at 11:28
  • Hmm. I'm afraid I don't remember how SG handles misère. Need a refresher :-( – Jyrki Lahtonen Jan 03 '18 at 11:31
  • @JyrkiLahtonen SG doesn't really handle misère at all. You can get a number by similar means (see https://math.stackexchange.com/questions/375114/ ) but it doesn't tell you anything useful about sums of games. 2. This game isn't a sum of games so other than the extra structure helping you to see a pattern in the win/loss positions, calculating any version of SG # won't help here. 3. This game isn't actually misère since the ending condition is the artificial "when there's one nonzero heap; the actual misère game has a simple winning strategy of "make the mod-3 sum 1". This is much harder.
  • – Mark S. Jan 04 '18 at 13:51
  • Thanks @MarkS. I seem to have already upvote your old answer in the other thread back in the day. Anyway, misère is more complicated than I recalled, so I will exit back left :-) – Jyrki Lahtonen Jan 04 '18 at 14:24
  • I think I have the solution, but writing up a proof is tedious. What is the source of this game? – Mark S. Jan 06 '18 at 17:29
  • @MarkS. it is a game invented by my computer science professor, just for fun. He asked us if we were able to find a solution (and write an algorithm out of it). – Simone Procaccia Jan 07 '18 at 00:24
  • @MarkS. if you can't write the proof of it, can you at least give an intuition of how the proof might be? Thank you! – Simone Procaccia Jan 09 '18 at 14:14
  • @MarkS. any news? – Simone Procaccia Jan 22 '18 at 22:34
  • After being on vacation, and then taking a while to write up a detailed enough proof sketch that I was convinced I have the correct outcomes, I have finally been able to post an answer. I would very much like to be put in contact with your professor, to credit him and to see if he had another approach. @JyrkiLahtonen the "subtract 3 by reversing the choice of your opponent's move" did turn out to be relevant, but it wasn't obvious that "you only have finite many positions to calculate", although that turns out to be true for this game. – Mark S. Jan 27 '18 at 22:38
  • Without the last condition, it simply reduces to one-heap nim. But that last condition makes all the difference – Cyriac Antony Apr 13 '18 at 04:34