can anyone tell how to detect cycles in the game of nim ? for eg. if there are x coins, and two players are taking out coins alternatively, such that the one who has no choice loses........... and the number of coins allowed to take in one go are {2, 4, 5}, then the whole cycle is repeating after 7... for 1st player --
result - L W W W W W L | L W W W W W L | L W W W .... coins - 1 2 3 4 5 6 7 8 9 10 11 12 13 14 ....... similarly for choices {3, 5} i am getting a cycle of length 8... how would i come to know as to when it will start repeating ? Disclaimer : not my question, copied from net -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.