1000 people are standing in a circle, each has a name , 1,2,.. to 1000. 2 is on the right of 1, 3 on the right of 2 .. and so on, and finally, on right of 1000 is again 1. 1 has a sword. He kills 2 and hands over the sword to 3, 3 kills 4 and hands it to 5, and so on. Then 999 kills 1000 and hands it to 1. 1 then kills 3 and gives it to 5 and this process keeps on continuing. So, which number lasts in the end ?
this is like the open-close door thingy
so i would say the ones in the end are the ones with numbers that are perfect squares
what is open-close door thingy? :|
i am not sure it is the open closed door problem
for example, if instead of 1000 there are 10, i think the last person standing is 5 (if i read the question correctly)
all the even numbers are knocked out on the first go around
it does look like it. it looks like 1 is open. 2 is close. 3 is open. and so on
then every other odd number starting with 3
here is one version of the door problem, sometimes instead it is lights turning on and off http://www.techinterview.org/post/526370758/100-doors-in-a-row
5 would have been right for 10 people.
i think (although i certainly could be wrong) that the difference here is no one comes back to life
yes, no one comes back to life .-.
whereas in the doors they open and shut repeatedly
well being a bonehead i have tried it with 10, 12 and 14 and got 5, 9 and 13 respectively so no pattern has jumped out at me yet
and 16 leaves me with 1
looks 1 wil stay alive as long as 'total group count' is even
i don't think so
when i did it with 10, 5 was left
i know for sure 1 is a survivor though
after the first round there is nothing left but odd numbers. On the second round, every other odd person is gone, so would you just keep dividing by 2 till you get to the last number ?
i mean, when we do with 10 1 wil stay alive first round cuz 10 is even 1 will die second round cuz 10/2 = 5
ooh
oh wait. that was the answer...my answer is 1...since no one can kill 1...i think
1 is not right.
aw
yeah one always stays around for the first pass, evens go
with 1000, he wil stay alive till the group count becomes 125
moving right along... 10 : 5 12 : 9 14 : 13 18 : 1 20 : 9
22 : 13
missed 16 ?
16 : 1
There is probably a formula for this
i think i made a mistake somewhere
10: 5 12 ; 9 14 : 13 16 ; 1 18 ; 5 20 ; 9 22 : 13
24 : 17 hmm maybe it is coming ...
10 to 30 :-
no pattern really
I perhaps see a pattern is it 31 : 31 and 32 : 1 ? I am just predicting on the basis of a pattern. Please confirm ?
looks pretty patterny is 32 : 1 ?
Correct !!
oh, what @shubhamsrg said
hmm for powers of 2, it comes back to 1 !! and increment of 2 takes place after that!
so 1 at 512 , and 1024 guess we should take case of 1024 and try to revert back ?
nah, with 512 is easier
wow !
start over at powers of 2
488 terms after 512 so final ans is 488*2 +1 = 977 voila! that is correct! too good.
man i am late in the game
of course the real question is not 'what' but "why"
I had asked the same question 1 year ago. a programming solution was proposed then. thats how i know 977 is the right ans. http://openstudy.com/users/shubhamsrg#/updates/4ff72322e4b01c7be8c9ee6a
I agree...its is 977.........check it out http://tierneylab.blogs.nytimes.com/2009/07/09/solutions-and-prizes-for-the-circle-of-fire-problem/
but why does it start over at powers of 2? knowing that, it is not that hard
cool !
maybe because no. people get half after every round. Thus 2 must have some relation to this :|
I construct the series of numbers: 1 round: 1,3,5,7,9,......... with different is 2= 2^1 2nd round: 1, 5,9,13..... with different is 4 =2^2 3rd round : 1,9,17,25,......with different is 8 =2^3 4th round : 1,17,33,49,.........with different is 16 =2^4 so, it may relate to 2 from that??
Join our real-time social learning platform and learn together with your friends!