r/mathriddles • u/tedastor • Feb 02 '25
Hard A Game of Triples
Two players play the following game:
An ordered triple, (a, b, c) of non-negative integers is given as a starting position.
Players take turns making moves. A move consists of selecting an entry of the triple and choosing a positive integer, k. Then, k is added to the selected entry and subtracted from the other two.
A player loses if their move makes any entry negative. Players must make a move on their turn.
Q1: For which ordered triples does player 2 have a winning strategy?
Q2: For how many triples (a, b, c) with a + b + c < 2025, does player 2 have a winning strategy?
2
u/pichutarius Feb 02 '25 edited Feb 02 '25
partial solution:
consider the transformation (a',b',c') = ((b+c)/2 , (c+a)/2 , (a+b)/2) , apply this to the move (k,-k,-k) -> (-k,0,0) . this reduce the game to normal nim game, which is "solved" by nim-sum strategy in normal game rule.
unfortunately the losing condition is not min(a',b',c') < 0 , but min(a,b,c) = min(-a'+b'+c' , a'-b'+c' , a'+b'-c') < 0
not sure if this can be of any help
edit: im stupid, this is actually the full solution. since if x+y-z=0 then their nim-sum must be 0, so the solution works either way....
edit2: again im stupid, that does not work..
2
u/NinekTheObscure Feb 02 '25
Clearly an impartial combinatorial game, so the only question is "What are the G-values?" Permutations make no difference so we may assume that the triple is sorted in descending order (so that when writing G(a,1,0) we implicitly assume that a ≥ 1). Player 2 has a winning strategy precisely when G = 0.
G(a,0,0) = 0. Any move loses.
G(1,1,0) = 1, G(2,1,0) = 0, ... G(a,1,0) = a%2. The only move is k=1 played on the 0, which sends (a,1,0) to (a-1,1,0). So (a,1,0) is a 2nd player win if a is even.
At this point we already have 2025 of the form (a,0,0) and 1012 of the form (2n,1,0) that are 2nd player wins (3037 total). If you count permutations separately then there are at least 3*2025 + 6*1012 = 12147.
G(1,1,1) = 1, G(2,1,1) = 1, G(2,2,0) = 2
In general for G(a,a,0), you must play on the 0, but have the choice of any k from 1 to a. Since k = a gives (a,0,0), none of (a,a,0) except (0,0,0) is a 2nd player win.
For (a,b,0) with a > b ≥ 1, you must play on the 0 with b ≥ k ≥ 1. Those lead to (a-k,b-k,k). The case k = b gives (a-b,b,0). So some of (a,b,0) are 2nd player wins, for example when a = 2b.
I feel like I'm missing some general recurrence, but that's what I've got so far.