You are on page 1of 2

# Definition

Let nimsumd (a, b, c, . . .) be defined as the sum of binary representations of
a, b, c, . . . in base d.
Let a zero − positiond be defined as a heap state, whose nimsumd is 0.
If X = xk−1 xk−2 . . . x0 , then let us define X = xk−1
¯ xk−2
¯ . . . x¯0 , where x̄i =
d − xi .

Prove that, given heaps H = {h1 , h2 , . . . , hn }, if you can take any
number of chips from any l heaps, and add d − l − 1 heaps of arbitrary
values, it is always possible change the state to a zero − positond .
Proof. If n ≤ l, the prrof is trivial. We can remove all heaps, and can make the
sum 0.
For n > l, an inductive proof will be presented.

Base Case 1 (l=0)
If l = 0, d−1 heaps can be added. let nimsumd (h1 , h2 , . . . , hn ) = rk−1 rk−2 . . . r0 ,
where rk−1 6= 0. So, for all i, 0 ≤ ri ≤ d − 1. Let, r0 = rk−1 rk−2 . . . r0 . For all
i, 0 ≤ r̄i ≤ d − 1. Now select any ri heaps that will can added, and set their ith
bit 1. So, nimsumd of the heaps to be added will be r0 . So, by adding them
with the existing heaps, the nimsumd will be 0. thus base is proved. Moreover,
all the heaps to be added will have value between 0 and 2k−1 − 1.

Induction
l heaps can be altered, and d−l−1 heaps can be added. Let the nimsumd (h1 , h2 , . . . , hn ) =
rk−1 rk−2 . . . r0 , where rk−1 6= 0.
If, for all i, ri ≥ (d − (d − l − 1)) or ri ≥ l + 1 we can compute the
nimsumd (h1 , h2 , . . . , hn ) and use the process similar to the one used in the
base case, to make it a zero − positiond .
If, for some i, ri ≤ l, let j = {max i|ri ≤ l}. For all i > j. the sums in
the corresponding positions can be nullified using the methods in the previous
paragraph. For j th bit, there will be at least rj heaps, whose binary represen-
tation has the j th bit set. Select any rj of them. We can unset that bit, by
taking some chips from those heaps. Now, remove those heaps, make a new set
of heaps from the remaining n − rj heaps, taking only the last j bits. Let this
set be called H 0 . Now, by induction, H 0 can be changed to a zero − positiond ,
with l − rj heaps to alter, and d − l + rj − 1 heaps to add. Since, by induction,
the added hepas will have value between 0 and 2j−1 − 1, they can be used to
the heaps just altered. So, the state will be changed to a zero − sumd

Prove that, given heaps H = {h1 , h2 , . . . , hn }, if current position is
a zero − positiond , it won’t be possible to reach zero − positiond by
altering at most d − 1 heaps.
Proof. if reaching a zero − positiond is possible, let the altered heaps be (ha1 , ha2 , . . . , hak )
where 1 ≤ k ≤ d − 1. Let j be the most significant bit where, the altered heaps

1
differ with their original position. Since, originally the nimsumd was 0, the
nimsumd at bit j was zero either. If p bits were set, and q bits were unset
originally at the bit j, altered heaps will have exactly same number of set and
unset bits. So, there will be two different case:

1. The bits at bit j will remain the same as the originial heaps. In that case,
j can not be the most significant bit
2. There has to be one bit, which was originally 0, and 1 in altered heap. In
that case, some bit at position j 0 > j has to be altered, so, j is not the
most significant bit.

If j is not the most significant altered bit, we can use the same argument to
show that, for all j 0 > j, it won’t be possible for j 0 to be the most significant
altered bit. The only way it is possible to be the new state a zero − positiond
will be if the altered heaps are 0, which is an illegal move. So, by contradiction,
it’s not possible to reach a zero − positiond , from a zero − positiond .

2