I believe that a complete explanation should delineate the exact senses in which this is surprising and in which we know certain propositions. Once this is done, then there will be nothing left to explain. One particular difficulty is that because surprise is used in an incoherent manner, we'll need a contradictory definition of surprise ("D-surprise") in order to model and explain the contradiction.

Let’s assume that the teacher intends to produce a set of days that would “D-surprise the student” in that there isn’t a set of deductive steps that the student can follow on the morning of the exam that would eliminate all other days as possibilities. If no days are in the set, then the warden won’t be able to set the exam and we won’t have a paradox. Let’s first say that the student is “A-surprised” if they can’t deduce on the morning of the exam that the exam is happening given only that it is happening one day that week. Clearly the student will be “A-surprised” if it happens on any day other than Friday. We will say that the student is "B-surprised” if they can’t deduce that the exam is happening on the morning of the exam given the the exam will happen that week and that the teacher will pick a date where the student is A-surprised. Clearly the student is B-surprised if the exam happens before Thursday.

What are the deductive steps that the student can follow. There are only two D-steps:

- Time rule: On a day D, all previous days can be eliminated as possibilities for the exam date
- Surprise rule: If day D is the only possible exam date on day D, then it can be eliminated as a possibility

We can generate all days that would be validate exam dates by applying algorithm X as follows: First the teacher eliminates a day from the set if the student would be A-surprised. Then the teacher looks at the new set of days and sees if the student would be A-surprised on any day in the new set, repeating until no points are eliminated. It can be seen that this process will terminate and that the set produced will be precisely those that D-surprise the student.

But, as we know, this set will come up empty - there is no day that can’t be eliminated by the student’s logic. Define A-knowing, B-knowing and D-knowing as not being A-surprised, B-surprised and D-surprised.

Let's talk about knowledge first:

- If the exam is held on a Friday the student will be A-knowing.
- If the exam is held on a Thursday, then the student is B-knowing.
- On any day the student is almost D-knowing in the sense that D would allow them to eliminate all the other future days and so we could conclude that it was today if this were not incoherent.

Now let's talk about surprise:

- If the exam is held on Friday, then the student will not be surprised
- If the exam is held on Thursday, then the student will be A-surprised
- If the exam is held on a Wednesday, then the student will be A-surprised and B-surprised
- On any day, they will be almost D-surprised in the sense that they are not D-knowing (we can't create a situation where they won't be surprised in whatever sense they already are by adding the D rules because this would make the situation incoherent)

Regarding, the real life example, if it happens on a Thursday and the student complains that they aren't surprised, the teacher can say that they A-surprised them and that they never specified the kind of surprise. If it happens on a Wednesday, then the teacher can say they B-surprised them, which seems closer to the true intent as the student can't conclude the exam is happening that day even if they 100% believe that the teacher is going to at least A-surprise them.

One final point. Suppose we tell a student that they will be A-surprised. Then they will 100% know that it is not Friday. If the test happens on a Thursday, then they will experience B-knowing. This will be the last possible day, so we can see that this is actually "pretty close" to A-knowing, even though it doesn't meet the definition.