Can anyone give me the quickest idea to solve the question below?

Read the information below and answer the question that follows.

In a mathematical game, one hundred people are standing in a line and they are required to count off in fives as "one, two, three, four five, one, two, three, four, five," and so on from the first person in the line. The person who says "five" is taken out of the line. Those remaining repeat this procedure until only four people remain in the line.

What was the original position in the line of the last person to leave?

A. 93 B. 96 C. 97 D. 98

If any one can elaborate with more similar kind of example then it will be very nice.

  • 1
    $\begingroup$ The first idea that comes to mind is to simply carry out the procedure: write down the numbers from $1$ to $100$ and cross them out as described. I suspect that this is also the quickest idea in the sense that it will be quicker to do this than to think of something better. $\endgroup$ – Chris Eagle Jun 28 '12 at 16:15
  • 2
    $\begingroup$ You may find lots of information on this kind of problem if you search for "Josephus problem". $\endgroup$ – Gerry Myerson Jun 29 '12 at 7:04

After one round, 98 becomes next-to-last in a field of 80; after the second round, 98 becomes last in a field of 64. He will remain last unless he is thrown out, that is, unless the total number of people is divisible by 5.

The number of people left after each of the successive rounds is: 52 ($64-12$); 42 ($52-10$); 34 ($42-8$); 28 ($34-6$); 23 ($28-5$); 19 ($23-4$); 16 ($19-3$); 13; 11; 9; 8; 7; 6; 5.

So person 98 is not thrown out until he reaches position 5, which means he's the last person to leave, since he is last in line.


After the first cycle, 80 people will remain.

As a result, 99th will be last.

Similarly, after the second cycle, 64 People will remain and 98th person will be the last.

Now, even after the subsequent cycles, the 98th person will not leave the queue as the number of remaining people will never be a multiple of 5.

Hence 98 is the required answer.

NOTE:- The last person leaves the queue iff, the remaining people is a multiple of 5.

Hope you understood and enjoyed the solution. Thanks for your patience to read.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.