Why mex operation in grundy number calculation?

896 Views Asked by At

I understand the process of finding grundy numbers and their interpretation, but I don't completey understand the logic behind it. That is, why do we find the mex (minimum excludant) of grundy values of reachable states operation while computing grundy number ?

More precisely, why g(k)=mex(F(k)) ?
where
k = state
F(k)= all follower states of k, i.e. all states reachable from k in one move.

Why mex? Why not any other operation? How was it discovered, that grundy number finding needs this operation?

Intuitive answers would be appreciated.

1

There are 1 best solutions below

0
On BEST ANSWER

I don't know exactly what definitions/presentation of Grundy numbers you're used to, but I'll try to explain the key ideas and why $\mathrm{mex}$ is natural.

Preliminaries

All games are two-player perfect-information games where you lose when you can't make a move, with a bound on how long they will last.

Instead of "state", I'll use the standard term "game" to refer to a particular game state, and "options" to refer to what the OP has called "follower states". Two games $G$ and $H$ can be combined together as $G+H$: a game in which you move in either $G$ or $H$, so the options are of the forms $G'+H$ and $G+H'$, where $G'$ is an option of $G$ and $H'$ is an option of $H$.

Two games $G$ and $H$ are "equal" if for all games $X$, $G+X$ and $H+X$ have the same outcome (e.g. both first-player wins or both second-player wins).

The game "a nim heap of size $n$" (written $*n$) is recursively defined to be a game whose set of options is $\{*0,*1,\ldots,*(n-1)\}$.

Argument

Suppose that $G$ is a game similar to $*n$, but with extra moves to higher nim heaps (no move to $*n$). For example, maybe the set of options of $G$ is $\{*0,*1,\ldots,*(n-1),*(n+1),*(n+5),*(n+17)\}$. We want to argue that $G=*n$. Note that if, during the course of a game $G+X$, someone moves in $G$ to something above $*n$, then the opponent can "reverse" that move by moving it back to $*n$ (since $*n$ is an option of $*(n+5)$, etc.).

Therefore, if a winning strategy for either player in $G+X$ would involve a move unique to $G$, they may as well skip past the reversal and move to something in $\{*0,*1,\ldots,*(n-1)\}$. In the other direction, if a player can win in $*n+X$ then they can win in $G+X$ by making the same move in $G$ or $*(n+5)$ or whatever that they would in $*n$.

So a game like $G$ where the options are all nim heaps, and mex of the sizes of the nim heaps is $n$, is actually equal to $*n$. Assuming the easy theorem that you can replace options with equal games and arrive at an equal game, the Sprague-Grundy theorem follows immediately from induction and this observation, since a game guaranteed to end in zero (or one) moves is exactly a nim heap.