# Unexpected hanging paradox

The unexpected hanging paradox is as follows:

A judge tells a condemned prisoner that he will be hanged at noon on one weekday in the following week but that the execution will be a surprise to the prisoner. He will not know the day of the hanging until the executioner knocks on his cell door at noon that day.

Having reflected on his sentence, the prisoner draws the conclusion that he will escape from the hanging. His reasoning is in several parts. He begins by concluding that the "surprise hanging" can't be on Friday, as if he hasn't been hanged by Thursday, there is only one day left - and so it won't be a surprise if he's hanged on Friday. Since the judge's sentence stipulated that the hanging would be a surprise to him, he concludes it cannot occur on Friday.

He then reasons that the surprise hanging cannot be on Thursday either, because Friday has already been eliminated and if he hasn't been hanged by Wednesday night, the hanging must occur on Thursday, making a Thursday hanging not a surprise either. By similar reasoning he concludes that the hanging can also not occur on Wednesday, Tuesday or Monday. Joyfully he retires to his cell confident that the hanging will not occur at all.

The next week, the executioner knocks on the prisoner's door at noon on Wednesday — which, despite all the above, was an utter surprise to him. Everything the judge said came true.

From this I ask:

1. How is it that despite the prisoner's sound logic, the judge is correct just the same?
2. Assuming the prisoner is a logician, is it even possible for the judge to be wrong?

## 8 Answers

The biggest problem with the prisoner's proof is that his model is incomplete. One piece of that is that it merges two key variables - days on which the execution can happen, and days on which the prisoner believes it possible to happen. It's easy to see why these two were merged - because of the requirement of surprise, they are strongly correlated. However, by believing it impossible for the execution to happen on a particular day, he in fact makes it possible for it to happen on that day.

Understanding this shows where his proof falls apart. He believes that there is no alternative to his being executed by Friday at the latest, which means that he cannot be executed on Friday. However he ends up concluding that he will not be executed at all, which means that there is now an alternative to his being executed by the last day. Thus the basis of his proof is invalidated. Of course he doesn't realize this, so he confidently believes the set of days on which he could be executed to be empty, which allows the set of days on which he can be surprised by being executed to be all weekdays of the following week.

Unfortunately for the prisoner, if he were a perfect logician he would realize that there is no stable solution for which he knows any information about which days he might be executed on. Again, this is because the possibility of being executed on a given day is tied to his knowledge of it. If he comes to the conclusion that he will be executed on a particular day, it wouldn't be a surprise, meaning that he won't be executed on that day, but by knowing he won't be executed on that particular day it means he can be executed on that day. Thus any knowledge about being executed on a particular day is inherently unstable, meaning that he doesn't actually have any knowledge about what will happen.

Fortunately for us, our knowledge of the prisoner's execution date does not affect the possibility of his being executed on that date. This allows us to use a complete model to represent what is happening. We know based on the prisoner's proof that he believes he will not be executed. So as I stated before, because the set of days on which he believed he could be executed was empty, he would have been surprised on any of the days.

• You sound like the prisoner could think differently and this would break the paradox (judge would like). Do you? – klm123 Sep 22 '14 at 21:15
• Good point. Not expecting it to happen on Friday by deduction of logic is making Friday a perfectly valid day to be executed and be surprised. If he had taken this into consideration, he would have realized that any day is a valid day to be executed. – Neil Sep 23 '14 at 7:41
• @Neil, it is important to note, that this would not help him and the judge would be still correct in all his sentences. – klm123 Sep 23 '14 at 7:45
• @klm123 I suppose it is besides the point if it helps him or not. Realizing that the execution could happen whenever still makes it a surprise, even if he's familiar with the unexpected hanging paradox. Judge can be telling the truth and always be right, if we're assuming the prisoner is a logician (obviously if not, prisoner could falsly assume it is going to happen on Wednesday, and it may in fact be Wednesday). – Neil Sep 23 '14 at 7:50
• @Neil, if prisoner is logician he can't conclude that execution can happen whenever, he can't conclude anything, because all logical conclusions are contradictory. This is the point. For example, what if execution would be planned on Friday, can he assume that it can happen whenever at Thursday evening? Once you answered this question you can ask what he would assume on Wensday... and understand that you go in circles from one conclusion to another. You can chose different points to stop (wiki explanation, or this answer) but you still will be on this circle. I hope you understand what I mean. – klm123 Sep 23 '14 at 10:07

The simple (and I believe the only) answer to both your questions is "This is a paradox, so logic does not have predictability power here".

Martin Gardner described this paradox in detail. Unfortunately, I can't find the English version online, but if you know Russian, you can find it here (The English Google translation is here). The English version should be in his book The unexpected hanging and other mathematical diversions.

