Code for exercises about the Josephus problem from Knuth's Art of Computer Programming, Volume 1.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
Charles Reid 280fd9c3e0 moving part2 to part2_8_4 5 years ago
part2_8_4 moving part2 to part2_8_4 5 years ago
part2_11_2 update josephus part 2 (n = 11 m = 2) cases 5 years ago
tex removing old diagrams (now in part2) 5 years ago
LICENSE add mit license 5 years ago
Readme.md add readme 5 years ago
doubling.py add more josephus prob python scripts 5 years ago
josephus.py add more josephus prob python scripts 5 years ago

Readme.md

Josephus Problem (Improved)

a.k.a., The Sushi Boat Problem

There are n plates of sushi on sushi boats. Each plate of sushi is labeled 1 to n and is arranged in a linked circle of sushi boats. The sushi boats move by in a small canal in front of you.

Beginning at plate 1, you count m plates of sushi, stopping at every mth plate to eat it. When you eat a plate of sushi, you remove the numbered plate from the boat.

In what order will the plates be stacked on our plate, starting with the top plate?