The Unexpected Hanging is a famous paradox where a prisoner is
sentenced to hang. The sentence specifies the hanging will take place at
noon one day next week, Monday through Friday. The sentence also
specifies the day will be a surprise: the prisoner will not know the
date until noon on that day.
The prisoner reasons that
the hanging cannot take place on Friday, because he would know on
Thursday night. So it must be Monday through Thursday. He then
eliminates Thursday because he would know on Wednesday night. He then
eliminates Wednesday, Tuesday, and Monday, and relaxes because the
sentence cannot be properly carried out on any day. When the executioner
comes on Wednesday, he is surprised and complains that the sentence was
inconsistent. The executioner points out that each part of the
prisoner's sentence turned out to be true.
Some authors
have attempted to resolve the paradox by taking
'surprise' to means he cannot be absolutely sure of the date, in which
case the prisoner's reasoning does not work. But this makes the puzzle
trivial. The sentence could just as well have been "you will be hanged
tomorrow, but you can't be sure of that."
The paradox
does in fact rely on ambiguity in the term 'surprise'. If 'surprise'
means the date of the hanging cannot be deduced using the terms of
sentence as axioms, then there is indeed a contradiction. This does not
mean the prisoner won't be hanged, he just can't be hanged consistently
with the sentence. Thus the paradox is resolved.
There
is a version of the paradox where a professor assigns a pop quiz
sometime next week. She tells the students they will be surprised. Our
intuition tells us that students will indeed be surprised by such a pop
quiz if it is early in the week.
I wondered if the
paradox could be 'reactivated' if there was a way to define 'surprise'
to be consistent with students' intuition. So let's let the students
register their surprise by wagering when the quiz will take place. Each
night students will be allowed to bet that the quiz will be the next
day. Once a student bets he cannot bet again that week. If he is right,
the professor pays him $1. If he is wrong he pays the professor $1. If
he does not bet by the date of the quiz, his payout is 0. For simplicity
let's assume the scenario is repeated every week indefinitely. If we
interpret an event to be 'surprising' if the odds of
it happening are <50%, then the professors statement is that at
least one
day exists where the students should not place any bets.
The
optimal strategy for such a game is a Nash equilibrium. That means the
students will choose their bets according to a probability distribution,
and the professor will choose the date of the quiz according to another
probability distribution. Furthermore, neither can get an additional
advantage by changing their strategy.
I'll save you the
trouble of calculus in 10 variables. The students' optimal strategy is
to bet with probabilities 1/31, 2/31, 4/31, 8/31, 16/31. The professor's
optimal strategy is to hold the quiz with probabilities 16/31, 8/31,
4/31, 2/31, 1/31. If there is a cohort of 31 students who play for 31
weeks, and all the options are exercised proportionally, then each
student will gain $1. For example, the 2 students who bet on Tuesdays
will each gain $1 8 times and lose $1 7 times (when the quiz is on
Wednesday, Thursday, or Friday). Also the professor will lose $1 per
week. If she holds the quiz on a Tuesday, she will gain $1 from the
Monday student and lose $1 each to the 2 Tuesday students.
Now
we can see that the students are never surprised. For example, on
Wednesday night, the odds of the test being on Thursday are 4/7. Thus
the professor's statement is false and the paradox is resolved.
Unfortunately, our intuition that pop quizzes are surprising is likely a result of the poor reasoning skills of students.
Thread locking in SQL Server
-
I just discovered a cool system stored procedure in SQL Server.
sp_getapplock allows you to do thread locking in T-SQL without creating
surrogate DB object...
11 years ago