I've seen several versions of this paradox--in some, it's an execution rather than an examination (the parallel suggests a rather grim view of the life of an academic), but it's essentially the same. I think it comes from Willard van Orman Quine, a philosopher and logician. Anyway, here's the way it works:

At the beginning of some period (let's say the semester), the professor of some class makes the following guarantee, "At some point during this class, there will be a surprise quiz. You will not know when the quiz is to be administered until I give it." One particularly bright student comes to the conclusion that, in fact, this statement is false, and so there will be no such quiz. She reasons thusly:

If it came to be the last day of the term, and we had not yet had the quiz, we would know that it had to come on that day, and so, since we are guaranteed that it will be a surprise, it cannot. Therefore, the quiz can't occur on the last day. But wait! If it comes to be the second-to-last day, and we haven't yet had the quiz, then we will know it has to come on that day (since we've already determined that it can't come on the last day, and it hasn't come yet). Therefore, when it comes, it will not be a surprise, so it can't happen on the second-to-last day, either. In fact, this same reasoning can be used back to the very first day! So, by simple deduction, it is certain that the professor cannot have spoken truly, and so there will be no quiz.

What makes this a paradox is that it seems as though it guarantees that there simply isn't a way to truly announce a surprise quiz. However, though the flaw in the reasoning may be difficult to see, it seems as though it must be wrong, because the conclusion seems absurd!

An interesting coda has been suggested by Selmer Bringsjord. In it, the student remains relaxed throughout the semester, knowing that the quiz can never come. However, precisely because she has figured this out, when the quiz comes on the last day, it is a surprise to her. :-)


In reply to Gritchka's well-developed writeup, there seems to be a problem. You've concluded, seemingly correctly (though there are questionable steps, they seem largely unnecessary, such that the conclusion seems still to be well-supported), that, "If it were true what the judge/teacher said that it would be unexpected whenever it was, then you could conclude U(4) to U(1) and derive a contradiction. But phrasing it as the row from Alfie to Eric clearly shows that it is not true. And that's fine: that's our common sense understanding." Essentially, the initial statement by the teacher was false.

Here's the further problem, then--logic seems to suggest that one could not honestly include a surprise examination in a syllabus, yet this seems to occur quite frequently. There's still a paradox, only now the problem is that there is a statement which seems to be both clearly possible, and yet necessarily false.


Reply to Gritchka's reply to my reply to his writeup:

The following statements are inconsistent:
  • On December 30th, you don't know whether the fire drill will be a surprise.
  • You believe the claims of the administration that there will be a surprise fire drill.
If you really don't know whether to believe the administration, then since there is no external guarantee that they'll keep their word about having the fire drill at all (both because laws are sometimes broken and to keep faith with the original example of the surprise examination), and people often believe that the chances they will keep their word decrease as December 31 approaches, it can still be a surprise even on the last day of the year.

So my sense is that what's really going on is a very subtle disanalogy in the examples we're considering. It matters whether there is outside confirmation--the fact that there is only one source for information about both the rule and the examination's existence makes things interesting.
I'm surprised (oops, no pun intended) that there hasn't been more discussion of this here, or in the node the unexpected hanging, which also just states the paradox. A lot has been said about it in the literature, but as it's phrased, no-one I've seen has come up with a satisfactory resolution.

So I think I'm making a nontrivial claim when I say I've invented an equivalent (I think) formulation where the solution can be worked out clearly.

There are two big confusing things in it, the passage of time and what it is to expect something. You could stiffen the notion of expectation by saying the student or prisoner has a vote to cast, one only, which they can use only at the beginning of a day. If they click the checkbox on Tuesday, that's it, they're expecting it on Tuesday. Or: if they click it, for Tuesday, in advance of Tuesday, they're saying I now (Monday) expect it will happen on this future day. Well, others may wish to amplify on these possibilities; I leave it to them.

I recast the problem as a spatial one, and instead of expectation there is direct visual knowledge. This removes all uncertainties that confuse us.

Problem

Consider five people in a row, call them Alfie, Bert, Charlie, Dickie, and Eric. Alfie is facing the front and cannot see the others. Bert is behind Alfie and can see his back. Charlie is behind Bert and can see Alfie's and Bert's backs. And so on, the last person can clearly observe the backs of everyone in front. But no-one can inspect their own.

The experimenter has, let's say, a large gold star made of felt, adhesive on on side. She walks down the row clapping each person on the back. Each person feels the same sensation. For one of them, the experimenter twists her wrist so that the gold star adheres to that person's back. When she gets to the end she returns to the front where they can all see her, devoid of gold star. All know that one of them has the star; and anyone behind the star-bearer has clear sight of it; but none of them can see or feel if they themselves or someone behind them has the star. This situation is, I hope, clear. And it can be made clear to the participants in practice runs, if need be.

Now the star-less experimenter makes the unexpected hanging/test statement: "One of you has the star, but that person will not be able to work out if they have it."

Eric knows whether he's got it. Obviously he could see it if he hadn't got it. Dickie either knows who's got it, ahead of him, or reasons that if Eric had it Eric would be able to falsify the experimenter's statement, so he Dickie must have it: but this also falsifies the experimenter's claim. And so on up the line.

But Bertie, say, having just worked out that Eric can't have it, therefore Dickie can't have it, therefore Charlie can't have it, therefore he Bertie must have it - plainly has no idea where it is. And so the experimenter's claim about not being able to know where it is, seems to be true. Paradox.

Solution

Couched in this way, the fallacy is more easily seen. Here's what seems to be happening: Each of them works out that the experimenter's claim (equivalent to the judge's sentence or the professor's announcement) must be false. Yet jointly all of these conclusions yield the contrary conclusion that it is in fact true.

Here's what is actually happening. The experimenter's claim in English is that "Whoever has the star... they will not know...". The relative scope of the quantifiers is being misinterpreted. What it actually means is

    forAll X (X has-star -> not (X knows-has-star))
of which the negation is
    Exists X (not (X has-star -> not (X knows-has-star)))
<=> Exists X ((X has star) and not (X knows-has-star))
or back in English, one of them has the star, but doesn't know it.

Is this true or not? Well it's true if X is Alfie to Dickie, but false for Eric. So the experimenter's universal statement is false.

In the temporal case however you don't start thinking on Friday, you start on Monday. And you think of yourself as the same person on each day. So you tackle the problem on Monday as Alfie. And Alfie, of course can't tell whether they have the star. The conclusion seems to be that "I can't tell", where "I" ranges over all five days.

Let U(d) be the claim that on day d, the test or hanging will occur and be unexpected. The teacher or judge asserts that forAll d U(d). The paradox logic first deduces that U(5) is impossible. Then it works back through U(4) to U(1), all of which turn out to be false, so the forAll must also be false.

But of course U(d) is true for d = 1 to 4. On those days you don't know which day you're to be hanged/tested. Only for d = 5 is it actually false. So the judge's/teacher's statement of forAll is false. Therefore its negation is true, but its negation is merely that for some d, U(d) is true. And indeed this is true for four of the five d.

In this case, why do we mistakenly conclude U(d) for every d?

On day d = 5, we know with certainty not U(1) & ... & not U(4). Therefore also if we are to be hanged/tested at all, then not U(5). That is, if we assume the claim forAll d U(d). If we do, we derive a contradiction, so we deduce the original premiss is false. But on day 5 we know U(5) whether or not the claim is true. If we are hanged, it will not be unexpected; or we will not be hanged. It is not derived from the universal.

On day d = 4, we know with certainty not U(1) & not U(2) & not U(3). We begin by not knowing whether U(4) is true. But U(5) is true absolutely. This still does not prove U(4). If we further assume the judge's/teacher's claim, then U(4) follows. But it does not follow from U(5).

In that case the chain of reasoning simply stops. You can deduce U(5), you can't go further back. If it were true what the judge/teacher said that it would be unexpected whenever it was, then you could conclude U(4) to U(1) and derive a contradiction. But phrasing it as the row from Alfie to Eric clearly shows that it is not true. And that's fine: that's our common sense understanding.


Back to the future

To answer kelrin's final remark in answer to this, and to take it back to a time-based situation, there is nothing paradoxical about surprises, nor of someone telling you in advance that there will be a surprise. It's true, this happens all the time. And we are indeed usually surprised when the thing happens. The only thing that's ruled out is someone telling you that you will be surprised no matter what day it happens.

Think of a fire drill. There is a legal requirement to hold a fire drill once a year, and a memo comes around the office to this effect in late October; and to be useful, the fire drill will be a surprise. If you get to 31 December and it hasn't happened yet, you know it must happen today (is legally required to), and that therefore it won't be a surprise. So the bit in the original announcement about its being a surprise was false, in this case, for this day.

But on 30 December you know it must happen today or tomorrow, but you don't know which, and also therefore you don't yet know whether it'll be a surprise. If it happens today, it'll be a surprise. In fact the fire alarm goes off suddenly on 17 November, fulfilling both the legal requirement and the announcement of a surprise.

My spatial reasoning shows that the case of the last day is different. For that day only, there is no uncertainty, and so if you get to that position, then part of the original statement proves false. They can't state it will be a surprise; but they can quite reasonably state that it probably will be.

The paradox here is easily resolved once you realize that "knowing that you will know something in the future" does not imply that you know it now. This is why there is a time-related aspect of these problems (surprise examination, unexpected hanging, egg in a box).

It is clear that on the last possible day, you will know that the event has to come. And you may know that you will know this, come the last possible day -- but that does not mean that you know it on the second-to-last possible day. Which sounds confusing, but is true.

Let's take a simplified example: the teacher says there will be a pop quiz -- which will be a surprise -- either Thursday or Friday, and that the students will not know ahead of time which day it will be. Following the logic laid out in the paradox, the students know it will not be Friday, implying it has to be Thursday, but, since they know this, the teacher has lied. Yet the teacher can give out the pop quiz on Thursday, as we're aware.

The teacher can do this because, while the students on Friday morning will know that the test must be given on Friday, the students Thursday morning do not. Why? Because they are missing a piece of information they do not (and cannot) know: That the quiz was not given out on Thursday. Until they know that, they cannot apply their knowledge of what will happen on Friday, because it rests on that assumption.

So, to rephrase the original situation:

The bright student may reason (correctly) the following:
If the quiz is not given on Monday through Thursday, it must be given on Friday.
Continuing, the student may reason (correctly) the following:
If the quiz is not given on Monday through Wednesday, it must given on Thursday through Friday.
If the quiz is not given on Monday through Tuesday, it must be given on Wednesday through Friday.
If the quiz is not given on Monday, it must be given on Tuesday through Friday.


Spelled out like this, the flaw in the student's logic becomes apparent. To know that the quiz must be given out on Friday, you must also know that the quiz was not given out on Monday through Thursday. If it is, for example, Wednesday morning, you do not know this -- you only know that the quiz was not given on Monday through Tuesday. What the bright student is doing is assuming that her proposition is true, with the following steps:
1) If the quiz hasn't been given out until Friday, then it cannot be given out on Friday.
2) If it hasn't been given out before Thursday, and it cannot be given out on Friday, then it must be given out on Thursday.
3) If the quiz hasn't been given out before Wednesday, and it cannot be given out on Friday, and it cannot be given out on Thursday, it cannot be given out on Wednesday.
(etc)

