6 views

Uploaded by sidky

save

You are on page 1of 2

**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

- Sapiens: A Brief History of HumankindYuval Noah Harari
- The Unwinding: An Inner History of the New AmericaGeorge Packer
- Yes PleaseAmy Poehler
- Dispatches from Pluto: Lost and Found in the Mississippi DeltaRichard Grant
- Elon Musk: Tesla, SpaceX, and the Quest for a Fantastic FutureAshlee Vance
- The Innovators: How a Group of Hackers, Geniuses, and Geeks Created the Digital RevolutionWalter Isaacson
- John AdamsDavid McCullough
- Devil in the Grove: Thurgood Marshall, the Groveland Boys, and the Dawn of a New AmericaGilbert King
- A Heartbreaking Work Of Staggering Genius: A Memoir Based on a True StoryDave Eggers
- This Changes Everything: Capitalism vs. The ClimateNaomi Klein
- Grand Pursuit: The Story of Economic GeniusSylvia Nasar
- The Emperor of All Maladies: A Biography of CancerSiddhartha Mukherjee
- The Prize: The Epic Quest for Oil, Money & PowerDaniel Yergin
- Team of Rivals: The Political Genius of Abraham LincolnDoris Kearns Goodwin
- The New Confessions of an Economic Hit ManJohn Perkins
- The World Is Flat 3.0: A Brief History of the Twenty-first CenturyThomas L. Friedman
- Rise of ISIS: A Threat We Can't IgnoreJay Sekulow
- Smart People Should Build Things: How to Restore Our Culture of Achievement, Build a Path for Entrepreneurs, and Create New Jobs in AmericaAndrew Yang
- The Hard Thing About Hard Things: Building a Business When There Are No Easy AnswersBen Horowitz
- How To Win Friends and Influence PeopleDale Carnegie
- Steve JobsWalter Isaacson
- Angela's Ashes: A MemoirFrank McCourt
- Bad Feminist: EssaysRoxane Gay

- The Light Between Oceans: A NovelM.L. Stedman
- Leaving Berlin: A NovelJoseph Kanon
- The Silver Linings Playbook: A NovelMatthew Quick
- The Sympathizer: A Novel (Pulitzer Prize for Fiction)Viet Thanh Nguyen
- Extremely Loud and Incredibly Close: A NovelJonathan Safran Foer
- You Too Can Have a Body Like Mine: A NovelAlexandra Kleeman
- The Incarnations: A NovelSusan Barker
- Life of PiYann Martel
- The Love Affairs of Nathaniel P.: A NovelAdelle Waldman
- A Man Called Ove: A NovelFredrik Backman
- Bel CantoAnn Patchett
- The MasterColm Tóibín
- We Are Not Ourselves: A NovelMatthew Thomas
- The First Bad Man: A NovelMiranda July
- The Rosie Project: A NovelGraeme Simsion
- The Blazing World: A NovelSiri Hustvedt
- The Flamethrowers: A NovelRachel Kushner
- Brooklyn: A NovelColm Tóibín
- Wolf Hall: A NovelHilary Mantel
- The Art of Racing in the Rain: A NovelGarth Stein
- The WallcreeperNell Zink
- Interpreter of MaladiesJhumpa Lahiri
- Beautiful Ruins: A NovelJess Walter
- The Kitchen House: A NovelKathleen Grissom
- The Perks of Being a WallflowerStephen Chbosky
- The Bonfire of the Vanities: A NovelTom Wolfe
- Lovers at the Chameleon Club, Paris 1932: A NovelFrancine Prose
- My Sister's Keeper: A NovelJodi Picoult
- A Prayer for Owen Meany: A NovelJohn Irving
- The Cider House RulesJohn Irving