Answered step by step
Verified Expert Solution
Question
1 Approved Answer
(Java) Flavius Josephus was a famous historian of the first century, but apparently he would have lived to become famous without the exercise of his
(Java) Flavius Josephus was a famous historian of the first century, but apparently he would have lived to become famous without the exercise of his computational and mathematical abilities. A legend says that during the Jewish-Roman war he was part of a band of 41 rebels trapped in a cave by the Romans. To avoid capture, the rebels decided to form a circle and proceeded to kill every third remaining person until no one was left. However, Josephus quickly calculated where he and a friend should stand to avoid all this non-sense. This time you are asked to create a program that given two positive numbers: the number of people in the circle. the elimination number, for example, if this number is exactly two we eliminate, every second person, determines the survivor's number. Example Suppose there are 10 people in a circle and the elimination number is 2 then we proceed as follows: Start with the list 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 and initial position at 1. 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 then 5 survives
(Java)
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started