First I will state the paradox, then I will state the solution.
The Paradox: On Sunday, judge condemns Smith to be hanged some day the subsequent week on or before Friday, with the qualification that the day of the hanging will be a surprise to Smith. Smith deduces that he will not be hanged, his reasoning being as follows. He cannot be hanged on Friday, since, if he makes it to Friday, it won’t be a surprise to him that he is to hanged on that day. Nor therefore can be hanged on Thursday, since Friday has already been ruled out and since, if he makes it to Thursday, a Thursday-hanging won’t be a surprise to him. Nor, by parity of reasoning, can Smith be hanged on Wednesday, Tuesday, or Monday. So Smith won’t be hanged at all. But Smith can be hanged under these circumstances.
The Solution: The solution to this paradox lies in the fact that ‘surprise’ is a relative term: what is a surprise to one person may not be a surprise to another; and what is a surprise to a person at one time may not be a surprise to him at a later time. When the judge tells Smith that the day of his hanging will be a ‘surprise’ to him, he is correctly saying that until the day of his hanging, Smith will not have enough information to determine the day of his hanging. And the judge is right. Smith does not have enough information now to know when he will be hanged. And if he is hanged on Monday, he won’t have the requisite information until Monday. Same with Tuesday, Wednesday, Thursday, and Friday. For any given day of the week, Smith will not know until that day whether or not he will be hanged on that day. So until the very day it occurs, Smith’s hanging is indeed a surprise to him, it being irrelevant that on that day Smith ceases to be surprised, since by then the surprise has in effect already occurred.