I wrote this some time ago but have never posted it to the 'net. A brief Google search didn’t turn up any similar papers or writings on this. So, here’s my solution:
Shannon and the Hangman
Shannon Information
Information or surprisal is a measure of the decrease in uncertainty at the receiver. Uncertainty is proportional to entropy and the expected surprisal. Very probable symbols do not decrease the uncertainty about the transmitted message at the receiver as much as very improbable symbols do.
Entropy is not interchangeable with information since entropy is really the weighted average or expected value of the information.
In the presence of noise, the uncertainty does not decrease at as great a rate as it does in the absence of noise. When the noise is great enough, the decrease in uncertainty is zero (no information can be communicated). When the rate of transmission is large enough, the rate at which the code is decreasing our uncertainty is as large as it can be.
Information theoretic analysis of the unexpected hanging paradox
Relax the conditions by allowing the day on which the prisoner will be hanged to be announced ahead of time instead of on the day itself. This removes the logical dependencies.
“I am going to tell you the day on which you will be hanged. It will be sometime in the next x days, and you will be surprised.”
As long as x > 1, the judge is telling the truth. Let us assume that x = 8. How surprised will the prisoner be when he hears which day he will be hanged? If the judge uses coin tosses to decide his day of execution, then the prisoner will receive exactly 3 bits of self-information, which is identically equal to his surprisal.
This result is theoretically sound and self-evident from an information theoretic point of view. We now replace the logical dependency introduced by saying that his day of execution will be told to him on that day.
Let us set x = 8 again. From an information theoretic point of view, this is equivalent to saying, “You will receive up to seven clear bits and a stop bit (set). Which code you receive will surprise you.”
First, note that there is actually a distribution of surprisal:
1 3 bits
01 2.8 bits
001 2.6 bits
0001 2.32 bits
00001 2 bits
000001 1.58 bits
0000001 1 bit
00000001 0 bits
We can see how this is the case by assuming that the judge chooses by a lottery, perhaps using an urn with x-1 white balls and 1 black ball. Each day that the judge draws a white ball, the information content of drawing the black ball on the next day’s lottery decreases. On the first draw, the surprisal of drawing the black ball is 3 bits, but if a white ball is drawn, then the surprisal will be 2.8 bits the following day if the black ball is drawn and so on.
The paradox arises because the judge has stated that the prisoner will be surprised on the day when he finds out he is to be hanged - if the judge were to draw 7 white balls, then there is no need to do a further drawing since the only ball left in the urn is the black ball. Therefore, the prisoner cannot be surprised on the 8th day after 7 white balls have been already drawn.
There is a discrepancy between two, very similar senses of the word “surprise” and these are being conflated. In the first sense, we can say the prisoner will be surprised by the particular code he receives - this is like the first scenario where the judge simply flipped a coin 3 times to decide what day the prisoner will be hanged. In this sense, the judge’s statement is true.
But in the second sense of surprise - the surprise at the receipt of the final stop bit of a code transmitted day-by-day - the judge’s statement is simply false. He claims that the prisoner will (with certainty) be surprised when he learns that he is to be executed but, in fact, the prisoner will not be surprised on the day of his execution in the case when 7 white balls were drawn.
But leaving aside the falsity of the judge’s statement, does the prisoner’s reasoning hold? I think his reasoning does hold and it is a consequence of the contradiction in the judge’s claim that the prisoner will (with certainty) be surprised on the day of his execution, when the last code-sequences above has 0 bits of surprisal. So, the prisoner may use a process of elimination to argue that - since the day of execution can only come on a day when there is some non-zero surprisal - the 8th day cannot be the day on which he is to be executed. Then he can reason that the 7th day would have no surprisal and so on until he has eliminated all the days. Once he has done this, he can simply (and correctly) conclude that the judge’s statement is false.
The fact that the prisoner is still surprised when the knock comes doesn’t mean that there is a paradox. Rather, it is again the result of conflating the two senses of surprise; this time, by switching back to the first sense (surprise at which day he is to be executed). The fact that the prisoner will, of course, be surprised at which of the 8 days is chosen by 3 coin flips (to the tune of 3 bits) does not alter the fact that the judge’s statement was false and would have been shown to be false in the case that the day selected by coin flip is the last day.
Clayton -