Matchstick game problem

118 Views Asked by At

I'm going through past exam papers and this question is proving to be tricky. I can't seem to solve it and have no clue how to, I tried checking numerous ways like odds,evens,primes etc but i'm sure there is a way that doesn't involve just guess work. Please could you help (the answers are provided already so don't necessarily need them)

enter image description here

enter image description here

1

There are 1 best solutions below

0
On

This is a nim-like game and the Sprague-Grundy theorem applies. You are asked to separate the N positions from the P positions and are given some examples. The first is true, because starting from $(n,n)$ Bob can always win by copying Alice's move on the other pile. Then $X(n,n+1)=X(n,n+2)=1$ because Alice can move to $(n,n)$ and win.