However, the student can't know that it can't be given out on Thursday until after Wednesday is over, and the student can't know that it can't be given out on Friday until Thursday is over. Since the student knows none of this on Monday morning, her statement is false.

The student's logic seems good. But we know from experience that something's just not right. Do we accept what we know from intuition to be true or do we believe in the fairy tale the student conjured for us ?

"At some point during this class, there will be a surprise quiz. You will not know when the quiz is to be administered until I give it." Note that he never says that a student wouldn't know what day the quiz would happen on...this will be important later.

Let's play devil's advocate for a moment:

  • We know that when the student reaches the final day of the class, she knows that she will be quizzed that day, so the quiz won't surprise her.
  • We also know that when the student reaches the final term1 of the class, she knows that she will be quizzed that term, so the quiz won't surprise her.

That doesn't make much sense. Even though she knew what term the quiz would occur in, she considered the actual day (a smaller amount of time than a term) to be a surprise before she used her "logic."

In the same respect, if the student reaches the last day, she still will not know what time that day the quiz is to be administered. She might be lucky and have a few minutes to study hard -OR- she might have to take the quiz right away. But, she thinks those details are trivial; the exact time is not important enough for her to be surprised by it.

It all comes down to when, in a certain situation, surprise "disappears". If you wouldn't be surprised during the last day, simply because you know what day the quiz will happen on, you might still be surprised during a different day, if the quiz happened then instead; it just depends on your "surprise horizon." That horizon is a subjective, incredibly malleable, psychological concept that can change depending on the situation. But, it cannot be extended infinitely with logical trickery, as the student did.

