A deadly elimination game from ancient history
In the Roman-Jewish War of 67 AD, 41 Jewish rebels were trapped in a cave by Roman soldiers.
Preferring suicide to capture, they decided to form a circle and kill every third person until only one remained.
That last person would surrender to the Romans. This is their story...
The Josephus problem is named after the Jewish historian Flavius Josephus, who lived in the 1st century AD.
According to his account, during the Jewish-Roman war, he and his 40 soldiers were trapped in a cave by Roman soldiers. They chose to commit suicide rather than be captured.
They formed a circle and decided that every third person would be killed until no one was left. Josephus positioned himself so he would be the last one remaining, thus allowing him to surrender to the Romans rather than die.
This problem has since become a classic mathematical and computational problem studied in computer science and discrete mathematics.
The Josephus problem is a theoretical problem related to a certain elimination game. People are standing in a circle waiting to be executed. Counting begins at a specified point in the circle and proceeds around the circle in a fixed direction. In each step, a certain number of people are skipped and the next person is executed. The process continues until only one person remains, who is declared the winner.
Maximum value: 100 for better visualization
Every k-th person is eliminated
Simulation not started