The Josephus Flavius' problem

Peter B. Henderson · ACM SIGCSE Bulletin · 2006

You may have used the Josephus Problem as a programming assignment in one of your courses. I have been using this problem for many years in CS1 or CS2, primarily to illustrate applications of various data structures and algorithmic problem solving. The resulting "brute force" solution works, but is not elegant. Accordingly, I challenge students to analyze the problem more mathematically and use mathematical thinking to seek a more precise solution. Few students are successful. However, computer science students should develop the skills necessary to find both solutions, algorithmic and mathematical model. The latter provides an efficient solution that can be used to validate the algorithmic solution -- very important for critical systems components.

Read the paper · More papers on PaperTik