0
$\begingroup$

I started learning nim sum, the examples given in class were all two number kind of problem. What should I do with this kind of problem?

$\endgroup$
3
  • $\begingroup$ Try computing small values ($n=2,3,4$, say) by hand. You will see a pattern. $\endgroup$
    – TonyK
    Sep 24, 2014 at 4:30
  • $\begingroup$ Is the pattern just 2^n ? how should i express my answer ? $\endgroup$ Sep 24, 2014 at 4:54
  • $\begingroup$ What is the nim-sum of $1, 2, 3, 4, 5, 6,$ and $7$, for instance? $\endgroup$
    – TonyK
    Sep 24, 2014 at 7:17

1 Answer 1

0
$\begingroup$

So the nim-sum of any amount of numbers is determined by taking the binary representation of the numbers and where theres an odd number of 1's you take put a 1 and an even number you put a zero. So for example with:

1001
1111
0101

Our result is 0011 because we have 2 1's in the eights digit, 2 1's in the fours digit, 1 1 in the 2's digit, and 3 1's in the ones digit.

Let us write out the binary representations for the numbers up to n=3 for the original problem.

001
010
011
100
101
110
111

Note that we have an even number of digits in each slot, so the nim-sum is 0. This pattern continues for all n>1, where the nim-sum is 0.

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .