Read along with the audio summary
In a circle of soldiers eliminating each other to avoid capture, the speaker notes that Josephus preferred capture over suicide and needed to calculate where to sit to be the last man living. In this episode that came out on October 27, 2016, the speaker breaks down this classic mathematical puzzle.
The puzzle of the final survivor reveals how a life or death story becomes a math problem. This is the Josephus Problem, where a set number of items, called n, are arranged in a circle, and the goal is to find the starting position of the final survivor.
Starting small unlocks complex patterns. By solving the problem for one, two, or three soldiers and recording each winning spot in a table, you can analyze the resulting sequence to discover a pattern.
This table reveals how powers of two guarantee a safe spot right at the start. Whenever the total number of soldiers is a power of two, like two, four, or eight, the pattern resets. In all of these cases, the survivor is always the person in the very first position.
Knowing that reset point leads to a general formula for any circle size. You can break any number of soldiers down into the largest power of two that fits inside it, plus whatever is left over, called the remainder. The winning position is simply two times that remainder, plus one.
A binary notation trick offers an even faster shortcut. You convert the total number of soldiers into binary, move the leading digit one to the end of the string, and convert that new binary number back into a regular decimal number to get the winning spot.
Changing your perspective can unlock elegant solutions, and representing numbers in binary transforms a complex, repetitive problem into a simple manipulation of digits. The winning solution in binary is you take the leading digit and you put it at the end.