P.S. The paradox is most extreme and easier to feel in the 1-day version (A judge tells a condemned prisoner that he will be hanged at noon tomorrow but that the execution will be a surprise to the prisoner).
The formulation stays the same: "He begins by concluding that the "surprise hanging" can't be tomorrow - it won't be a surprise. Since the judge's sentence stipulated that the hanging would be a surprise to him, he concludes it cannot occur tomorrow. Joyfully, he retires to his cell confident that the hanging will not occur at all. The next day, the executioner knocks on the prisoner's door — which, despite all the above, was an utter surprise to him. Everything the judge said came true."

• @EnvisionAndDevelop, this paradox usually leads to super-huge discussions, so I just tell you that according to official version there is. – klm123 Sep 22 '14 at 14:39
• Can these questions not be answered by using the fallacy in the paradox? – Neil Sep 22 '14 at 14:40
• @Neil, you mean to say "judge can lie"? Then there won't be a paradox, this would be different situation. "Judge always tells truth" is a part of the paradox formulation as everything else. – klm123 Sep 22 '14 at 14:47
• @EnvisionAndDevelop, all the same: "He begins by concluding that the "surprise hanging" can't be on tommorow - it won't be a surprise. Since the judge's sentence stipulated that the hanging would be a surprise to him, he concludes it cannot occur tommorow. Joyfully, he retires to his cell confident that the hanging will not occur at all. Tommorow, the executioner knocks on the prisoner's door — which, despite all the above, was an utter surprise to him. Everything the judge said came true." – klm123 Sep 22 '14 at 15:49
• It goes like this: The prisoner resons that the juge must have lied either by saying he will be hanged or by saying it will be a surprise. So he hasn't a clue which way it will be. Therefore, when he is hanged, it is a surprise. The paradox is that in the end, the juge was right on both counts. – Florian F Sep 22 '14 at 16:20

The other answers have addressed your first question. This is a somewhat cheeky answer to your second question.

You ask:

1. Assuming the prisoner is a logician, is it even possible for the judge to be wrong?

All that is needed for the judge to be wrong is for the prisoner to not be surprised.

Having reasoned that discounting the days from Friday backwards leads to a contradiction with the judge's statement that the prisoner will be hanged (and consequently, him being surprised regardless of which day is picked), the prisoner can move to considering the surprise element more carefully.

Since he has no knowledge of the day picked for his execution, he assigns each remaining weekday an equal probability. So immediately prior to Monday, each day has a 20% probability of being picked; on Monday after noon, each day now has a 25% probability of being picked.

