CTK Exchange
CTK Wiki Math
Front Page
Movie shortcuts
Personal info
Awards
Terms of use
Privacy Policy

Interactive Activities

Cut The Knot!
MSET99 Talk
Games & Puzzles
Arithmetic/Algebra
Geometry
Probability
Eye Opener
Analog Gadgets
Inventor's Paradox
Did you know?...
Proofs
Math as Language
Things Impossible
My Logo
Math Poll
Other Math sit's
Guest book
News sit's

Recommend this site

Manifesto: what CTK is about Search CTK Buying a book is a commitment to learning Table of content Products to download and subscription Things you can find on CTK Chronology of updates Email to Cut The Knot Recommend this page

CTK Exchange

Subject: "Josephus Flavius Simple Solution"     Previous Topic | Next Topic
Printer-friendly copy     Email this topic to a friend    
Conferences The CTK Exchange Thoughts and Suggestions Topic #88
Reading Topic #88
Modular Math
guest
Aug-17-10, 11:53 PM (EST)
 
"Josephus Flavius Simple Solution"
 
   There is a much easier way to solve the Josephus Flavius puzzle than any of the webpages.

Note:
This solution references the starting position of the circle as 0!

If x is the increment and n is the total number of people, then the position on the circle is given by this formula:

-(x^(m+1)) (mod n), where m is the largest integer st x^m <= n
or alternatively
-(x^m) (mod n), where m is the smallest integer st x^m >= n


Explanation:

The position is always 0 whenever n is a power of x. This is because in the first pass around the circle all y*x positions are eliminated, second pass all y*(x-1) positions are eliminated, etc until y*(x-x) = 0 is the only position left.

If n is not a power of x, then using x^m as a starting point, where m is the largest integer st x^m < n, the position increments by x for however much n is in excess of x^m. A direct computation results in (n - x^m)*x. To prevent wraparound references (ex: the 18th position of a 13 person circle) the answer must be computed mod n. This results in:

(n - x^m)*x (mod n) = (n*x - x^(m+1)) (mod n) = -(x^(m+1)) (mod n)


  Alert | IP Printer-friendly page | Reply | Reply With Quote | Top

Conferences | Forums | Topics | Previous Topic | Next Topic

You may be curious to have a look at the old CTK Exchange archive.
Please do not post there.

Copyright © 1996-2018 Alexander Bogomolny

Search:
Keywords:

Google
Web CTK