![](https://matematizou.gradmat.ufabc.edu.br/files/Flavius-Josephus-1.jpg)
Historical context
Also known by the Hebrew name of Yosef Ben Mattityahu (Joseph, son of Matheus), Flavius Josephus was a Jewish-Roman historian who lived in the first century of the Christian era.
Around the year 66 the hatch the Jews revolt against Rome. One of the outstanding episodes of this war is the dispute over Massada, a fortress built about a century before by Herodes the Great, on the top of a mountain, in the middle of the desert.
A group of rebels managed to escape with their families from the siege of Jerusalem and took refuge in Massada. The Roman legions besieged the fortress. Improvising a ramp in a more eroded part of the mountain, they went up with assault towers.
Aware of the imminent defeat, Jair, the leader of the rebels, spoke: “We are born free and we will die free”. In Judaism, suicide is unacceptable. So each rebel went to his family and killed them. So one man killed another until one remained, who committed suicide.
With the outbreak of the revolt, circumstances lead Yosef Ben to take part in the conflict. At Jotapata, in Galilee, Yosef Ben was besieged by Vespasian’s troops with forty men in a cistern. Then he shouted, “We will do as at Masada.” But when only he and another soldier remained, Yosef convinced him to surrender. This fact, combined with acting as a negotiator with the resistance in Jerusalem and, after that, becoming a Roman citizen, with the Latin name of Flavius Josephus, and protected by the emperors Vespasian, Titus and Domitian, made him seen as a statelessness by many Jews. Ironically, the story of Massada only comes down to us through one of his texts: The War of the Jews.
It is said that the order of deaths in the Jotapata cistern was defined by lottery. What if it was up to him, as commander, to make this decision? It could define who should be the first to be executed so that in the end there was only him left. This problem became known as the Josephus Problem or Roman Roulette.
Description
In summary: from a certain number of people organized in a circle, in one direction and at an initial point, the next living person will be executed or his neighbor and so on until only one person remains. For example, let us suppose that there are 6 people on a drawing of a circular clock of points, located in the positions corresponding to the marking of 2, 4, 6, 8, 10 or 12 hours (small pointer). Assuming that the process started by the person who is in position 2h, we would have:
Sequence: 2 kills 4, 6 kills 8, 10 kills 12, continuing, 2 kills 6, 10 kills 2. The one who started the process in the position corresponding to 2 hours remains alive.
From this situation, we generalize a mathematical problem: What would be the position P of the survivor in a circle with N people if the process starts in position 1? Below, a simulation of the executions.