When the executioner comes to retrieve the prisoner on Wednesday, the prisoner has assigned a 1/3 probability to that day. Since this is the same probability assigned (at the time of the executioner's arrival) to every other remaining day, it would be illogical to be surprised. So being a perfect logician, he's not surprised that the executioner came for him on Wednesday.

Being not surprised, however, proves the judge wrong. QED

One of the main problems presented here is that his theory works one way, but not the other. The way he works it out makes sense, but let's say you did it from Monday onward. You would conclude that it could happen on Monday because there is no evidence to suggest otherwise. The same goes for the entire week.

You also have to consider that his logic on not being executed on Friday is sound, but adding on to that doesn't help. There is a one fifth chance of him being executed for each separate day of the week. Removing Friday makes this so that there is a one fourth chance of him being executed on Monday, Tuesday, Wednesday, or Thursday. Continue removing, and you end up with a 100% chance of his execution on Monday. If he uses mathematics, he could figure this out, and therefore expect it all the same. If he narrowed it down to a 50% chance on Monday or Tuesday, he wouldn't be able to correctly predict either day. The reason the judge is right is that no matter what scenario he uses, there is an equal chance of being executed on each day, and therefore it is random.

You must also look at the fact that by eliminating every day of the week, he can't expect any of them, and therefore the judge is correct no matter what day he chooses.

I believe that the judge was smart and the question incorporates human interpretation or assumption.

The judge states that the man will be executed in some day between Monday to Friday (inclusive of Monday and Friday). But he would not reveal the day to surprise the prisoner.

Now the prisoner eliminates the days and figures out that there is no day that he could be surprised. This the judge probably anticipated and rooted for.

WHAT GOES TERRIBLY WRONG is that the statement is misinterpreted by the prisoner. He assumes that just because he cannot be surprised he would not be executed, something the judge probably wanted him to feel. So no matter what day he chooses to execute the prisoner he would still be surprised.

Hence the judge outfoxed the prisoner by letting him make his assumptions. This problem clearly meant to exploit both human nature and logical reasoning and hence it is pretty famous.

Logic:

The judge said that the prisoner would be executed. He also said he would be surprised.

Join both these statements with an AND operator then only when both statements are true the prisoner will be hung.

The prisoner joined both the statements with an 'and' hence was surprised when he was called to be executed.

There are numerous things which are unclear.

In my experience of discussions of the "unexpected hanging" paradox, there is a prevalent assumption that either the judge or the condemned man is wrong, but not both; the problem is presented as if the question is "which is wrong?". I think both are wrong.

In particular, I think the judge is wrong to claim that the condemned man will be surprised by the executioner knocking on his cell door at noon on the day of the execution. How does he know? Given the paradoxical evidence, what makes the judge so confident of how exactly the condemned man will resolve the paradox, if at all?

What constitutes evidence that the judge was wrong? By the wording of the question, if the executioner turns up but this does not surprise the condemned man, then that is evidence. So, suppose that on each weekday, just before noon, the condemned man says "Good morning, Mr. Executioner. I've been expecting you."? On each day when the executioner is not there, does that make the condemned man wrong? But on the day of the hanging, does that make the judge wrong?

In statements of the paradox that I have read, where someone narrates the story of what happens after the judge's decree, the narrator says that, one day, the executioner turns up, to the condemned man's surprise. The narrator then implies that the judge's decree is seen to be correct. This implication is invalid. That decree is tantamount to the general claim that, in every possible scenario, the executioner's arrival would surprise the condemned man. Even if the executioner's arrival turns out to surprise the condemned man in the real scenario, that is just one particular instance, & it does not prove the judge's general claim.

When the judge speaks to the condemned man, is the date of the execution set, & does the judge tell him this? If not, then the condemned man is wrong to argue "Suppose my execution is set for Friday. Then..." and similarly for the other days.

The paradox can be recast as the following game (it's easier to play & doesn't entail any inconvenient corpse-disposal). One player (the judge) takes 5 cards, one of which represents the hanging (for added realism, use a tarot pack & make one of them Le Pendu). As the previous paragraph suggests, there are actually two variants. In one, this player shuffles them; in the other, the player secretly looks at them. In each case he deals them face down in a row. Then, for each card in turn, he asks the other player (the condemned man) whether he wants to choose it. Then the judge turns that card face up.

• If it's the "hanging" card, then if the condemned man chose it, he wins (for proving that the judge was wrong to say that the hanging would surprise him) but if not, the judge wins.
• Otherwise, if the condemned man chose it, he loses for having made a wrong choice, but if not, the judge proceeds to the next card, if any.

What's the probability of the condemned man winning?

I make it 1/5 in both variants. Judge and condemned man were both a bit wrong, but the judge was less wrong than the condemned man.

The key to this paradox is an ambiguous meaning of the terms "KNOW" and "SURPRISE".

Judge and prisoner give this these terms completely different meaning, and it's the judge who actually decides when to execute the prisoner, so his terms win. The fact that prisoner came to wrong conclusions, comes from his initial misunderstanding of what judge meant by "SURPRISE", and "will not KNOW"; and the judge didn't bother to clarify himself.

Life is not a logical circuit. You can use all logic in the world to calculate when the money SHOULD be in the bank, but after all your correct calculations it still may not be there. Something can still happen that obliterates your logical calculations. In other words, logical calculations in real life never cover the full decision model, and therefore, never can predict with 100% probability what would happen. You can only KNOW that the money is in the bank, when you are INFORMED about that fact.

The judge said: "He will not know the day of the hanging until the executioner knocks on his cell door at noon that day". The judge meant: "He will not be INFORMED, and therefore, will not KNOW the day of the hanging until the executioner knocks on his cell door at noon that day." The prisoner understood it his way - "He will not be able to KNOW (to create the knowledge) by logical reasoning".

Now let's define the word "SURPRISE". If the prisoner is told by judge that he will be executed next Tuesday, then the execution will not come as a surprise. But - if the prisoner is INFORMED the same day when execution happens, that is a surprise. Period. That's a judge's definition of "SURPRISE". You can be smart, make correct logical conclusions and thus create a knowledge about what's gonna happen in the future, and therefore think that it's not going to be a surprise for you - nobody cares. It's your speculations, nothing else. You can never be absolutely sure with your logic. You can KNOW for sure only when the judge informs you.

So, of course, the execution can happen on Friday, and it will be a surprise, in judge's view, because the prisoner is informed about the execution on Friday noon. Will it really be a surprise for the prisoner, in a "normal" meaning of the term "SURPRISE" - depends on prisoner's perception, imagination, mood, and other rubbish, and it doesn't really matter.

What matters is - do we agree with judge's definition of "SURPRISE"? If not then we must admit that there is a logical contradiction in his words, so his condition cannot be realized. But, given the context, I would agree with the judge.

I think that

the prisoner may not be knowing the correct day when he was being told about his hanging by the judge. So he estimated it wrong, and thus got surprised.

• Hello, welcome to Puzzling Stack Exchange! Can you please add some explanation of why you think this? That would vastly improve this answer. Answers without explanations may be deleted. Please also note that the custom here is to spoiler answers using spoiler markdown; place >! in front of a paragraph to hide it and require a rollover to be able to see it. :) – Mithical Oct 21 '17 at 18:22