Friday, August 21, 2015

MJ [20] Who wins III -- Composite games – Grundy numbers

Question:
Two players play a modified chess game which has K knights on a N by N chessboard. Each player chooses to move one knight in turn. The moves of a given knight are limited. Ie., if a knight is at position [i, j] , a player can only move it to [i-2,  j+1], [i-2, j-1], [i-1, j-2] or [i+1, j-2]. Given the initial positions of the K knights, determine whether the first player can win the game.

"The first player wins if and only if the XOR of all the Grundy numbers is nonzero" [2]
"the Grundy number of a one-pile version of the nim game is equal to the number of stones in the pile" [2]

Ref
[1] https://www.topcoder.com/community/data-science/data-science-tutorials/algorithm-games/
Question
[2] http://web.stanford.edu/class/cs97si/05-combinatorial-games.pdf
[3] http://letuskode.blogspot.com/2014/08/grundy-numbers.html

No comments:

Post a Comment