The question
A judge tells a condemned prisoner that he will be executed at noon on one weekday of the following week, and that the execution will be a surprise. The prisoner reasons that it cannot happen on Friday, because if he survives until Thursday night then Friday would be forced and therefore unsurprising. Eliminating Friday, he then eliminates Thursday, then Wednesday, and so on, concluding that the execution cannot happen at all. Yet when the executioner arrives on Wednesday, he is genuinely surprised. Where did the logic break?
Why the backward argument feels convincing
Each step seems to use a reasonable idea: if only one day remains, then the prisoner should be able to predict the execution. That appears to violate the judge's promise of surprise, so the last day is ruled out. From there, the prisoner tries to repeat the same reasoning one day earlier, and the chain continues backward.
The trouble is that the argument assumes the prisoner can continue treating the judge's prediction as reliable even after his own reasoning would imply that the prediction is impossible. In other words, he uses the prediction as a premise inside an argument whose conclusion is that the prediction cannot be fulfilled.
The flaw
The very first elimination already depends on a delicate notion of what counts as "knowing" the date in advance. If the prisoner were to deduce on Thursday night that the execution must happen on Friday, then he would simultaneously be living in a world where his earlier blanket conclusion, namely that no execution can occur, has already failed. The reasoning is not stable under its own consequences.
Once the chain starts undermining the reliability of the prediction it is using, the later steps lose their force. The judge can still speak truthfully because the prisoner's attempted proof of impossibility does not translate into genuine foreknowledge of the actual day.
Takeaway
The prisoner's logic fails because it treats surprise, prediction, and self-reference as if they were ordinary facts that can be iterated backward without instability. They cannot.