Have you heard of the Josephus problem? Essentially it is a bit of maths, rooted in a real historical situation. Consequently, it is a little bit gruesome (from the history, not the maths) so look away now if you are of a sensitive disposition.
Still here? The historical situation was the culmination of the Siege of Yodfat in AD 67. Josephus was among a handful of beleaguered Jewish soldiers who agreed that they would rather kill themselves rather than be captured by the approaching Roman army. It turns out that the historical details are a bit fuzzy but Josephus did make it out and survived until AD 100. Yesterday though I was watching a video that examined the scenario as a mathematical teaching aid in the art of working out a formula from observations.
The problem was stated in the form that the soldiers sit in a circle. Rather than kill themselves directly and risk an unknown number of failures, or leave all the murder to one person, a deadly protocol is established. The first person slays the soldier to their left. The next living soldier kills the person to their left and so on until finally one person is left standing who must take the risk of killing themselves. You put yourself in the place of Josephus who, in this version, actively doesn’t want to die and thus plans to be the last person standing and therefore the one who can change his mind and surrender (in his own account, the last two people chose not to die and Josephus attributes his survival to divine providence).
If you run the numbers for small circles, it soon becomes apparent that being the first person is sometimes a good move but no simple pattern will let you calculate the optimal position for a circle of X members. You can, however, make some observations – being in an even numbered seat is bad because they get slaughtered by the odd number seats on the first pass. For a fascinating exposition of how to work out where to sit see this video:
Oh, and as the video explains, this is one problem that is easier to solve in binary!