Last one alive x

X X number of people stand in a circle. The value of X X is of the form 2 n 2^{n} , where n n is a natural number . There is a sword in the hand of the 1 st 1^\text{st} person, he kills the 2 nd 2^\text{nd} person and passes on the sword to the third, who kills the fourth and gives the sword to the 5th, this goes on until one person is left. At what number was that person standing at the start?


The answer is 1.

This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try refreshing the page, (b) enabling javascript if it is disabled on your browser and, finally, (c) loading the non-javascript version of this page . We're sorry about the hassle.

2 solutions

We can prove this by induction. First, n = 0 n=0 , X = 1 X=1 , clearly, as the number one is the only person, the proccess will never take place.

Now, let's suppose that for n n the survivor is the number 1. That is, when initially there are X = 2 n X=2^n people, the one who's left at the final is the 1 st 1^\text{st} person.

If there are X = 2 n + 1 X=2^{n+1} people at the beginning, after one move, all the 2 k th 2k^\text{th} persons will die as each ( 2 k + 1 ) th (2k+1)^\text{th} person kills the one who's next. Therefore, after one turn only the half of the initial people will survive, that is 2 n 2^n people, and the sword will end in 1 st 1^\text{st} 's hands. We apply our induction hypothesis, thus, 1 st 1^\text{st} person will be the last one alive.

Note that if there are X = 2 n + 1 X=2^{n}+1 , the person that survives is the 3 rd 3^\text{rd} one.

Keep it up. Nice solution. Although it's lengthy.

Rishabh Sood - 5 years ago

Log in to reply

Well, you can simply evaluate n=0, but then the problem would become really easy.

Mateo Matijasevick - 5 years ago

Huh? Even if x=2^(n+1).. 1st survives..

karan shah - 5 years ago

Log in to reply

Sorry, little typo.

Mateo Matijasevick - 5 years ago
Karan Shah
May 21, 2016

Great question.. Its easy to say that in each iteration the number of people standing are reduced to half.. So if the total number of people are 2^n then definitely the 1st man will be standing at the end.. But what if its not a perfect 2^n? This is complex.. Assuming x people standing.. X>2^n for some n.. For every extra man (x-2^n) the last standing man will kill the first one.. So the man standing will definitely be ((x-2^n)*2)+1 Hard to visualise this.. I tried to be clear but logic is one thing that cannot be made clear that easily.. Try the formula for different numbers and check.. All the best(y)

Thank you @karan shah

Rishabh Sood - 5 years ago

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...