Go back to previous page
Forum URL: http://www.cut-the-knot.org/cgi-bin/dcforum/forumctk.cgi
Forum Name: College math
Topic ID: 8
Message ID: 4
#4, RE: flavius recurrsion error (I think)
Posted by Katherine on Oct-31-00 at 08:46 AM
In response to message #3
So in your notation you don't have an m=0. Which in my book says if m=0, then players are eliminated in order and the last player always wins. That would be your m=1?

We're using: Data Structures and Problem Solving using JAVA by Mark Allen Weiss. In Chapter 13 is the Josephus problem (pg 349). I heard the C++ book he wrote had the same problems. Problem 13.6 gives an algorithm for M=1 (but I like yours better, but you call it M=2). Yours and his yield the same results.

13.8 asks for the general formula for an N player game with m=2. He calls m - passes. I assumed it was recursive, but maybe not.

Anyway, thanks.

katherine