Code for exercises about the Josephus problem from Knuth's Art of Computer Programming, Volume 1.
Charles Reid 280fd9c3e0 moving part2 to part2_8_4 4 months ago
part2_8_4 moving part2 to part2_8_4 4 months ago
part2_11_2 update josephus part 2 (n = 11 m = 2) cases 4 months ago
tex removing old diagrams (now in part2) 4 months ago
LICENSE add mit license 4 months ago
Readme.md add readme 4 months ago
doubling.py add more josephus prob python scripts 4 months ago
josephus.py add more josephus prob python scripts 4 months 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?