1 0 0 people stand in a circle in an order 1 to 1 0 0 . The first person has a sword and he kills the next person on his right (the second person) and gives the sword to the following right person (third person). All person do the same until only 1 person survives. Which number was that?
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.
WOW! +1
Generalization: If there n people, then the lone survivor is the [ 1 + 2 ( n − 2 ⌊ lo g 2 n ⌋ ) ] th person
Log in to reply
That's incorrect! It'll always give the answer as 1 which is wrong. Re-check your formula.
Log in to reply
Man ..... its correct
I know where you made a mistake ⇒ [ 1 + 2 ( n − 2 ⌊ lo g 2 n ⌋ ) ] th
Here we have to take highest integral function of ⌊ lo g 2 n ⌋
Great.....thank you so much
Does it work if it's not 2?
Woah cool! One wouldn't have thought of it this way! :P
Let's solve this using pen and paper.
Firstly,
We have all the numbers (let, 101 is 1 in the circle):
1, 2, 3, 4, 5, 6, 7, . . . . . . . . . . . . 97, 98, 99, 100, 101
1 has the Sword, Common difference 1.
Secondly,
Cutting all the numbers of even positions (divisible by 2) we have:
1, 3, 5, 7, 9, 11, . . . . . . . . . . . . 95, 97, 99, 101
1 has the Sword, Common difference 2.
Thirdly,
Cutting all the numbers of even positions (if n-1 is divisible by 4 then they remain, others will be cut) we have:
1, 5, 9, 13, 17, . . . . . . . . . . . . . . . 93, 97, 101
1 has the Sword, Common difference 4.
Fourthly,
Cutting all the numbers of even positions (if n-1 is divisible by 8 then they remain, others will be cut) we have:
1, 9, 17, 25, 33, . . . . . . . . . . . . . . . 89, 97
Here, 101 is eliminated. So we do not have 1 anymore. Actually we have (let 105 is 9 in the circle):
9, 17, 25, 33, . . . . . . . . . . . . . . . 89, 97, 105
9 has the Sword, Common difference 8.
Fifthly, Cutting all the numbers of even positions we have:
9, 25, 41, 57, 73, 89, 105
9 has the Sword, Common difference 16.
Sixthly,
We have a small series now and we can easily see what will happen. Cutting even position numbers we get:
9, 41, 73, 105
9 has the Sword, Common difference 32.
Seventhly,
Cutting even position numbers we get:
9, 73
105 is no more. So we do not get 9 here. It has already been cut by 73.
Finally,
We got the number 73 that will survive :-)
Though it is long but can be a solution.
Problem Loading...
Note Loading...
Set Loading...
Consider 2 people standing, and N o . 1 has sword. Of course he will be last survivor.
If 4 people are standing then again the N o . 1 will be the last survivor. (You can observe it).
Hence it can be concluded that if 2 n people are standing in a circle then the person having the sword for the first time will the ultimate survivor.
Let's use this newly found technique to the given problem.
We see that we have 1 0 0 people, if we kill 3 6 of these people than we will be left with 6 4 survivors. The person having the sword when 3 6 people are killed will be the ultimate survivor.
It can be easily seen that 7 3 r d person will be the ultimate survivor.