How Many Can You Save ?
The prisoners are allowed to agree in advance on an algorithm to use, and you can assume that they all agree to follow the agreed-upon algorithm. The prisoners are NOT allowed to provide each other with any additional clues once the hats are placed on their heads. (For example, tapping shoulders or modulating their voices are not allowed.) The only information each prisoner has is the guesses for the prisoners behind them, and the hats on the prisoners in front of them. Design an algorithm for the prisoners to follow that saves the most prisoners from execution. What is the maximum number of prisoners you can guarantee to save?