Unexpected hanging paradox

It was first introduced to the public in Martin Gardner's March 1963 Mathematical Games column in Scientific American magazine.

Everything the judge said came true.Other versions of the paradox replace the death sentence with a surprise fire drill, examination, pop quiz, A/B test launch, a lion behind a door, or a marriage proposal.

[1] Formulation of the judge's announcement into formal logic is made difficult by the vague meaning of the word "surprise".

[1] An attempt at formulation might be: Given this announcement the prisoner can deduce that the hanging will not occur on the last day of the week.

[6] Using an equivalent form of the paradox which reduces the length of the week to just two days, he proved that although self-reference is not illegitimate in all circumstances, it is in this case because the statement is self-contradictory.

Rather, what is impossible is a situation in which the hanging occurs on Tuesday despite the prisoner knowing on Monday evening that the judge's assertions S1, S2, and S3 are all true.

Further, even if the prisoner knows something to be true in the present moment, unknown psychological factors may erase this knowledge in the future.