0% found this document useful (0 votes)
21 views1 page

Question

A recruiter posed a problem where 1000 people were standing in a circle, with each subsequent person killing the one after them until only one remained. The problem described the Josephus problem, where numbers are converted to binary, the most significant bit is moved to the least significant position, then converted back to decimal to determine the last surviving person would be number 977.

Uploaded by

Kunal Sekhri
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
21 views1 page

Question

A recruiter posed a problem where 1000 people were standing in a circle, with each subsequent person killing the one after them until only one remained. The problem described the Josephus problem, where numbers are converted to binary, the most significant bit is moved to the least significant position, then converted back to decimal to determine the last surviving person would be number 977.

Uploaded by

Kunal Sekhri
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

Question asked at IIM Ahmedabad Recruitment 1000 people standing in the circle. !

st person owns a sord and kill the second person., then third kill the fourth person this goes on untill one single person remain. Which number(person) it is? What was asked by Recruiter was on position would u like to stand?

977, I guess Josephus problem. Convert 1000 to binary -> 1111101000 Now move the MSB to most right hand side. So, 1111101000 gets converted to 1111010001. Convert 1111010001 back to decimal -> 977.

You might also like