If your surprise horizon is knowing what one day a quiz will happen on, it cannot be extended to two days, then three days, then four days, and so on until all days of the term are covered. You decide what surprises you, not some (il)logical formula.

You're no longer trapped in the web of deceit spun by the student. Congratulations.

But wait, there's more

Then again, you could look at it this way: surprise happens when you find out the answer. So, in the scenario above, you would be surprised that the quiz didn't happen on the day before last (you might have been in suspense, expecting it at any moment, and been surprised when it didn't happen). So, the surprise about the timing of the test is still there.


A good, related quote: Paradoxes don't exist in the real world, because things are rarely cut-and-dry into boolean logic.robbway in the Reconciling Logical Paradoxes node.


1semester or year or whatever the term length is

The apparent paradox is that the logical deduction of the statement allows for the truth. This professor can make this bold statement because of the way humans think. Most people can make a guess at the unknown, but they are not sure of it, and they do not know the truth. The know-it-all who attempts to use the above logic then knows only that the test will not be administered.

Imagine a class of 19 students, identified as A through S, for short. On Monday, at the beginning of class, the professor makes his statement. Assume:

The professor then administers the test 5 minutes after his announcement (on Monday), having given student S sufficient time to work out the logic.

After the test was given, students E-R are surprised, but also impressed that the professor tricked them. Student S is utterly shocked, as his prized logic has failed him. Students A-D, however, protest. They tell the professor that they knew it would be on Monday. He asks them how they knew, and they reply, "Well, we just kinda guessed, really." The professor is then vindicated, as some assumed it would be on Monday, but none knew that it would be on Monday.

