Take away, subtraction or nim?

100 Views Asked by At

During most of my life my math skills were an absolute joke mostly due to bad teatchers (since 1st grade till 11th grade) but at some point, though late, of my life fortunatelly I was blessed with a bit of understanding of math, and what a beautiful world it is. I'm saying this in advance in order to humbly ask to whoever can to please help me in the most simple way possible in order for me to understand because I know that I'm no Cauchy. Here's the problem: In a bar a guy comes to me with a game. The rules are as follow: 1- There was a matrix 3*5 of coins on the tabble. 2- Two players required to play. 3- Sets of {1},{2} or {3} coins could be drawed at time. 4- The player who wipes the tabble clean wins. Now here's the twist, that fellow droped out of school very early so his mathematical skills are very limited let's say, so I'm guessing that there must be a simple way to understand how to win. Never the less he aced this game with such a confidence and he really won every single time no matter the opponent. I searched for an answer but so far only got confused. Of my refection I figyred out that: 1- If it's my turn and there are 5, 6 or 7 coins it's a win to me. 2- The only way to assure a win is to let the other player with 8 coins on the tabble thus leadding to 100% of chance for me to win. The question is what's the strattegy to win and what happens when both players kwon it? thank you.

1

There are 1 best solutions below

3
On

You have to know a bit about graph theory. The main idea is to obtain a directed graph that represents the game and the player who is in the kernel wins.

What is a kernel y directed graph theory? it is an independent set of vertices $N$ such that for every vertex $v\notin N$ there exists an arrow from $v$ to a vertex in $N$.

Now, how would this directed graph look like? well every vertex must represent an amount of coins there are on the board. There is an arrow from $v$ to $w$ if $v-w \leq 3$.

So the set of vertices is $\{0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15\}$ and the arrows are as I described above. Since this is an acyclic digraph it has a kernel. In this case the kernel is the set $N= \{0,4,8,12\}$ which are the multiples of 4. So if you want to win, you must make sure to always leave an amount of coins that is a multiple of four.

Sorry I dont have a picture of the graph, I also don't know how to make a graph with latex.