
Unexpected hanging paradox - amelius
https://en.wikipedia.org/wiki/Unexpected_hanging_paradox
======
panic
One way to think about this paradox is as a game with two players—a prisoner
and an executioner. The game progresses over five turns, representing the days
of the week.

On each turn, the prisoner secretly chooses whether or not they expect to be
killed on that day. Then the executioner chooses whether or not to kill the
prisoner. The game ends on the turn the executioner decides to kill the
prisoner. If the prisoner wasn't expecting to die, the executioner wins;
otherwise, the prisoner wins.

The important detail here (which is obscured by the logical perspective) is
when the prisoner is allowed to expect to die. If they're allowed to expect
their death on every single day, the prisoner can just do that and win
automatically. If they can only expect to die once, there's a situation the
usual paradoxical argument doesn't consider: that the prisoner has survived
until Thursday _but has already used their chance to expect to die_. In this
case, they know they're going to die on Friday, but there's nothing they can
do about it.

~~~
fanzhang
In this view of the world (where the prisoner can play "I expect to die today"
exactly once, there is actually not a Nash equilibrium where the executioner
is guaranteed to win.

In other words the judge's sentence can't be guaranteed to be carried out.

~~~
bluecalm
You almost always need mixed strategies for Nash Equilibrium to exist so
that's not much of a surprise that it doesn't exist if the prisoner has to
choose a pure one (expects to die exactly this day and not other days).

------
tristanj
There is a simple resolution to this "paradox": it's only a paradox if you
consider the judge's initial statement to be True. If the judge's initial
statement is False (i.e. he's lying) then the whole situation is logically
consistent. The truth table for _modus ponens_ helps clarify, both F->T and
F->F evaluate as T
[https://en.wikipedia.org/wiki/Modus_ponens#Justification_via...](https://en.wikipedia.org/wiki/Modus_ponens#Justification_via_truth_table)

The judge is saying he can predict how someone else will feel in the future
(i.e. he can predict the future), which unless he is omnipotent is a false
premise in my book.

~~~
mattdeboard
This was convincing at first. But this logic problem is predicated on the
notion judges do not conceal their intentions (iow that his initial statement
is True). There is just no point in even considering the question if the
prisoner isn't actually going to be executed.

~~~
tristanj
I should clarify. The judge is not necessarily "lying" (i.e. making a false
statement). He's making a statement which has no bearing on the future. The
judge's statement could end up being True or False. Using that interpretation
resolves the "paradox".

The question encourages you to start from a flawed premise to begin with. Why
must the judge's first statement be True? A judge cannot guarantee how someone
will feel the future. Further, why must the prisoner be surprised at the date
of his execution? If the prisoner is not surprised at his date of execution,
that is also a logically consistent situation.

The question tries to shoehorn you into an irreconcilable input state and
output state. Yes, it is a paradox if you assume the question's implied start
and end result. However if you remove the limitations implied by the question,
in the bigger picture there is no paradox.

------
zaroth
> _He will not know the day of the hanging until the executioner knocks on his
> cell door at noon that day._

I have placed a ball under one of five cups. You can check only sequentially
if the ball is under each cup.

Do you know which cup the ball is under?

If you start turning over the cups one by one, will you be surprised when you
find it?

You won’t be surprised after you’ve turned over all but one cup, if you still
haven’t found it, since you know the ball is under at least one of them.

You would be surprised if the ball was found under any of the other cups
though.

And so there are only 4 days on which you would be surprised. The executioner
knocks on Thursday and provides more data than on the prior 3 days.

The judge makes a promise he cannot keep, that no matter what day he schedules
the execution that it will be a surprise.

But how can you schedule something for the end of a finite series and still
have it be a surprise?

You can’t. So then does it follow if the usable tail of my sequence is marked
out of range, what then becomes of the 2nd to last item in the sequence?

This assumes a sequential cascade leads to the state where all possible days
have been marked out-of-range.

The simple reality is that the judge can only promise you a surprise Monday
thru Thursday. By Thursday at noon the surprise will be spoiled. And there’s a
chance that you will sit for a day knowing exactly when you will die.

~~~
p1esk
The judge makes a promise that he cannot keep, but precisely because of that,
he keeps it. Thus the paradox.

------
pieguy
Here's my take. The prisoner considers the statement "I will be hanged, and it
will be a surprise", and after "proving" it false, takes its negation "Either
I won't be hanged, or it won't be a surprise". But this is not correct. The
prisoner actually disproves the statement "I will be hanged, and it will be a
surprise no matter which day it happens". When you negate this statement, you
obtain "Either I won't be hanged, or there is a day that it would not be a
surprise", which is consistent with the outcome.

~~~
p1esk
The paradox is because the prisoner does indeed disprove the statement "I will
be hanged, and it will be a surprise no matter which day it happens", but the
statement turns out to be true (he is both hanged, and surprised no matter
what day he's hanged).

~~~
pieguy
No, it would not have been a surprise if he were hanged on Friday. The
prisoner disproves the existence of a strategy for the judge that guarantees
surprise, but does not disprove the existence of a strategy that gives the
possibility of surprise.

~~~
p1esk
It would have been a surprise if he were hanged on Friday, because he believes
he wouldn't be hanged at all.

~~~
pieguy
He cannot logically conclude that. He can only conclude that either he won't
be hanged or his hanging might not be a surprise.

~~~
p1esk
He concludes that because he assumes what the judge said is true. If we assume
that, we must reject the scenario where he gets executed without surprise.

~~~
pieguy
> he believes he wouldn't be hanged at all

> he assumes what the judge said is true

The judge says he will be hanged. Your comments are inconsistent.

~~~
p1esk
Actually, you're right. However, the paradox arises no matter what the
prisoner concludes. If he concludes that the hanging won't be a surprise, he
will be surprised by the outcome (the knock on Wednesday).

~~~
pieguy
Let me say it again in a different way. My resolution of the paradox is that
the prisoner incorrectly negates "x will happen" as "x won't happen" instead
of negating "x definitely will happen" as "x might not happen". Thus,the
prisoner cannot conclude that the hanging won't be a surprise. The prisoner
can only conclude that the hanging _might_ not be a surprise.

~~~
p1esk
It seems like you're right again, but I don't have time to think more about
this at the moment, unfortunately.

------
paulddraper
I enjoy the math versions.

"Theorem" version:

Every integer is interesting. (Otherwise, one number would be the smallest
uninteresting integer. And that would be of notable interest.)

"Paradox" version:

What is the largest number that cannot be described in fewer than 100
characters?

Or even the classic paradox by Russell
[https://en.wikipedia.org/wiki/Russell%27s_paradox](https://en.wikipedia.org/wiki/Russell%27s_paradox)

Does the set of all sets that do not include themselves include itself?

\---

The essence of all these is the malformed self-referential definition. The
surprise/interestingness/definition/inclusion is "defined" recursively in such
a way as to be actually not well defined.

~~~
JadeNB
> the largest number that cannot be described in fewer than 100 characters

Almost certainly you mean the _smallest_ number (= positive integer), no? (One
doesn't automatically expect that the existence of some positive integer
satisfying a property means that there is a _largest_ such.)

~~~
paulddraper
Oops.

Yeah, smallest.

------
iforgotpassword
Of all those paradoxical thought experiments, this is still my favorite, or
really high up at least. Maybe because I've heard it at a young age and my
little brain was all flabbergasted. The impression must have lasted.

~~~
mehrdadn
> Maybe because I've heard it at a young age and my little brain was all
> flabbergasted. The impression must have lasted.

That rhyme definitely wasn't something I would've forecasted...

~~~
EGreg
Martin Gardner popularized this one, I remember coming across it as a kid!

What, did you expect me to rhyme with the line that's last, Ted?

------
dooglius
If the prisoner convinces himself on each day, “I will be hanged today,” then
it is not be possible to surprise him. Paradoxes like this tend to make
implicit use of assumptions regarding perfect rationality, deduction, and
common knowledge, and I think the underlying problem here comes from a
violation regarding these.

------
mcphage
If the prisoner considers “I won’t be hung at all” from the start, his
argument falls apart on its first day—on Friday he could still be surprised,
since he doesn’t know if he’ll be hung at all. Thus getting hung would still
be a surprise.

~~~
philippeterson
Yes. He essentially opts out of his escape, because he's withdrawn from being
safe by changing his expectations.

------
whack
The prisoner's anticipated response seems entirely irrational here. There are
a range of possible outcomes the prisoner faces:

\- Will not be hung this week

\- Will be hung on Monday

\- Will be hung on Tuesday

\- Will be hung on Wednesday

\- Will be hung on Thursday

\- Will be hung on Friday

You can use logic in order to determine that each of the above outcome is
logically impossible. But once you've ruled out all possible outcomes as being
"impossible", why would the prisoner stubbornly believe the very first outcome
to be true. It too contradicts what the Judge had explicitly said. In such a
situation, the prisoner should consider that all 6 possibilities have some
significant likelihood of being true, since they all deviate from the Judge's
promise in some way. And when dealing with such a rational prisoner, the
Judge's promise is impossible to uphold.

Perhaps that is the true resolution to the paradox. The judge was able to make
and deliver on his promise, only because he correctly anticipated the
prisoner's irrational response. When dealing with a rational prisoner, it
would be impossible to uphold such a promise.

~~~
kazinator
You've nailed it. The judge's sentence contains an inconsistency, and is
therefore a falsehood; any conclusion whatsoever proceed from an
inconsistency. The judge essentially said "you will and you will not be
hanged".

------
jancsika
The judge has underspecified the process.

Judge says "on a weekday," and that it will be a surprise to the person being
executed. But the judge has not specified _which_ weekdays are actually in
play.

Now, let's attempt to specify it:

"Judge will schedule the execution for one of the following days in the
upcoming week: Monday, Tuesday, Wednesday, Thursday, or Friday. Judge will
pick one of these days at random. This random process will determine the day
of the execution, such that the person being executed will not be able to use
a process of elimination to predict the day of the execution."

Now we can see that there is no paradox, only a self-contradicting
specification.

~~~
MaxBarraclough
So your real point is the tension between _random process_ and _process such
that the person being executed will not be able to use a process of
elimination to predict the day of the execution_?

If we don't care about randomness, can't the judge just use the strategy of
_Always pick Wednesday_?

If we _do_ care about randomness, the job is to explore whether we're
guaranteed to surprise the convict, and of course we're not: if the random
process selects Friday, the convict won't be surprised.

~~~
jancsika
> If we don't care about randomness, can't the judge just use the strategy of
> Always pick Wednesday?

The point is that because the process is _underspecified_ the prisoner is
using one interpretation while the judge is using another. (Otherwise the
judge would have had to conclude that no choice could be made.) The reader
switches between the two specs in an apparent paradox without considering that
they are two different specs.

For example, the judge could simply be breaking the rule by considering Friday
as a possible choice. That is a different spec from the prisoner, and if such
a judge ended up settling on Wednesday then the prisoner would be surprised.

But here's another angle. If the prisoner logically concluded that the judge
cannot pick _any_ weekday, the judge can pick Friday and still satisfy the
requirement that the prisoner be surprised.

I think that's cheating, though, and the important part is the
underspecification.

------
throwaway2048
I've never understood why the resolution to this paradox isn't because of his
confidence he expected not to be hung, thus any hanging would be unexpected/a
suprise.

Dosent seem terribly paradoxical to me.

~~~
colanderman
Yes. The judge's statement is only valid because of the prisoner's short-
sightedness (i.e., it is a prediction, not a logical statement). If the
prisoner knows the punch line of the joke, the judge's pronouncement becomes
undecidable and therefore meaningless.

It's no different than if the judge said, "you will be hung, and this
statement is false", and the prisoner was surprised that they got hung.

Heck, even if the prisoner _doesn 't_ know the punch line, the judge's
statement is invalid if they incorrectly judge the depth of the prisoner's
thought. The prisoner could stop their logical reasoning after 2 days instead
of 5, and be sure that they're being hanged Wednesday, making the judge's
prediction false.

In summary: the judge made (intentionally or not) a prediction; the prisoner
interpreted the prediction as a logical statement; the prisoner failed to see
that the statement is undecidable, and drew a logical conclusion from it; the
conclusion the prisoner drew happened to make the prediction true.

------
kazinator
Straightforward contradiction spoken by the judge, from which anything
whatsoever follows.

The statement "you will be hanged on a weekday next week" which we can express
as

    
    
       H(weekday)
    

means precisely this:

    
    
       H(F) or H(Th) or H(W) or H(Tu) or H(M)
    

The statement "you will not know until the knock on the door whether you are
hanged on that day" means exactly this:

    
    
       ~H(F) and ~H(Th) and ~H(W) and ~H(Tu) and ~H(M)
    

Well, no, not quite! It only has that meaning conditionally. That is to say:

    
    
       H(weekday) -> ~H(F) and ~H(Th) and ~H(W) and ~H(Tu) and ~H(M)
    

By De Morgan's, this right side rearranges to:

    
    
       H(weekday) -> ~(H(F) or H(Th) or H(W) or H(Tu) or H(M))
    

and that is of course

    
    
       H(weekday) -> ~H(weekday)
    

This is equivalent to ~H(weekday), since P -> ~P is ~P v ~P, which is just ~P.
So, what the judge said in total is equivalent to the conjunction of these two
propositions:

    
    
       H(weekday) ^ (H(weekday) -> ~H(weekday))
    

Where the right side reduces as above, leaving:

    
    
       H(weekday) ^ ~H(weekday)
    

A direct contradiction: you will be hanged and you won't be hanged.

The prisoner choose to believe that he won't be hanged.

------
frv103
Can this concept be generalized to the point where NOTHING is a surprise? For
example if a surprise party is planned for someone at some point in
$TIME_PERIOD, it can't occur during the very last hour/minute/second of
$TIME_PERIOD because it wouldn't be a surprise. The surprise party can't occur
during $TIME_PERIOD - 1 because this would be known as well. Repeat this ad
infinum just like the weekdays in the article.

~~~
mattdeboard
This sounds like a restatement of the Achilles & the tortoise paradox
[https://en.wikipedia.org/wiki/Zeno%27s_paradoxes#Achilles_an...](https://en.wikipedia.org/wiki/Zeno%27s_paradoxes#Achilles_and_the_tortoise)

------
jzwinck
There is a surprise on Thursday (if not before).

If the prisoner is alive on Thursday at noon he will either be surprised to
find he is to be hanged on Thursday, or surprised to find it will be Friday.
Before that he had 50% expectation for either, and there is bound to be a
negative surprise with regard to one day and a positive surprise for the
other.

~~~
everybodyknows
Right, so if we suppose that the "punch-line" statement, describing the
prisoner's state of mind, is true:

> the executioner knocks on the prisoner's door at noon on Wednesday — which,
> despite all the above, was an utter surprise to him.

Then it follows there are two false epistemological claims in the text. First
by the judge:

>He will not know the day of the hanging until the executioner knocks on his
cell door at noon that day.

This is false, as you correctly reason, since a knock on Friday would come as
no surprise (at the time it occurred).

The second false claim, this time by the narrator, reinforces the first:

>Everything the judge said came true.

Not every claim the judge asserted was tested by the recounted physical
events: There was no knock on Friday.

------
robocat
The prisoner introduces "not being hanged" as an outcome.

However the prisoner doesn't include that outcome in their analysis.

------
air7
I had a thought that this paradox is essentially a self-referencing paradox
akin to "This sentence is false" (which is true if it is false, and false if
it is true).

Consider Friday: The prisoner know that he will be hanged today, so he
realizes he can't be hanged because it wouldn't be a surprise, which makes the
hanging surprising... Or in other words, "I will be hanged" means "I won't be
hanged" (because it won't be a surprise) and "I won't be hanged" means "I will
be hanged" (because it will be a surprise)

------
whoopdedo
Can the prisoner communicate with his jailor? He wakes up every morning and
announces, "I expect I will be hanged today." Then the execution will not be a
surprise if it occurs that day. In order to carry out the judge's order the
execution must occur on a day that he is not expecting it. So rather than
expect he will not be executed on any day, he should start every day as if he
will be executed.

------
Fnoord
Assuming the prisoner may only pick certainty of surprise once it seems the
prisoner would need a trusted third party such as a notary to write down their
solution of choice. Else, they can just reply "wrong, its next day, muwahaha"
unless they picked Friday (in which case, the judge was wrong).

If the prisoner is allowed to pick a day every day, they'd pick the next day
each time and win.

------
EGreg
I remember reading this as a teenager and concluding that the prisoner
actually doesn't know for sure whether he will be hung on Tuesday or not,
because he may be hung on Wednesday. Only on Thursday can he be reasonably
sure he won't be hung on Friday, and thus he would know he is hung on
Thursday. But any day before that, he wouldn't really know.

But also I think Martin Gardner concluded the same thing.

------
rwilson4
It just seems to me it is impossible to be surprised by a bounded random
variable in this context. If the death sentence were carried out x days from
now, where x is drawn from an exponential distribution, that would fulfill the
surprising criterion. The source of the paradox is that the “surprising”
aspect is fundamentally incompatible with the bounded nature of the sentence.

------
twhb
Everybody talking about surprise should read the “Logical school” section, in
particular this reformulation:

> The prisoner will be hanged next week and its date will not be deducible the
> night before using this statement as an axiom.

This paradox isn’t a play on the definition of “surprise”, that’s just a
weakness accidentally introduced by lax wording.

------
squirrelicus
For everyone saying the prisoner can just expect to be hanged every day and
thus never be surprised.... Why do you say that? What reason, on Monday, does
he have to believe that he would be executed on Monday and not the other days?
He can say the words, but I'm not convinced he would be convinced.

~~~
panic
He has a completely valid argument—Friday can be excluded (that wouldn't be a
surprise), Thursday can be excluded (since he already excluded Friday, it
wouldn't be a surprise), and so on, until the last day left is Monday. So he
can conclude the execution must be on that day.

(In fact, he has a valid argument for anything he might want to believe since
the original statement made by the judge is self-contradictory.)

~~~
squirrelicus
This paradox generates so much banter, it's fun!

So now I'm thinking you're wrong because the logic that leads to excluding
Tues-Fri can't also be used to exclude Mon. He can't expect execution on
Monday and expect to be surprise executed on Monday.

When he inducts to Monday and then doesn't get executed Monday, he can't
expect to use the same logic the induct Tuesday. Which means any day then
becomes a surprise. He has a 1/3 chance (since we exlude Friday) of randomly
choosing the right day, but no reason to not be surprised on any day except
Friday.

------
beaner
My thought is that there is no paradox, "Friday" being the execution day can
be a surprise. If the prisoner finds out that Friday is the execution day on
Thursday because he is not executed on Thursday, the specific day is still a
"surprise," just a day earlier than it happens.

~~~
kazinator
The prisoner is specifically told that the surprise will be such that he
doesn't know until the knock on the door on at noon that he will be executed
that day.

He cannot be hanged on Friday without that being a lie.

~~~
beaner
That makes sense.

Maybe an alternative solution is that he is never surprised because he is
expecting it every day.

------
aekotra
The prisoners reasoning is wrong.

> 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.

This belief is FALSE. The moment of surprise for a Friday hanging takes place
at 12pm on Thursday. Of course, this also happens to be the moment of surprise
for a Thursday hanging. In other words, at 11:59am on Thursday he will not
know if his hanging takes place on Thursday or Friday. At 12pm he will be
surprised to know for certain which one it is: it will be Thursday if he hears
a knock and it will be Friday if there is no knock.

The prisoner holds this belief because he makes the FALSE assumption that his
moment of surprise MUST occur at the sound of the knock ON THE DAY of the
hanging. The prisoner _correctly_ understands that there cannot be a moment of
surprise on Friday but, due to this assumption, _incorrectly_ reasons that a
Friday hanging cannot be a surprise. It will be a surprise, but he will
experience that moment on Thursday, not Friday.

The prisoner pictures himself at 12:01pm on Thursday wondering how he could
possibly be surprised for a Friday hanging. He doesn't realize he has ALREADY
been surprised by the news of his Friday hanging. That moment occurred one
minute earlier (12:00pm)!

The remainder of the "paradox" text is rendered nonsensical because the
reasoning is based on the _apparent_ impossibility of being surprised by a
Friday hanging.

TLDR

The prisoner makes the following faulty reasoning:

1) The moment of surprise must occur on the day of the hanging (FALSE)

2) There cannot be a moment of surprise on Friday (TRUE)

-> Therefore, a Friday hanging cannot elicit surprise

-> Therefore, Friday cannot be chosen as the hanging day

-> Therefore, Thursday cannot be chosen as the hanging day, etc

#1 is assumed to be TRUE by the prisoner. Unlike the other days, the moment of
surprise for a Friday hanging occurs the _day before_ when he does NOT hear a
knock at 12pm. Therefore, #1 is false and leads to the false deductions

~~~
incompatible
"He will not know the day of the hanging until the executioner knocks on his
cell door at noon that day."

The wording of the problem is everything.

~~~
aekotra
I am very aware of that line. I've reworded most of the OP, to explain more
clearly!

------
mkeyhani
The backwards induction argument assumes the time of execution is a discrete
variable.

However, at least as far as we know, time seems to be continuous.

~~~
frv103
What about a scenario that describes an event occurring during a discrete
amount of time during a set length of time? For example: A teacher says that
he will give the class a surprise pop quiz at the beginning of class some day
next week. How does reverse induction fail here?

------
mattdeboard
tl;dr: This is a magic trick, not a formal system.

Reminds me of the definition of a magic trick from "The Prestige":

“Every great magic trick consists of three parts or acts. The first part is
called "The Pledge". The magician shows you something ordinary: a deck of
cards, a bird or a man. He shows you this object. Perhaps he asks you to
inspect it to see if it is indeed real, unaltered, normal. But of course... it
probably isn't. The second act is called "The Turn". The magician takes the
ordinary something and makes it do something extraordinary. Now you're looking
for the secret... but you won't find it, because of course you're not really
looking. You don't really want to know. You want to be fooled. But you
wouldn't clap yet. Because making something disappear isn't enough; you have
to bring it back. That's why every magic trick has a third act, the hardest
part, the part we call "The Prestige".”

Kind of abstract but it's like...

\- The Pledge: Hello convict, here is your sentence.

\- The Turn: Actually just kidding, look at this giant loophole in my
sentencing. Wow! Expectations subverted!

\- The Prestige: Haha, no, I'm just messing with you. There's no loophole but
you lacked the context to discern that in The Turn phase.

edit: This is pretty interesting. As the wiki says, how one defines a
"surprise" is the whole bugger of the thing. If you use the magic trick
metaphor, "surprise" is reframed as "context."

The reason it's so murky trying to pick apart what actually happened is hard
is because that's the point of the system. It's designed to be un-figure-out-
able. I would love to know how you'd formalize a system whose output is "lack
of context"

edit2: Also if you zoom out a level, giving someone a link to the Unexpected
Hanging paradox page is a repetition of the same Pledge->Turn->Prestige
pattern

\- The Pledge: Here's a wikipedia page. You've looked at information on
wikipedia pages. You share my confidence this info on this page will adhere to
logical rules.

\- The Turn: Oh but buh-bam, now you are busy trying to unscramble a paradox.

\- The Prestige: You can't figure out paradoxes, that's their point. I will,
however, confess this is a terrible magic trick.

------
S_A_P
I understand the paradox but to me it really just highlights the ambiguity of
the English language. The surprise in this case doesn’t literally mean he will
be surprised, it really just means that he will not be given the information.
The logic of hanging can’t be Friday because it’s not a surprise doesn’t
really work for me. Maybe it’s just the Wikipedia example that’s flawed.

~~~
jjaredsimpson
If I said, "you will be hung tomorrow, and it will be a surprise." That
statement can not be true.

So the prisoner reasons: if it is thursday night, then being hung on a friday
would not a be surprise. So I will not be hung on friday.

Then there is a kind of induction which further rules out each successive day.
I think the thursday night argument is correct, but the induction argument is
wrong.

~~~
S_A_P
I understand that, but I think the definition of surprise is too ambiguous to
really make the inference. I think that surprise could just simply mean he
doesnt know when it will happen- so it could happen at any day at noon. Does
he have to be legitimately SURPRISED that he is being hung? It really just
seems to me that the person on death row is delusional if he makes the
inference that it cant be any day because it has to be a "surprise"

------
eximius
This logic is essentially the solution to the XKCD Blue Eyes puzzle.

I quite like the puzzle and this paradox, but something always feels off about
it.

------
kryogen1c
This doesn't seem complicated. It is not logically possible to make a
psychological statement, ie "you cannot surprise me".

