So my friend comes up and confidently says that he can defeat me in this game:
- The integers $1$ to $14$ are written down on a blackboard (paper in our case).
- Players take turns colouring (striking out in our case) $2$ or $3$ numbers that total $15$. They can only colour the uncoloured numbers
- The last player to colour a pair or a triplet wins the game
Since I don't want to lose, I figured I'll ask it here. Is there any strategy a player (which, first or second?) can employ to win the game? I have thought about it for a lot of time, but to no avail. So, I present a few sample games:
$(1,14),(2,5,8), (4,11), (9,6), (3,12)$. So, the first player wins.
$(4,5,6), (7,8), (10,3,2), (1,14)$ so second player wins.
I also calculated the number of solutions to $a+b+c = 15$, where $0 \le a < b<c\le 14$. There are $19$ such $(a,b,c)$.
Verified $19$ solutions using python. If they can be of any help:
1,14
2,13
3,12
4,11
5,10
6,9
7,8
1,2,12
1,3,11
1,4,10
1,5,9
1,6,8
2,3,10
2,4,9
2,5,8
2,6,7
3,4,8
3,5,7
4,5,6
PS: I see that the tag description about game theory matches my question, so I've used it. But please do not use complicated notation employed in game theory since I don't know much about it.
Theoretical background
For a game like this, there is only one theoretical idea from Combinatorial Game Theory we really need: The concept of "N-positions" and "P-positions". An N-position is a state where the Next player to move has a winning strategy. And a P-position is a state where instead the Previous player to move has one.
Two key facts:
If you prefer video, this idea is discussed at P-positions and N-positions: Introduction to Combinatorial Game Theory #2 by Knop's Course on YouTube.
Solution
(I will use "take" to mean "strike out".)
This game is probably just simple enough that it could reasonably be solved by hand with a decent amount of paper and time - just write out some branches of play, building up which states are N-positions or P-positions from below, until a promising line of play is found. But I used a program very similar to the Python mentioned below to analyze it.
The game is a win for the first player, who can win by taking any pair, or one of the triples $(1,6,8)$ or $(2,6,7)$.
It suffices to show that one of those moves is part of a winning strategy. For simplicity, consider the move of taking $(1,6,8)$, leaving $(2,3,4,5,7,9,10,11,12,13,14)$. Then there are seven things the opponent can take: $(2,13)$, $(3,12)$, $(4,11)$, $(5,10)$, $(2,3,10)$, $(2,4,9)$, and $(3,5,7)$.
Python code
Since you mentioned Python, we can turn this idea of N and P positions into Python code. If
movesgives a list of reachable states starting from the states, then we can use #2 above to test if a state is an N-position:One way to define
movesis to use a set of numbers (so that striking out is easy), as in:Since the game is so short with not too much branching, this can evaluate whether any state (including the starting state) is an N-position very quickly.
Try it online!