Five days is too short, but if the judge instead said you’ll die in the next month and it will be a complete surprise for you, it would be easy to execute.
Algorithm is simple, every day an executioner throws a coin. If it’s heads, prisoner lives for another day. If it’s tails, prisoner dies that day. By having 50% chance to live, if the prisoner is taken to be executed, it is a surprise for him. Now the only problem is, if by some small chance a tails wouldn’t fall in the stipulated timeframe. In the original problem, chances of that are 1⁄32. Pretty small, but non-zero. However, for 30 days it’s 10^-9, which is small enough to be pretty damn sure that the judgement will be fulfilled.
Five days is too short, but if the judge instead said you’ll die in the next month and it will be a complete surprise for you, it would be easy to execute.
Algorithm is simple, every day an executioner throws a coin. If it’s heads, prisoner lives for another day. If it’s tails, prisoner dies that day. By having 50% chance to live, if the prisoner is taken to be executed, it is a surprise for him. Now the only problem is, if by some small chance a tails wouldn’t fall in the stipulated timeframe. In the original problem, chances of that are 1⁄32. Pretty small, but non-zero. However, for 30 days it’s 10^-9, which is small enough to be pretty damn sure that the judgement will be fulfilled.