What Is The Idea Behind Winning A Game Called Nim?
Now I've been trying to devise a strategy to beat the computer at Nim and have decided to divide the pieces into units, each unit containing at least a piece. I would force the computer to make several moves in such a way that when it's my turn, there'd be an even number of rows containing pieces of which only one row could contain more than one piece. I'd then remove all the pieces on the row containing more than one piece and this would undoubtedly guarantee me a victory. However, I'm unable to force the computer to make such a combination of moves.
Some experts have implied that if there are n pieces on the board and log₂n is an integer(or maybe there just needs to be an even number of pieces, I'm not too sure), one would have to group the pieces into 1s, 2s and 4s(the maximum number of pieces in a row is 7, so 2² is the maximum number of pieces in any of the groups). Each time the opponent makes a move, one would have to ensure that there is an even number of 2⁰s, 2¹s and 2²s on the board. Unfortunately, I'm unable to spot the rule/law/logical reason which explains why exactly this is so. Could some of you please share your insight and explain this as well as tell me if my strategy is plausible or not? I have attached two screenshots of the game, each of a different board size.