The important factor in this problem is human behavior. Unlike computers, humans rarely think in absolute terms, and the declaration that one knows something does not actually mean that one does know something. Thus, even if 5 students each say that they know the day of the test, and each claims a different day, they do not actually know that the test will be on their chosen day; they are lying to attempt to cheat the professor.


tdent says re: Paradox of the surprise examination: The usual definition of knowledge is a justified true belief. Since S's belief is not true, and (of course) isn't really justified, it can't be called knowledge.
I don't agree. Many people knew that the earth was flat. It turns out that it was a false belief, but in the context of the ancient world, it might be called knowledge. Regardless, the professor still "wins".

I have seen multiple versions of this problem, expressed in different ways. The way that I first heard it (similar to the way Kelrin expresses it), has an easy answer:

"Part of your grade is a surprise quiz, to be administered at some time during the semester. You will not know when the quiz is to be administered until I give it."

Since as soon as the statement is made, a smart student (using Kelrin's logic) could work out that the quiz cannot be given at any point in the future, the only way for the professor's statement to be true is if the quiz has already been given. If no other quizzes have been given during the semester, then the only obvious question is, "How can my seemingly paradoxical statement be true?"

The professor's announcement is, in fact, the quiz. The professor's statement is true: a quiz occurred, and no student knew when (or even if) it was going to be administered, until it actually was administered. The correct answer to the quiz is merely to deduce this fact.

Log in or register to write something here or to contact authors.