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: 2
#2, RE: flavius recurrsion error (I think)
Posted by Katherine on Oct-31-00 at 08:32 AM
In response to message #1
Dear Sir:

Thank you for responding.

If I play the game by hand (as my teacher explained it):

m=1:
pass ball from 1 to 2, two is out, 3 picks up and passed to 4, 4 is out.

series of winners for n= 1 to 10 is: 1 1 3 1 3 5 7 1 3 5 ...

ex: in a 2 player game, pass ball from 1 to 2. 2 is out so 1 wins.

m=2
pass ball from 1 to 2 who passes to 3, 3 is out, 4 picks up and passes to 5

series of winners for n= 1 to 10 is: 1 2 2 1 4 1 4 7 1 4

ex: in a 2 player game, pass ball from 1 to 2 to 1. 1 is out, 2 wins.

I also coded Weis's algorithm using datastructures for m=1 and m=2 and they matched these numbers. But I'm looking for a recursive algorithm for m=2.

I thought your partial recursive solution of the Josephus problem stated it was using m=2, but the data used in the example supports m=1. I implemented the algorithm and got m=1 data.

Look forward to your response again.

Thanks
katherine